(defvar debugger-outer-standard-output)
(defvar debugger-outer-inhibit-redisplay)
(defvar debugger-outer-cursor-in-echo-area)
+(defvar debugger-will-be-back nil
+ "Non-nil if we expect to get back in the debugger soon.")
(defvar inhibit-debug-on-entry nil
"Non-nil means that debug-on-entry is disabled.")
(get-buffer-create "*Backtrace*")))
(debugger-old-buffer (current-buffer))
(debugger-step-after-exit nil)
+ (debugger-will-be-back nil)
;; Don't keep reading from an executing kbd macro!
(executing-kbd-macro nil)
;; Save the outer values of these vars for the `e' command
(fundamental-mode)
(with-selected-window (get-buffer-window debugger-buffer 0)
(when (and (window-dedicated-p (selected-window))
- (not debugger-step-after-exit))
+ (not debugger-will-be-back))
;; If the window is not dedicated, burying the buffer
;; will mean that the frame created for it is left
;; around showing some random buffer, and next time we
;; pop to the debugger buffer we'll create yet
;; another frame.
- ;; If debugger-step-after-exit is non-nil, the frame
+ ;; If debugger-will-be-back is non-nil, the frame
;; would need to be de-iconified anyway immediately
;; after when we re-enter the debugger, so iconifying it
;; here would cause flashing.
(save-excursion
(set-buffer (or buffer (current-buffer)))
(setq buffer (current-buffer))
- (let ((buffer-read-only nil)
+ (let ((inhibit-read-only t)
(old-end (point-min)) (new-end (point-min)))
;; If we saved an old backtrace, find the common part
;; between the new and the old.
(interactive)
(setq debugger-step-after-exit t)
(setq debugger-jumping-flag t)
+ (setq debugger-will-be-back t)
(add-hook 'post-command-hook 'debugger-reenable)
(message "Proceeding, will debug on next eval or call.")
(exit-recursive-edit))
(unless debugger-may-continue
(error "Cannot continue"))
(message "Continuing.")
+ (save-excursion
+ ;; Check to see if we've flagged some frame for debug-on-exit, in which
+ ;; case we'll probably come back to the debugger soon.
+ (goto-char (point-min))
+ (if (re-search-forward "^\\* " nil t)
+ (setq debugger-will-be-back t)))
(exit-recursive-edit))
(defun debugger-return-value (val)
(setq debugger-value val)
(princ "Returning " t)
(prin1 debugger-value)
+ (save-excursion
+ ;; Check to see if we've flagged some frame for debug-on-exit, in which
+ ;; case we'll probably come back to the debugger soon.
+ (goto-char (point-min))
+ (if (re-search-forward "^\\* " nil t)
+ (setq debugger-will-be-back t)))
(exit-recursive-edit))
(defun debugger-jump ()
(setq debugger-jumping-flag t)
(add-hook 'post-command-hook 'debugger-reenable)
(message "Continuing through this frame")
+ (setq debugger-will-be-back t)
(exit-recursive-edit))
(defun debugger-reenable ()
(beginning-of-line)
(backtrace-debug (debugger-frame-number) t)
(if (= (following-char) ? )
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(delete-char 1)
(insert ?*)))
(beginning-of-line))
(beginning-of-line)
(backtrace-debug (debugger-frame-number) nil)
(if (= (following-char) ?*)
- (let ((buffer-read-only nil))
+ (let ((inhibit-read-only t))
(delete-char 1)
(insert ? )))
(beginning-of-line))