]> git.eshelyaron.com Git - emacs.git/commitdiff
(debug): Set debug-on-exit before calling debugger-setup-buffer so
authorLute Kamstra <lute@gnu.org>
Sun, 13 Mar 2005 20:54:14 +0000 (20:54 +0000)
committerLute Kamstra <lute@gnu.org>
Sun, 13 Mar 2005 20:54:14 +0000 (20:54 +0000)
that backtrace marks the frames set to debug-on-exit and we don't have
to do it manually.  Set an extra debug-on-exit for macro's.
(debugger-setup-buffer): Don't mark the top frame manually.

lisp/ChangeLog
lisp/emacs-lisp/debug.el

index 8d82e2476bf9619171947d34e4b034244c1f02fa..3dd1ae0dd0eeeec69cd40dc9065491e775af82c2 100644 (file)
@@ -1,3 +1,11 @@
+2005-03-13  Lute Kamstra  <lute@gnu.org>
+
+       * emacs-lisp/debug.el (debug): Set debug-on-exit before calling
+       debugger-setup-buffer so that backtrace marks the frames set to
+       debug-on-exit and we don't have to do it manually.  Set an extra
+       debug-on-exit for macro's.
+       (debugger-setup-buffer): Don't mark the top frame manually.
+       
 2005-03-12  Lute Kamstra  <lute@gnu.org>
 
        * emacs-lisp/byte-run.el: Replace lisp-indent-hook with
index 668157fc52ac29c4d7d61dd77663e0be076046ad..2be217a41c6711c7a564f0095ffb5fadc7efdf4a 100644 (file)
@@ -170,7 +170,14 @@ first will be printed into the backtrace buffer."
            (save-excursion
              (save-window-excursion
                (with-no-warnings
-                (setq unread-command-char -1))
+                 (setq unread-command-char -1))
+               (when (eq (car debugger-args) 'debug)
+                 ;; Skip the frames for backtrace-debug, byte-code,
+                 ;; and implement-debug-on-entry.
+                 (backtrace-debug 4 t)
+                 ;; Place an extra debug-on-exit for macro's.
+                 (when (eq 'lambda (car-safe (cadr (backtrace-frame 4))))
+                   (backtrace-debug 5 t)))
                (pop-to-buffer debugger-buffer)
                (debugger-mode)
                (debugger-setup-buffer debugger-args)
@@ -190,10 +197,6 @@ first will be printed into the backtrace buffer."
                  (goto-char (point-min))
                  (message "%s" (buffer-string))
                  (kill-emacs))
-               (if (eq (car debugger-args) 'debug)
-                   ;; Skip the frames for backtrace-debug, byte-code,
-                   ;; and implement-debug-on-entry.
-                   (backtrace-debug 4 t))
                (message "")
                (let ((standard-output nil)
                      (buffer-read-only t))
@@ -225,7 +228,7 @@ first will be printed into the backtrace buffer."
       (setq last-command debugger-outer-last-command)
       (setq this-command debugger-outer-this-command)
       (with-no-warnings
-       (setq unread-command-char debugger-outer-unread-command-char))
+       (setq unread-command-char debugger-outer-unread-command-char))
       (setq unread-command-events debugger-outer-unread-command-events)
       (setq unread-post-input-method-events
            debugger-outer-unread-post-input-method-events)
@@ -263,12 +266,7 @@ That buffer should be current already."
   ;; lambda is for debug-on-call when a function call is next.
   ;; debug is for debug-on-entry function called.
   (cond ((memq (car debugger-args) '(lambda debug))
-        (insert "--entering a function:\n")
-        (if (eq (car debugger-args) 'debug)
-            (progn
-              (delete-char 1)
-              (insert ?*)
-              (beginning-of-line))))
+        (insert "--entering a function:\n"))
        ;; Exiting a function.
        ((eq (car debugger-args) 'exit)
         (insert "--returning value: ")
@@ -508,12 +506,12 @@ Applies to the frame whose line point is on in the backtrace."
            (unwind-protect
                (progn
                  (with-no-warnings
-                  (setq unread-command-char debugger-outer-unread-command-char))
+                   (setq unread-command-char debugger-outer-unread-command-char))
                  (prog1 (progn ,@body)
                    (with-no-warnings
-                    (setq debugger-outer-unread-command-char unread-command-char))))
+                     (setq debugger-outer-unread-command-char unread-command-char))))
              (with-no-warnings
-              (setq unread-command-char save-ucc))))
+               (setq unread-command-char save-ucc))))
         (setq debugger-outer-match-data (match-data))
         (setq debugger-outer-load-read-function load-read-function)
         (setq debugger-outer-overriding-terminal-local-map