all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: Tino Calancha <tino.calancha@gmail.com>
Cc: 26650@debbugs.gnu.org
Subject: bug#26650: 26.0.50; Protect *Backtrace* from accidental killing
Date: Tue, 25 Apr 2017 08:50:00 -0400	[thread overview]
Message-ID: <87shkwodmv.fsf@users.sourceforge.net> (raw)
In-Reply-To: <alpine.DEB.2.20.1704252114230.6912@calancha-pc> (Tino Calancha's message of "Tue, 25 Apr 2017 21:18:09 +0900 (JST)")

[-- Attachment #1: Type: text/plain, Size: 689 bytes --]

tags 26650 patch
quit

Tino Calancha <tino.calancha@gmail.com> writes:

>>
>> That's because you're still in the recursive edit, it's like evaluating
>> '(error "hi")' before hitting 'q' in the *Backtrace* buffer.  You can
>> use C-M-c (exit-recursive-edit) to get back to normal.  I think it would
>> make sense to do that automatically if you kill the *Backtrace* buffer.
> Yes, it would be useful.  I don't know how, though.
> Sometimes i kill *Bactrace* from *Ibuffer*/*Buffer List* with the
> recursive edit still ongoing.  It's a classical mistake.

Actually, the obvious way of adding `top-level' (that's what 'q' does)
to `kill-buffer-hook' does protect *Backtrace* from killing.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 888 bytes --]

From 9e2f66a300cc0c94fb1369cbf3721d41d98c2d94 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Tue, 25 Apr 2017 08:39:17 -0400
Subject: [PATCH v1] Protect *Backtrace* from being killed (Bug#26650)

* lisp/emacs-lisp/debug.el (debugger-mode): Call `top-level' in
`kill-buffer-hook'.
---
 lisp/emacs-lisp/debug.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 94b683dcb9..0aef94f1d2 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -753,6 +753,8 @@ debugger-mode
 \\{debugger-mode-map}"
   (setq truncate-lines t)
   (set-syntax-table emacs-lisp-mode-syntax-table)
+  (add-hook 'kill-buffer-hook
+            (lambda () (if (> (recursion-depth) 0) (top-level))) nil t)
   (use-local-map debugger-mode-map))
 \f
 (defcustom debugger-record-buffer "*Debugger-record*"
-- 
2.11.1


  reply	other threads:[~2017-04-25 12:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25 12:02 bug#26650: 26.0.50; Protect *Backtrace* from accidental killing Tino Calancha
2017-04-25 12:13 ` npostavs
2017-04-25 12:18   ` Tino Calancha
2017-04-25 12:50     ` npostavs [this message]
2017-04-25 13:02       ` Tino Calancha
2017-04-26 10:07       ` Eli Zaretskii
2017-04-26 10:36         ` Tino Calancha
2017-04-26 11:03           ` Eli Zaretskii
2017-04-26 12:52             ` npostavs
2017-04-26 13:57               ` Tino Calancha
2017-04-26 15:33               ` Eli Zaretskii
2017-05-24  0:18                 ` npostavs
2017-04-26 10:49         ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87shkwodmv.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=26650@debbugs.gnu.org \
    --cc=tino.calancha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.