aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2007-10-16 02:37:33 +0000
committerRichard M. Stallman2007-10-16 02:37:33 +0000
commit745dc723d967d3a880b2a560e4b87b58c94e89cc (patch)
treef87b0a6e616c05d184c80bc266ae0612d4ec70dc
parent6e5d0e9e73b77c46af982a7d5b4043b183f9c69f (diff)
downloademacs-745dc723d967d3a880b2a560e4b87b58c94e89cc.tar.gz
emacs-745dc723d967d3a880b2a560e4b87b58c94e89cc.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 96d6a627dcd..274d26d7d57 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-15 Stefan Monnier <monnier@iro.umontreal.ca> 82007-10-15 Stefan Monnier <monnier@iro.umontreal.ca>
2 9
3 * vc-hooks.el (vc-workfile-version): Compatibility alias. 10 * vc-hooks.el (vc-workfile-version): Compatibility alias.
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index cabd0dd391e..4a5c9149a43 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: