aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2007-07-26 18:49:14 +0000
committerStefan Monnier2007-07-26 18:49:14 +0000
commit05bfa8f34f3eedec3ad2fdb45971476a8c8f49b1 (patch)
treef838b1c60a58457210d961fc4f0afae00492db28
parent625f71cff9f69fb0ca47aedbb69111f22186e628 (diff)
downloademacs-05bfa8f34f3eedec3ad2fdb45971476a8c8f49b1.tar.gz
emacs-05bfa8f34f3eedec3ad2fdb45971476a8c8f49b1.zip
(ad-interactive-p, ad-interactive-form): Remove.
(ad-body-forms, ad-advised-interactive-form, ad-make-cache-id) (ad-make-advised-definition, ad-cache-id-verification-code): Use commandp and interactive-form instead.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/emacs-lisp/advice.el41
2 files changed, 20 insertions, 30 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 616dfd16859..378d0c3fe22 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,8 +1,15 @@
12007-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * emacs-lisp/advice.el (ad-interactive-p, ad-interactive-form): Remove.
4 (ad-body-forms, ad-advised-interactive-form, ad-make-cache-id)
5 (ad-make-advised-definition, ad-cache-id-verification-code):
6 Use commandp and interactive-form instead.
7
12007-07-26 Dan Nicolaescu <dann@ics.uci.edu> 82007-07-26 Dan Nicolaescu <dann@ics.uci.edu>
2 9
3 * vc-git.el: Relicense to GPLv3 or later. 10 * vc-git.el: Relicense to GPLv3 or later.
4 (vc-directory-exclusion-list, vc-handled-backends): Remove. 11 (vc-directory-exclusion-list, vc-handled-backends): Remove.
5 12
6 * vc-hooks.el (vc-handled-backends): Add GIT. 13 * vc-hooks.el (vc-handled-backends): Add GIT.
7 14
8 * vc.el (vc-directory-exclusion-list): Add .git. 15 * vc.el (vc-directory-exclusion-list): Add .git.
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index 4891de726b8..c6e80453d72 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -2473,10 +2473,6 @@ will clear the cache."
2473 (setq definition (indirect-function definition))) 2473 (setq definition (indirect-function definition)))
2474 (and (subrp definition) (eq (cdr (subr-arity definition)) 'unevalled))) 2474 (and (subrp definition) (eq (cdr (subr-arity definition)) 'unevalled)))
2475 2475
2476(defmacro ad-interactive-p (definition)
2477 ;;"non-nil if DEFINITION can be called interactively."
2478 (list 'commandp definition))
2479
2480(defmacro ad-subr-p (definition) 2476(defmacro ad-subr-p (definition)
2481 ;;"non-nil if DEFINITION is a subr." 2477 ;;"non-nil if DEFINITION is a subr."
2482 (list 'subrp definition)) 2478 (list 'subrp definition))
@@ -2590,22 +2586,13 @@ that property, or otherwise use `(&rest ad-subr-args)'."
2590 (natnump docstring)) 2586 (natnump docstring))
2591 docstring))) 2587 docstring)))
2592 2588
2593(defun ad-interactive-form (definition)
2594 "Return the interactive form of DEFINITION."
2595 (cond ((ad-compiled-p definition)
2596 (and (commandp definition)
2597 (list 'interactive (aref (ad-compiled-code definition) 5))))
2598 ((or (ad-advice-p definition)
2599 (ad-lambda-p definition))
2600 (commandp (ad-lambda-expression definition)))))
2601
2602(defun ad-body-forms (definition) 2589(defun ad-body-forms (definition)
2603 "Return the list of body forms of DEFINITION." 2590 "Return the list of body forms of DEFINITION."
2604 (cond ((ad-compiled-p definition) 2591 (cond ((ad-compiled-p definition)
2605 nil) 2592 nil)
2606 ((consp definition) 2593 ((consp definition)
2607 (nthcdr (+ (if (ad-docstring definition) 1 0) 2594 (nthcdr (+ (if (ad-docstring definition) 1 0)
2608 (if (ad-interactive-form definition) 1 0)) 2595 (if (interactive-form definition) 1 0))
2609 (cdr (cdr (ad-lambda-expression definition))))))) 2596 (cdr (cdr (ad-lambda-expression definition)))))))
2610 2597
2611;; Matches the docstring of an advised definition. 2598;; Matches the docstring of an advised definition.
@@ -3037,7 +3024,7 @@ in any of these classes."
3037 (ad-get-enabled-advices function 'around) 3024 (ad-get-enabled-advices function 'around)
3038 (ad-get-enabled-advices function 'after))) 3025 (ad-get-enabled-advices function 'after)))
3039 (let ((interactive-form 3026 (let ((interactive-form
3040 (ad-interactive-form (ad-advice-definition advice)))) 3027 (interactive-form (ad-advice-definition advice))))
3041 (if interactive-form 3028 (if interactive-form
3042 ;; We found the first one, use it: 3029 ;; We found the first one, use it:
3043 (ad-do-return interactive-form))))) 3030 (ad-do-return interactive-form)))))
@@ -3051,7 +3038,7 @@ in any of these classes."
3051 (ad-has-redefining-advice function)) 3038 (ad-has-redefining-advice function))
3052 (let* ((origdef (ad-real-orig-definition function)) 3039 (let* ((origdef (ad-real-orig-definition function))
3053 (origname (ad-get-advice-info-field function 'origname)) 3040 (origname (ad-get-advice-info-field function 'origname))
3054 (orig-interactive-p (ad-interactive-p origdef)) 3041 (orig-interactive-p (commandp origdef))
3055 (orig-subr-p (ad-subr-p origdef)) 3042 (orig-subr-p (ad-subr-p origdef))
3056 (orig-special-form-p (ad-special-form-p origdef)) 3043 (orig-special-form-p (ad-special-form-p origdef))
3057 (orig-macro-p (ad-macro-p origdef)) 3044 (orig-macro-p (ad-macro-p origdef))
@@ -3063,15 +3050,11 @@ in any of these classes."
3063 (interactive-form 3050 (interactive-form
3064 (cond (orig-macro-p nil) 3051 (cond (orig-macro-p nil)
3065 (advised-interactive-form) 3052 (advised-interactive-form)
3066 ((ad-interactive-form origdef) 3053 ((interactive-form origdef)
3067 (if (and (symbolp function) (get function 'elp-info)) 3054 (interactive-form
3068 (interactive-form (aref (get function 'elp-info) 2)) 3055 (if (and (symbolp function) (get function 'elp-info))
3069 (ad-interactive-form origdef))) 3056 (aref (get function 'elp-info) 2)
3070 ;; Otherwise we must have a subr: make it interactive if 3057 origdef)))))
3071 ;; we have to and initialize required arguments in case
3072 ;; it is called interactively:
3073 (orig-interactive-p
3074 (interactive-form origdef))))
3075 (orig-form 3058 (orig-form
3076 (cond ((or orig-special-form-p orig-macro-p) 3059 (cond ((or orig-special-form-p orig-macro-p)
3077 ;; Special forms and macros will be advised into macros. 3060 ;; Special forms and macros will be advised into macros.
@@ -3294,8 +3277,8 @@ advised definition from scratch."
3294 t 3277 t
3295 (ad-arglist original-definition function)) 3278 (ad-arglist original-definition function))
3296 (if (eq (ad-definition-type original-definition) 'function) 3279 (if (eq (ad-definition-type original-definition) 'function)
3297 (equal (ad-interactive-form original-definition) 3280 (equal (interactive-form original-definition)
3298 (ad-interactive-form cached-definition)))))) 3281 (interactive-form cached-definition))))))
3299 3282
3300(defun ad-get-cache-class-id (function class) 3283(defun ad-get-cache-class-id (function class)
3301 "Return the part of FUNCTION's cache id that identifies CLASS." 3284 "Return the part of FUNCTION's cache id that identifies CLASS."
@@ -3342,8 +3325,8 @@ advised definition from scratch."
3342 (ad-arglist cached-definition)) 3325 (ad-arglist cached-definition))
3343 (setq code 'interactive-form-mismatch) 3326 (setq code 'interactive-form-mismatch)
3344 (or (null (nth 5 cache-id)) 3327 (or (null (nth 5 cache-id))
3345 (equal (ad-interactive-form original-definition) 3328 (equal (interactive-form original-definition)
3346 (ad-interactive-form cached-definition))) 3329 (interactive-form cached-definition)))
3347 (setq code 'verified)))) 3330 (setq code 'verified))))
3348 code)) 3331 code))
3349 3332