--- src/eval.c.orig 2006-10-27 16:44:53.000000000 -0700 +++ src/eval.c 2006-10-30 12:07:37.000000000 -0800 @@ -2082,7 +2083,19 @@ /* Value saved here is to be restored into Vautoload_queue. */ record_unwind_protect (un_autoload, Vautoload_queue); Vautoload_queue = Qt; - Fload (Fcar (Fcdr (fundef)), Qnil, noninteractive ? Qt : Qnil, Qnil, Qt); + // this prevents advice on load from taking effect -- it calls Fload directly. + // Fload (Fcar (Fcdr (fundef)), Qnil, noninteractive ? Qt : Qnil, Qnil, Qt); + // Instead we gather up our args to pass to "funcall". + // We pass in the symbol "load" so redefinitions apply. + Lisp_Object* load_fun_args = (Lisp_Object*) alloca(6 * sizeof(Lisp_Object)); + load_fun_args[0]=intern("load"); + load_fun_args[1]=(Fcar (Fcdr (fundef))); + load_fun_args[2]=Qnil; + load_fun_args[3]=(noninteractive ? Qt : Qnil); + load_fun_args[4]=Qnil; + load_fun_args[5]=Qt; + // now do it... + Ffuncall(5,load_fun_args); /* Save the old autoloads, in case we ever do an unload. */ queue = Vautoload_queue;