aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2007-10-16 02:34:58 +0000
committerRichard M. Stallman2007-10-16 02:34:58 +0000
commit974992a66b4d7e85549b76411b607836f27f6045 (patch)
treeb39f10e18d98db0444c39d1ff8a0097b916f6a22
parentde13cecf7a1d7525e54b5a93a59dcc40a1582ee4 (diff)
downloademacs-974992a66b4d7e85549b76411b607836f27f6045.tar.gz
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.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/emacs-lisp/advice.el15
2 files changed, 16 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c8182d76fe5..49ce02d5bbe 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12007-10-16 Richard Stallman <rms@gnu.org>
2
3 * emacs-lisp/advice.el (ad-get-advice-info): Change to a function.
4 (ad-get-advice-info-macro): New macro, like old ad-get-advice-info.
5 (ad-is-advised, ad-get-advice-info-field)
6 (ad-set-advice-info-field): Use ad-get-advice-info-macro.
7
12007-10-16 Glenn Morris <rgm@gnu.org> 82007-10-16 Glenn Morris <rgm@gnu.org>
2 9
3 * simple.el (blink-matching-open): Don't report false errors with 10 * simple.el (blink-matching-open): Don't report false errors with
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
2013(if (not (get 'ad-do-advised-functions 'lisp-indent-hook)) 2013(if (not (get 'ad-do-advised-functions 'lisp-indent-hook))
2014 (put 'ad-do-advised-functions 'lisp-indent-hook 1)) 2014 (put 'ad-do-advised-functions 'lisp-indent-hook 1))
2015 2015
2016(defmacro ad-get-advice-info (function) 2016(defun ad-get-advice-info (function)
2017 (get function 'ad-advice-info))
2018
2019(defmacro ad-get-advice-info-macro (function)
2017 `(get ,function 'ad-advice-info)) 2020 `(get ,function 'ad-advice-info))
2018 2021
2019(defmacro ad-set-advice-info (function advice-info) 2022(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
2025(defmacro ad-is-advised (function) 2028(defmacro ad-is-advised (function)
2026 "Return non-nil if FUNCTION has any advice info associated with it. 2029 "Return non-nil if FUNCTION has any advice info associated with it.
2027This does not mean that the advice is also active." 2030This does not mean that the advice is also active."
2028 (list 'ad-get-advice-info function)) 2031 (list 'ad-get-advice-info-macro function))
2029 2032
2030(defun ad-initialize-advice-info (function) 2033(defun ad-initialize-advice-info (function)
2031 "Initialize the advice info for FUNCTION. 2034 "Initialize the advice info for FUNCTION.
@@ -2035,16 +2038,16 @@ Assumes that FUNCTION has not yet been advised."
2035 2038
2036(defmacro ad-get-advice-info-field (function field) 2039(defmacro ad-get-advice-info-field (function field)
2037 "Retrieve the value of the advice info FIELD of FUNCTION." 2040 "Retrieve the value of the advice info FIELD of FUNCTION."
2038 `(cdr (assq ,field (ad-get-advice-info ,function)))) 2041 `(cdr (assq ,field (ad-get-advice-info-macro ,function))))
2039 2042
2040(defun ad-set-advice-info-field (function field value) 2043(defun ad-set-advice-info-field (function field value)
2041 "Destructively modify VALUE of the advice info FIELD of FUNCTION." 2044 "Destructively modify VALUE of the advice info FIELD of FUNCTION."
2042 (and (ad-is-advised function) 2045 (and (ad-is-advised function)
2043 (cond ((assq field (ad-get-advice-info function)) 2046 (cond ((assq field (ad-get-advice-info-macro function))
2044 ;; A field with that name is already present: 2047 ;; A field with that name is already present:
2045 (rplacd (assq field (ad-get-advice-info function)) value)) 2048 (rplacd (assq field (ad-get-advice-info-macro function)) value))
2046 (t;; otherwise, create a new field with that name: 2049 (t;; otherwise, create a new field with that name:
2047 (nconc (ad-get-advice-info function) 2050 (nconc (ad-get-advice-info-macro function)
2048 (list (cons field value))))))) 2051 (list (cons field value)))))))
2049 2052
2050;; Don't make this a macro so we can use it as a predicate: 2053;; Don't make this a macro so we can use it as a predicate: