diff lisp/emacs-lisp/debug.el @ 60490:2e5cfcc774b9

(debug-on-entry-1): Fix handling of macros.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 07 Mar 2005 14:12:27 +0000
parents e68c831d220c
children 2433720b755c
line wrap: on
line diff
--- a/lisp/emacs-lisp/debug.el	Mon Mar 07 13:43:34 2005 +0000
+++ b/lisp/emacs-lisp/debug.el	Mon Mar 07 14:12:27 2005 +0000
@@ -693,25 +693,24 @@
 	  (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."