emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/benchmarks b2f0a4e 4/6: Bug#31671 band-aid


From: Gemini Lasswell
Subject: [Emacs-diffs] scratch/benchmarks b2f0a4e 4/6: Bug#31671 band-aid
Date: Sun, 25 Nov 2018 20:11:15 -0500 (EST)

branch: scratch/benchmarks
commit b2f0a4e86c6d13977ec2d57e4c282c7c849905cb
Author: Gemini Lasswell <address@hidden>
Commit: Gemini Lasswell <address@hidden>

    Bug#31671 band-aid
---
 lisp/emacs-lisp/debug.el | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 7fc2b41..4a0442e 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -169,14 +169,28 @@ first will be printed into the backtrace buffer."
    (inhibit-redisplay
     ;; Don't really try to enter debugger within an eval from redisplay.
     debugger-value)
-   ((and (eq t (framep (selected-frame)))
-         (equal "initial_terminal" (terminal-name)))
+   ((or (and (eq t (framep (selected-frame)))
+             (equal "initial_terminal" (terminal-name)))
+        (and (bound-and-true-p main-thread)
+             (not (eq main-thread (current-thread)))))
+    ;; Either:
     ;; We're in the initial-frame (where `message' just outputs to stdout) so
     ;; there's no tty or GUI frame to display the backtrace and interact with
-    ;; it: just dump a backtrace to stdout.
+    ;; it.
+    ;;
     ;; This happens for example while handling an error in code from
     ;; early-init.el with --debug-init.
+    ;;
+    ;; Or:
+    ;; We're in a non-main thread, in which keyboard interaction is currently
+    ;; not implemented.
+    ;;
+    ;; So:
+    ;; Just dump a backtrace to stdout/Messages.
     (message "Error: %S" args)
+    (when (and (bound-and-true-p main-thread)
+               (not (eq main-thread (current-thread))))
+      (message "Thread: %s" (current-thread)))
     (let ((print-escape-newlines t)
           (print-escape-control-characters t)
           (print-level 8)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]