GNU bug report logs - #30315
[PATCH] keyboard-escape-quit should give option not to delete windows

Previous Next

Package: emacs;

Reported by: Alex Branham <alex.branham <at> gmail.com>

Date: Thu, 1 Feb 2018 03:01:01 UTC

Severity: wishlist

Tags: patch, wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 30315 in the body.
You can then email your comments to 30315 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#30315; Package emacs. (Thu, 01 Feb 2018 03:01:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex Branham <alex.branham <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 01 Feb 2018 03:01:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alex Branham <alex.branham <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] keyboard-escape-quit should give option not to delete windows
Date: Wed, 31 Jan 2018 20:59:48 -0600
[Message part 1 (text/plain, inline)]
I've always found it a bit odd that ESC-ESC-ESC deletes windows, since I
think of it as telling Emacs to "stop doing whatever it is you're
doing". I guess there's a case to be made that splitting the frame is
doing something, but it's behavior I'm not a huge fan of.

The attached patch introduces a new defcustom that allows the user to
stop ESC-ESC-ESC from deleting windows. I'm not sure if this should be
documented in the manual or not. If so, please let me know (and where?).

Thanks for all your work!
Alex

--------------------

From 30351ba514094b2364298b7723ae7c33685bf53e Mon Sep 17 00:00:00 2001
From: Alex Branham <branham <at> utexas.edu>
Date: Wed, 31 Jan 2018 20:44:55 -0600
Subject: [PATCH] New defcustom `keyboard-escape-quit-deletes-windows'

* lisp/simple.el (`keyboard-escape-quit-deletes-windows'): New
  defcustom to control whether keyboard-escape-quit calls
  delete-other-windows
(keyboard-escape-quit): Use it

