# HG changeset patch # User Richard M. Stallman # Date 1192502050 0 # Node ID 8632fa2db924acb3c7fc3786e146c18cb911104e # Parent 29179c78331df3ba469aa3f11c2675d8d30458a6 (ad-get-advice-info): Change to a function. (ad-get-advice-info-macro): New macro, like old ad-get-advice-info. (ad-is-advised, ad-get-advice-info-field) (ad-set-advice-info-field): Use ad-get-advice-info-macro. diff -r 29179c78331d -r 8632fa2db924 lisp/emacs-lisp/advice.el --- a/lisp/emacs-lisp/advice.el Tue Oct 16 02:24:50 2007 +0000 +++ b/lisp/emacs-lisp/advice.el Tue Oct 16 02:34:10 2007 +0000 @@ -2013,7 +2013,10 @@ (if (not (get 'ad-do-advised-functions 'lisp-indent-hook)) (put 'ad-do-advised-functions 'lisp-indent-hook 1)) -(defmacro ad-get-advice-info (function) +(defun ad-get-advice-info (function) + (get function 'ad-advice-info)) + +(defmacro ad-get-advice-info-macro (function) `(get ,function 'ad-advice-info)) (defmacro ad-set-advice-info (function advice-info) @@ -2025,7 +2028,7 @@ (defmacro ad-is-advised (function) "Return non-nil if FUNCTION has any advice info associated with it. This does not mean that the advice is also active." - (list 'ad-get-advice-info function)) + (list 'ad-get-advice-info-macro function)) (defun ad-initialize-advice-info (function) "Initialize the advice info for FUNCTION. @@ -2035,16 +2038,16 @@ (defmacro ad-get-advice-info-field (function field) "Retrieve the value of the advice info FIELD of FUNCTION." - `(cdr (assq ,field (ad-get-advice-info ,function)))) + `(cdr (assq ,field (ad-get-advice-info-macro ,function)))) (defun ad-set-advice-info-field (function field value) "Destructively modify VALUE of the advice info FIELD of FUNCTION." (and (ad-is-advised function) - (cond ((assq field (ad-get-advice-info function)) + (cond ((assq field (ad-get-advice-info-macro function)) ;; A field with that name is already present: - (rplacd (assq field (ad-get-advice-info function)) value)) + (rplacd (assq field (ad-get-advice-info-macro function)) value)) (t;; otherwise, create a new field with that name: - (nconc (ad-get-advice-info function) + (nconc (ad-get-advice-info-macro function) (list (cons field value))))))) ;; Don't make this a macro so we can use it as a predicate: