Mercurial > emacs
changeset 79083:de1e5c00a8ce
(Ffset): Save autoload of the function being set.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Sun, 14 Oct 2007 18:00:31 +0000 |
parents | b27741b11f5a |
children | 1321ef56d537 |
files | src/data.c |
diffstat | 1 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/data.c Sun Oct 14 18:00:05 2007 +0000 +++ b/src/data.c Sun Oct 14 18:00:31 2007 +0000 @@ -662,12 +662,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)))