* etc/NEWS: Mention `keyboard-escape-quit-deletes-windows'.
---
 etc/NEWS       |  5 +++++
 lisp/simple.el | 11 +++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index b28f284116..d6ba6f28b8 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -80,6 +80,11 @@ indirectly, e.g., by checking that functions like
 It blocks line breaking after a one-letter word, also in the case when
 this word is preceded by a non-space, but non-alphanumeric character.

+** New option 'keyboard-escape-quit-deletes-windows'.
+This determines whether 'keyboard-escape-quit' eventually calls
+'delete-other-windows'.  The default (t) preserves behavior from
+previous Emacs.
+
 +++
 ** The limit on repetitions in regexps has been raised to 2^16-1.
 It was previously limited to 2^15-1.  For example, the following
diff --git a/lisp/simple.el b/lisp/simple.el
index 375ee31e9c..695bb12ac1 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -7706,6 +7706,11 @@ At top-level, as an editor command, this simply beeps."
   (let ((debug-on-quit nil))
     (signal 'quit nil)))

+(defcustom keyboard-escape-quit-deletes-windows t
+  "If non-nil, `keyboard-escape-quit' eventually calls `delete-other-windows'."
+  :group 'windows
+  :type 'boolean)
+
 (defvar buffer-quit-function nil
   "Function to call to \"quit\" the current buffer, or nil if none.
 \\[keyboard-escape-quit] calls this function when its more local actions
@@ -7717,7 +7722,8 @@ This command can exit an interactive command such as `query-replace',
 can clear out a prefix argument or a region,
 can get out of the minibuffer or other recursive edit,
 cancel the use of the current buffer (for special-purpose buffers),
-or go back to just one window (by deleting all but the selected window)."
+or go back to just one window (by deleting all but the selected window, but
+see `keyboard-escape-quit-deletes-windows')."
   (interactive)
   (cond ((eq last-command 'mode-exited) nil)
 	((region-active-p)
@@ -7730,7 +7736,8 @@ or go back to just one window (by deleting all but the selected window)."
 	 (exit-recursive-edit))
 	(buffer-quit-function
 	 (funcall buffer-quit-function))
-	((not (one-window-p t))
+	((and (not (one-window-p t))
+              keyboard-escape-quit-deletes-windows)
 	 (delete-other-windows))
 	((string-match "^ \\*" (buffer-name (current-buffer)))
 	 (bury-buffer))))
--
2.16.1
[0001-New-defcustom-keyboard-escape-quit-deletes-windows.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30315; Package emacs. (Thu, 01 Feb 2018 20:32:02 GMT) Full text and rfc822 format available.

Message #8 received at 30315 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 30315 <at> debbugs.gnu.org
Subject: Re: bug#30315: [PATCH] keyboard-escape-quit should give option not to
 delete windows
Date: Thu, 01 Feb 2018 22:29:42 +0200
> I've always found it a bit odd that ESC-ESC-ESC deletes windows, since I
> think of it as telling Emacs to "stop doing whatever it is you're
> doing". I guess there's a case to be made that splitting the frame is
> doing something, but it's behavior I'm not a huge fan of.
>
> The attached patch introduces a new defcustom that allows the user to
> stop ESC-ESC-ESC from deleting windows. I'm not sure if this should be
> documented in the manual or not. If so, please let me know (and where?).

But what if other users don't like other things in ‘keyboard-escape-quit’
or their priorities.  Shouldn't all its actions be customizable?
For example, I'd prefer to have this rule somewhere in the middle:

  ((eq major-mode 'wdired-mode)
   (wdired-abort-changes))

Maybe better to change the implementation of ‘keyboard-escape-quit’
to use ‘add-function’ from nadvice.el, so it would be easier to add/delete
some actions from it?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30315; Package emacs. (Thu, 01 Feb 2018 21:10:02 GMT) Full text and rfc822 format available.

Message #11 received at 30315 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 30315 <at> debbugs.gnu.org
Subject: Re: bug#30315: [PATCH] keyboard-escape-quit should give option not to
 delete windows
Date: Thu, 01 Feb 2018 14:26:14 -0500
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > I've always found it a bit odd that ESC-ESC-ESC deletes windows, since I
  > think of it as telling Emacs to "stop doing whatever it is you're
  > doing".

Its intended meaning is "Get me back to the default state of things."
It's meant for people who don't know Emacs very well, to get out of
any kind of temporary state that they might have got themselves into
and don't know the command to get out of,

Splitting into multiple windows is one such temporary state.
So it is right that this gets back to the one-window state.

However, I have no objection to adding this option, if it's
useful enough to justify its added complexity.


-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
Skype: No way! See https://stallman.org/skype.html.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30315; Package emacs. (Fri, 02 Feb 2018 02:26:01 GMT) Full text and rfc822 format available.

Message #14 received at 30315 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 30315 <at> debbugs.gnu.org, alex.branham <at> gmail.com
Subject: Re: bug#30315: [PATCH] keyboard-escape-quit should give option not to
 delete windows
Date: Thu, 01 Feb 2018 21:15:25 -0500
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > But what if other users don't like other things in ‘keyboard-escape-quit’
  > or their priorities.  Shouldn't all its actions be customizable?

The function is 16 lines and straightforward.
You could write another function to replace it.

-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
Skype: No way! See https://stallman.org/skype.html.





Severity set to 'wishlist' from 'normal' Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Sat, 03 Feb 2018 21:58:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30315; Package emacs. (Mon, 24 Jun 2019 15:29:01 GMT) Full text and rfc822 format available.

Message #19 received at 30315 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Richard Stallman <rms <at> gnu.org>
Cc: 30315 <at> debbugs.gnu.org, Alex Branham <alex.branham <at> gmail.com>
Subject: Re: bug#30315: [PATCH] keyboard-escape-quit should give option not to
 delete windows
Date: Mon, 24 Jun 2019 17:28:03 +0200
Richard Stallman <rms <at> gnu.org> writes:

>   > I've always found it a bit odd that ESC-ESC-ESC deletes windows, since I
>   > think of it as telling Emacs to "stop doing whatever it is you're
>   > doing".
>
> Its intended meaning is "Get me back to the default state of things."
> It's meant for people who don't know Emacs very well, to get out of
> any kind of temporary state that they might have got themselves into
> and don't know the command to get out of,
>
> Splitting into multiple windows is one such temporary state.
> So it is right that this gets back to the one-window state.
>
> However, I have no objection to adding this option, if it's
> useful enough to justify its added complexity.

It didn't seem like anybody was really enthusiastic about adding this
complication to this functionality, so I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 24 Jun 2019 15:29:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 30315 <at> debbugs.gnu.org and Alex Branham <alex.branham <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 24 Jun 2019 15:29:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 23 Jul 2019 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 278 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.