]> code.delx.au - gnu-emacs/blobdiff - src/data.c
Merge from emacs--devo--0
[gnu-emacs] / src / data.c
index 6439686dcd9fe36fac0dd32a270445e590607d0b..81cffcb38deee72dda7f45700c203a549ac9a79b 100644 (file)
@@ -663,12 +663,20 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
      (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 @@ Value, if non-nil, is a list \(interactive SPEC).  */)
      Lisp_Object cmd;
 {
   Lisp_Object fun = indirect_function (cmd); /* Check cycles.  */
-  
+
   if (NILP (fun) || EQ (fun, Qunbound))
     return Qnil;