summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2007-10-16 02:34:58 +0000
committerRichard M. Stallman <rms@gnu.org>2007-10-16 02:34:58 +0000
commit974992a66b4d7e85549b76411b607836f27f6045 (patch)
treeb39f10e18d98db0444c39d1ff8a0097b916f6a22 /lisp/emacs-lisp
parentde13cecf7a1d7525e54b5a93a59dcc40a1582ee4 (diff)
downloademacs-974992a66b4d7e85549b76411b607836f27f6045.tar.gz
emacs-974992a66b4d7e85549b76411b607836f27f6045.tar.bz2
emacs-974992a66b4d7e85549b76411b607836f27f6045.zip
(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.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/advice.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index ed97c8786d4..a969308be2a 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -2013,7 +2013,10 @@ On each iteration VAR will be bound to the name of an advised function
(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 @@ On each iteration VAR will be bound to the name of an advised function
(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 @@ Assumes that FUNCTION has not yet been advised."
(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: