# HG changeset patch # User Juanma Barranquero # Date 1192382499 0 # Node ID 3fd2159a6a89e4aa6288ca34ba5c2621b548be5a # Parent b4736439ea2d79dcb5e6c75a51a0911380035108 (Ffset): Save autoload of the function being set. diff -r b4736439ea2d -r 3fd2159a6a89 src/data.c --- a/src/data.c Sun Oct 14 17:20:53 2007 +0000 +++ b/src/data.c Sun Oct 14 17:21:39 2007 +0000 @@ -663,12 +663,20 @@ (symbol, definition) register Lisp_Object symbol, definition; { + register Lisp_Object function; + CHECK_SYMBOL (symbol); if (NILP (symbol) || EQ (symbol, Qt)) xsignal1 (Qsetting_constant, symbol); - if (!NILP (Vautoload_queue) && !EQ (XSYMBOL (symbol)->function, Qunbound)) - Vautoload_queue = Fcons (Fcons (symbol, XSYMBOL (symbol)->function), - Vautoload_queue); + + function = XSYMBOL (symbol)->function; + + if (!NILP (Vautoload_queue) && !EQ (function, Qunbound)) + Vautoload_queue = Fcons (Fcons (symbol, function), Vautoload_queue); + + if (CONSP (function) && EQ (XCAR (function), Qautoload)) + Fput (symbol, Qautoload, XCDR (function)); + XSYMBOL (symbol)->function = definition; /* Handle automatic advice activation */ if (CONSP (XSYMBOL (symbol)->plist) && !NILP (Fget (symbol, Qad_advice_info))) @@ -752,7 +760,7 @@ Lisp_Object cmd; { Lisp_Object fun = indirect_function (cmd); /* Check cycles. */ - + if (NILP (fun) || EQ (fun, Qunbound)) return Qnil;