aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2007-05-08 16:05:02 +0000
committerStefan Monnier2007-05-08 16:05:02 +0000
commit5d08a786062aac9a4e33a7ed9f40eeb3e9eda799 (patch)
tree2bbc949ce6288c01268fbd5af563be4576b900ba
parent44038dc83b6716737ad663fd3e823f35adf8f482 (diff)
downloademacs-5d08a786062aac9a4e33a7ed9f40eeb3e9eda799.tar.gz
emacs-5d08a786062aac9a4e33a7ed9f40eeb3e9eda799.zip
(ad-special-forms): Remove.
(ad-special-form-p): Use subr-arity.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/emacs-lisp/advice.el22
2 files changed, 8 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ce34c9edcf2..2d8fc893de9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12007-05-08 Stefan Monnier <monnier@iro.umontreal.ca> 12007-05-08 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * emacs-lisp/advice.el (ad-special-forms): Remove.
4 (ad-special-form-p): Use subr-arity.
5
3 * newcomment.el (comment-search-forward): Make sure we search forward. 6 * newcomment.el (comment-search-forward): Make sure we search forward.
4 (comment-enter-backward): Try and distinguish the non-matching case at 7 (comment-enter-backward): Try and distinguish the non-matching case at
5 EOB from the non-matching case with a missing comment-end-skip for 8 EOB from the non-matching case with a missing comment-end-skip for
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index fe4639cf01a..8023bc58a53 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -2467,23 +2467,11 @@ will clear the cache."
2467 "Take a macro function DEFINITION and make a lambda out of it." 2467 "Take a macro function DEFINITION and make a lambda out of it."
2468 `(cdr ,definition)) 2468 `(cdr ,definition))
2469 2469
2470;; There is no way to determine whether some subr is a special form or not, 2470(defun ad-special-form-p (definition)
2471;; hence we need this list (which is probably out of date): 2471 "Non-nil iff DEFINITION is a special form."
2472(defvar ad-special-forms 2472 (if (and (symbolp definition) (fboundp definition))
2473 (let ((tem '(and catch cond condition-case defconst defmacro 2473 (setq definition (indirect-function definition)))
2474 defun defvar function if interactive let let* 2474 (and (subrp definition) (eq (cdr (subr-arity definition)) 'unevalled)))
2475 or prog1 prog2 progn quote save-current-buffer
2476 save-excursion save-restriction save-window-excursion
2477 setq setq-default unwind-protect while
2478 with-output-to-temp-buffer)))
2479 ;; track-mouse could be void in some configurations.
2480 (if (fboundp 'track-mouse)
2481 (push 'track-mouse tem))
2482 (mapcar 'symbol-function tem)))
2483
2484(defmacro ad-special-form-p (definition)
2485 ;;"non-nil if DEFINITION is a special form."
2486 (list 'memq definition 'ad-special-forms))
2487 2475
2488(defmacro ad-interactive-p (definition) 2476(defmacro ad-interactive-p (definition)
2489 ;;"non-nil if DEFINITION can be called interactively." 2477 ;;"non-nil if DEFINITION can be called interactively."