From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#26650: 26.0.50; Protect *Backtrace* from accidental killing Date: Tue, 25 Apr 2017 08:50:00 -0400 Message-ID: <87shkwodmv.fsf@users.sourceforge.net> References: <871ssgvgof.fsf@calancha-pc> <87wpa8ofcc.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1493124580 19120 195.159.176.226 (25 Apr 2017 12:49:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 25 Apr 2017 12:49:40 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: 26650@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 25 14:49:35 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2zuQ-0004jv-DW for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Apr 2017 14:49:34 +0200 Original-Received: from localhost ([::1]:49195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2zuT-0004Zs-6I for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Apr 2017 08:49:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2ztx-0004Gj-8L for bug-gnu-emacs@gnu.org; Tue, 25 Apr 2017 08:49:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2ztu-0001hW-B1 for bug-gnu-emacs@gnu.org; Tue, 25 Apr 2017 08:49:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40758) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d2ztu-0001hC-6C for bug-gnu-emacs@gnu.org; Tue, 25 Apr 2017 08:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d2ztt-0003iB-Pu for bug-gnu-emacs@gnu.org; Tue, 25 Apr 2017 08:49:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Apr 2017 12:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26650 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26650-submit@debbugs.gnu.org id=B26650.149312451814239 (code B ref 26650); Tue, 25 Apr 2017 12:49:01 +0000 Original-Received: (at 26650) by debbugs.gnu.org; 25 Apr 2017 12:48:38 +0000 Original-Received: from localhost ([127.0.0.1]:38957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2ztW-0003hW-B3 for submit@debbugs.gnu.org; Tue, 25 Apr 2017 08:48:38 -0400 Original-Received: from mail-io0-f195.google.com ([209.85.223.195]:34735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2ztU-0003hC-4G; Tue, 25 Apr 2017 08:48:36 -0400 Original-Received: by mail-io0-f195.google.com with SMTP id h41so53617944ioi.1; Tue, 25 Apr 2017 05:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=jIBiGU5SzUZ1H3OB/3WILIqTmz6h1/2A1T5ZdPcqhM0=; b=vNHdkCCpeyKjAVKUpugtuJVZedymIQePMOg4d5H4zNOEe4ZDHUeZ4DSN7Qtxk2sxRy yUVRzQADJaboy7jkNYhOcqeOWlw38McTpWb3srccwL8pMQD41ahMAQe8yzmbO3hoGEHl cA5x76HF9RRYBPfphmJeZ7zXRd4/GhBmNnjEcTXnlC98Y/fYHE9yOsES6Hgf+jBiqdmY rJaVtiBKXHZJGEBa/3tmC1zi6wWOiGnIIOWEZkrcMUJ1527zK2ioHVScBpur9DFESF6e qIYWf9qPojPUkCLhTigxrrtz5C4LZmjm6c6t0KTuRoXvXYpLBn+nOvppfL58w3qezqS8 /uqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=jIBiGU5SzUZ1H3OB/3WILIqTmz6h1/2A1T5ZdPcqhM0=; b=IKjHpdYyVU1wIzfK44GJg12mCAsdT5sBeuntHv8b7rd2FjE8zHaBBPcLusxXlCLLh3 rWW7ErKDDjbyAbtQ+SUpqih/7ocJLkMAAmOdFa+qlZF8wOh8n72Bds3LMlKyC0LAGbd3 FrA9e02mcjDuEEoumgNIMvw0aR5/rNiJ5szg6gTAEH4rwPMvnuOy9L5IK3z0pzMvoeMm 6Sw0G1Zx841h4sJeHuM3f7j+FKraJflJlPyQPi97M2PPSK2BKGYm87+NY1ItWQsKXcHd XeJPaXkwIcEGMBW3qaCDLxlA+yS1Bu+KvPcKDVpt5v5V9J1GgChn7lHWpfjohqu7wDAi DMNQ== X-Gm-Message-State: AN3rC/7CwYMtxD/OR9DIz4VjnRr0ms7E3uJsFBs6k4I4yPIl3F5Q1hsJ 3x5ETp42cPh7rQ== X-Received: by 10.107.138.151 with SMTP id c23mr15705725ioj.235.1493124510498; Tue, 25 Apr 2017 05:48:30 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id w79sm1850995itb.11.2017.04.25.05.48.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Apr 2017 05:48:29 -0700 (PDT) In-Reply-To: (Tino Calancha's message of "Tue, 25 Apr 2017 21:18:09 +0900 (JST)") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131958 Archived-At: --=-=-= Content-Type: text/plain tags 26650 patch quit Tino Calancha 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v1-0001-Protect-Backtrace-from-being-killed-Bug-26650.patch Content-Description: patch >From 9e2f66a300cc0c94fb1369cbf3721d41d98c2d94 Mon Sep 17 00:00:00 2001 From: Noam Postavsky 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)) (defcustom debugger-record-buffer "*Debugger-record*" -- 2.11.1 --=-=-=--