summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2005-03-07 14:12:27 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2005-03-07 14:12:27 +0000
commita29cf450570804d3e1023f5d13bb725156b4a9ac (patch)
tree6dc21e8dfa749ebc17b39fae287972b5991e1f9c /lisp/emacs-lisp
parent83daa9dcec972866080d8bc19ebbad6f28d72743 (diff)
downloademacs-a29cf450570804d3e1023f5d13bb725156b4a9ac.tar.gz
emacs-a29cf450570804d3e1023f5d13bb725156b4a9ac.tar.bz2
emacs-a29cf450570804d3e1023f5d13bb725156b4a9ac.zip
(debug-on-entry-1): Fix handling of macros.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/debug.el37
1 files changed, 18 insertions, 19 deletions
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index ab197e8e119..67836215da3 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -693,25 +693,24 @@ If argument is nil or an empty string, cancel for all functions."
(fset function (cons 'lambda (cons (car contents) body)))))))
(defun debug-on-entry-1 (function defn flag)
- (if (subrp defn)
- (error "%s is a built-in function" function)
- (if (eq (car defn) 'macro)
- (debug-on-entry-1 function (cdr defn) flag)
- (or (eq (car defn) 'lambda)
- (error "%s not user-defined Lisp function" function))
- (let ((tail (cdr defn)))
- ;; Skip the docstring.
- (when (and (stringp (cadr tail)) (cddr tail))
- (setq tail (cdr tail)))
- ;; Skip the interactive form.
- (when (eq 'interactive (car-safe (cadr tail)))
- (setq tail (cdr tail)))
- (unless (eq flag (equal (cadr tail) debug-entry-code))
- ;; Add/remove debug statement as needed.
- (if flag
- (setcdr tail (cons debug-entry-code (cdr tail)))
- (setcdr tail (cddr tail))))
- defn))))
+ (let ((tail defn))
+ (if (subrp tail)
+ (error "%s is a built-in function" function)
+ (if (eq (car tail) 'macro) (setq tail (cdr tail)))
+ (if (eq (car tail) 'lambda) (setq tail (cdr tail))
+ (error "%s not user-defined Lisp function" function))
+ ;; Skip the docstring.
+ (when (and (stringp (cadr tail)) (cddr tail))
+ (setq tail (cdr tail)))
+ ;; Skip the interactive form.
+ (when (eq 'interactive (car-safe (cadr tail)))
+ (setq tail (cdr tail)))
+ (unless (eq flag (equal (cadr tail) debug-entry-code))
+ ;; Add/remove debug statement as needed.
+ (if flag
+ (setcdr tail (cons debug-entry-code (cdr tail)))
+ (setcdr tail (cddr tail))))
+ defn)))
(defun debugger-list-functions ()
"Display a list of all the functions now set to debug on entry."