Mercurial > emacs
changeset 85292:3fd2159a6a89
(Ffset): Save autoload of the function being set.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Sun, 14 Oct 2007 17:21:39 +0000 |
parents | b4736439ea2d |
children | 03314a80fe7f |
files | src/data.c |
diffstat | 1 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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;