From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Branham Newsgroups: gmane.emacs.bugs Subject: bug#30315: [PATCH] keyboard-escape-quit should give option not to delete windows Date: Wed, 31 Jan 2018 20:59:48 -0600 Message-ID: <87zi4th0t7.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1517453956 32111 195.159.176.226 (1 Feb 2018 02:59:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 1 Feb 2018 02:59:16 +0000 (UTC) User-Agent: mu4e 0.9.18; emacs 26.0.91 To: 30315@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 01 03:59:11 2018 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 1eh55h-0007p4-5L for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Feb 2018 03:59:09 +0100 Original-Received: from localhost ([::1]:52080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eh57h-0001eu-Bv for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Jan 2018 22:01:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eh57a-0001da-9y for bug-gnu-emacs@gnu.org; Wed, 31 Jan 2018 22:01:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eh57W-0002h5-9h for bug-gnu-emacs@gnu.org; Wed, 31 Jan 2018 22:01:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43799) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eh57W-0002gt-4N for bug-gnu-emacs@gnu.org; Wed, 31 Jan 2018 22:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eh57V-000369-Qt for bug-gnu-emacs@gnu.org; Wed, 31 Jan 2018 22:01:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alex Branham Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Feb 2018 03:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 30315 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.151745400611781 (code B ref -1); Thu, 01 Feb 2018 03:01:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Feb 2018 03:00:06 +0000 Original-Received: from localhost ([127.0.0.1]:51696 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eh56b-00033x-RM for submit@debbugs.gnu.org; Wed, 31 Jan 2018 22:00:06 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39429) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eh56Z-00032w-CV for submit@debbugs.gnu.org; Wed, 31 Jan 2018 22:00:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eh56S-0001aa-3o for submit@debbugs.gnu.org; Wed, 31 Jan 2018 21:59:57 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:34731) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eh56R-0001aI-UW for submit@debbugs.gnu.org; Wed, 31 Jan 2018 21:59:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eh56Q-0001QY-1g for bug-gnu-emacs@gnu.org; Wed, 31 Jan 2018 21:59:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eh56L-0001UZ-UL for bug-gnu-emacs@gnu.org; Wed, 31 Jan 2018 21:59:54 -0500 Original-Received: from mail-ot0-x233.google.com ([2607:f8b0:4003:c0f::233]:42001) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eh56L-0001U1-Lu for bug-gnu-emacs@gnu.org; Wed, 31 Jan 2018 21:59:49 -0500 Original-Received: by mail-ot0-x233.google.com with SMTP id a7so12618170otk.9 for ; Wed, 31 Jan 2018 18:59:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=SYWpT4jYWP3dyfMcK0ipcvGlk5P/nXbD+iFNqm80nvU=; b=kXIHO7N5sakQFdSMaIP+tLSBSHnF1lONbEiJc1VGBnmlMwKOP3D6h9pGeV36iuJv2e ApkC0Gq3hHlkrSrP6o5DnkvEsTsF7spJG8aNVojFRGA4UupUTzl/ByauZXszSwOl3qGL ubMfNZnovN9OMtqKitsL3c0sEJxDiDFOHePQfxKYwnfKG94QOf/1n0frRJjQVVtEQI9P MMERkL+IuWiOpoqc/lG5XI4t4fJGWog/uA3gtszJQQWzMhInlYiZJaQf1zK2tW4uycOX VykBCtOyNZK981BmxqKNSZwsXkUI0o6QRIkBdznmaFeKsKW2wyT7hSHk5sd9JWHRUN25 tPlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=SYWpT4jYWP3dyfMcK0ipcvGlk5P/nXbD+iFNqm80nvU=; b=kmw/IVYjXkahoyAp8SpoULGr4I7dM1qSWXgPzFoU+BiIDxSQhSbaz7Y1HnaURqYWQ2 OUva9NzdhNAdGVMeJfd7Z/AhA88trQSZ0b8khNbq7MHWCEWWNptIxTYqeaNa2cIQoBXF OGsDcPmm0iZqjyQ8Lse+r9WDGQHCg+8Ohqc0O0/6jShSgSO396JP1rmMIpt/yVXEDFwl OQrXIGS4VzOcmwHjO8kZI0uY9vUY0r+X4HwGeksRuGguVUqhWE8x1ycUTkA+9HqXs45E yeMfYNtVQh9eFbib4G7aSJ2B0KA0aqLz/gc2jL6n/VYvhNpjYTytLkWB3Hs/v+q9KzyY Nzqw== X-Gm-Message-State: AKwxytcHlJBeb7LySZTlX+ugxUfai5jdSMc8d5kkSp7HIQAaJ2Oji+Xm 30m8ojmetbbOj6LTwUQTnZbo8kJJ X-Google-Smtp-Source: AH8x22640kCpi2n88+O/FoYsHjq+dni7yZP2AnwJUdZlUN/Bo0UZWukIvwfX9BNEU9Reapuo6gpq8Q== X-Received: by 10.157.5.231 with SMTP id 94mr24570231otd.150.1517453988319; Wed, 31 Jan 2018 18:59:48 -0800 (PST) Original-Received: from mars (cpe-70-114-192-208.austin.res.rr.com. [70.114.192.208]) by smtp.gmail.com with ESMTPSA id v13sm907016ota.16.2018.01.31.18.59.32 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Jan 2018 18:59:38 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:142758 Archived-At: --=-=-= Content-Type: text/plain 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 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-New-defcustom-keyboard-escape-quit-deletes-windows.patch >From 30351ba514094b2364298b7723ae7c33685bf53e Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Wed, 31 Jan 2018 20:44:55 -0600 Subject: [PATCH 1/1] 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 --=-=-=--