Mercurial > emacs
changeset 8401:1eee41c8120c
(syms_of_data): Set up Qadvice_info, Qactivate_advice.
(Ffset): Activate advice if symbol has advice-info property.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 31 Jul 1994 20:57:45 +0000 |
parents | cc016ca78c9e |
children | f1a7929cee65 |
files | src/data.c |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/data.c Sun Jul 31 20:47:15 1994 +0000 +++ b/src/data.c Sun Jul 31 20:57:45 1994 +0000 @@ -74,6 +74,7 @@ Lisp_Object Qbuffer_or_string_p; Lisp_Object Qboundp, Qfboundp; Lisp_Object Qcdr; +Lisp_Object Qadvice_info, Qactivate_advice; Lisp_Object Qrange_error, Qdomain_error, Qsingularity_error; Lisp_Object Qoverflow_error, Qunderflow_error; @@ -554,6 +555,12 @@ Vautoload_queue = Fcons (Fcons (sym, XSYMBOL (sym)->function), Vautoload_queue); XSYMBOL (sym)->function = newdef; + /* Handle automatic advice activation */ + if (!NILP (Fget (sym, Qadvice_info))) + { + call2 (Qactivate_advice, sym, Fbyte_code_function_p (newdef)); + newdef = XSYMBOL (sym)->function; + } return newdef; } @@ -2050,6 +2057,10 @@ Qcdr = intern ("cdr"); + /* Handle automatic advice activation */ + Qadvice_info = intern ("advice-info"); + Qactivate_advice = intern ("ad-activate"); + error_tail = Fcons (Qerror, Qnil); /* ERROR is used as a signaler for random errors for which nothing else is right */ @@ -2232,6 +2243,8 @@ staticpro (&Qboundp); staticpro (&Qfboundp); staticpro (&Qcdr); + staticpro (&Qadvice_info); + staticpro (&Qactivate_advice); defsubr (&Seq); defsubr (&Snull);