changeset 8448:b6335ce87e16

(Fdefine_function, Fdefalias): Handle advice as in Ffset. (Qad_advice_info): Lisp and C names renamed from Qadvice_info. (Qad_activate): C name renamed from Qactivate_advice.
author Richard M. Stallman <rms@gnu.org>
date Thu, 04 Aug 1994 22:57:13 +0000
parents 0e699538d256
children 805f9284065b
files src/data.c
diffstat 1 files changed, 19 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/data.c	Thu Aug 04 22:33:36 1994 +0000
+++ b/src/data.c	Thu Aug 04 22:57:13 1994 +0000
@@ -74,7 +74,7 @@
 Lisp_Object Qbuffer_or_string_p;
 Lisp_Object Qboundp, Qfboundp;
 Lisp_Object Qcdr;
-Lisp_Object Qadvice_info, Qactivate_advice;
+Lisp_Object Qad_advice_info, Qad_activate;
 
 Lisp_Object Qrange_error, Qdomain_error, Qsingularity_error;
 Lisp_Object Qoverflow_error, Qunderflow_error;
@@ -556,9 +556,9 @@
 			     Vautoload_queue);
   XSYMBOL (sym)->function = newdef;
   /* Handle automatic advice activation */
-  if (CONSP (XSYMBOL (sym)->plist) && !NILP (Fget (sym, Qadvice_info)))
+  if (CONSP (XSYMBOL (sym)->plist) && !NILP (Fget (sym, Qad_advice_info)))
     {
-      call2 (Qactivate_advice, sym, Fbyte_code_function_p (newdef));
+      call2 (Qad_activate, sym, Qnil);
       newdef = XSYMBOL (sym)->function;
     }
   return newdef;
@@ -577,6 +577,12 @@
     Vautoload_queue = Fcons (Fcons (sym, XSYMBOL (sym)->function),
 			     Vautoload_queue);
   XSYMBOL (sym)->function = newdef;
+  /* Handle automatic advice activation */
+  if (CONSP (XSYMBOL (sym)->plist) && !NILP (Fget (sym, Qad_advice_info)))
+    {
+      call2 (Qad_activate, sym, Qnil);
+      newdef = XSYMBOL (sym)->function;
+    }
   LOADHIST_ATTACH (sym);
   return newdef;
 }
@@ -592,6 +598,12 @@
     Vautoload_queue = Fcons (Fcons (sym, XSYMBOL (sym)->function),
 			     Vautoload_queue);
   XSYMBOL (sym)->function = newdef;
+  /* Handle automatic advice activation */
+  if (CONSP (XSYMBOL (sym)->plist) && !NILP (Fget (sym, Qad_advice_info)))
+    {
+      call2 (Qad_activate, sym, Qnil);
+      newdef = XSYMBOL (sym)->function;
+    }
   LOADHIST_ATTACH (sym);
   return newdef;
 }
@@ -2058,8 +2070,8 @@
   Qcdr = intern ("cdr");
 
   /* Handle automatic advice activation */
-  Qadvice_info = intern ("advice-info");
-  Qactivate_advice = intern ("ad-activate");
+  Qad_advice_info = intern ("ad-advice-info");
+  Qad_activate = intern ("ad-activate");
 
   error_tail = Fcons (Qerror, Qnil);
 
@@ -2243,8 +2255,8 @@
   staticpro (&Qboundp);
   staticpro (&Qfboundp);
   staticpro (&Qcdr);
-  staticpro (&Qadvice_info);
-  staticpro (&Qactivate_advice);
+  staticpro (&Qad_advice_info);
+  staticpro (&Qad_activate);
 
   defsubr (&Seq);
   defsubr (&Snull);