* 28.0.50; Move revert-buffer global binding into a prefix map
[not found] ` <87a6sjpyqs.fsf@gnus.org>
@ 2021-02-04 18:08 ` Sean Whitton
2021-02-04 19:49 ` bug#46300: [External] : " Drew Adams
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Sean Whitton @ 2021-02-04 18:08 UTC (permalink / raw)
To: bug-gnu-emacs
Cc: Eli Zaretskii, Gregory Heytings, Lars Ingebrigtsen, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1191 bytes --]
control: tag -1 + patch
On Thu 04 Feb 2021 at 05:46PM +01, Lars Ingebrigtsen wrote:
> Gregory Heytings <gregory@heytings.org> writes:
>
>> You forgot the proposal to which the mail you are replying to
>> explicitly refers. So I'll copy it here again: it is to make "C-x g"
>> a keymap for buffer-related operations, with in particular "C-x g r"
>> bound to revert-buffer:
>>
>> C-x g c = clone-buffer
>> C-x g d = diff-buffers
>> C-x g f = fit-frame-to-buffer
>> C-x g h = hexl-mode
>> C-x g i = insert-buffer
>> C-x g l = font-lock-mode
>> C-x g n = rename-buffer
>> C-x g r = revert-buffer
>> C-x g R = revert-buffer-with-fine-grain
>> C-x g t = toggle-truncate-lines
>
> Of the alternative key bindings proposed, I like this the best. I'd
> prefer `C-x g g' for revert-buffer, though -- it's more in like with the
> `g' binding in `special-mode-map', and `revert-buffer' is a command
> you're likely to want to execute a number of times (in some cases),
> while the rest of these are less keyboard-mashey.
Here's a patch doing that, since this seems like a solution which
satisfies most. Exactly what else to bind into that map I leave to
others, for now, anyway.
--
Sean Whitton
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Move-revert-buffer-global-binding-to-C-x-g-g.patch --]
[-- Type: text/x-diff, Size: 2094 bytes --]
From ae48c8984724013a2b145fbac32c094dd54c8f0f Mon Sep 17 00:00:00 2001
From: Sean Whitton <spwhitton@spwhitton.name>
Date: Thu, 4 Feb 2021 11:05:06 -0700
Subject: [PATCH] Move 'revert-buffer' global binding to 'C-x g g'
* lisp/bindings.el: Define ctl-x-g-map and bind 'revert-buffer' to
'C-x g g' globally.
* doc/emacs/files.texi: Replace 'C-x g' with 'C-x g g'.
* etc/NEWS: Document the change.
---
doc/emacs/files.texi | 2 +-
etc/NEWS | 2 +-
lisp/bindings.el | 7 ++++++-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index 12ceac800e..dbdb9d582a 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -927,7 +927,7 @@ Manual}). For customizations, see the Custom group @code{time-stamp}.
If you have made extensive changes to a file-visiting buffer and
then change your mind, you can @dfn{revert} the changes and go back to
-the saved version of the file. To do this, type @kbd{C-x g}. Since
+the saved version of the file. To do this, type @kbd{C-x g g}. Since
reverting unintentionally could lose a lot of work, Emacs asks for
confirmation first.
diff --git a/etc/NEWS b/etc/NEWS
index dddc150af1..cf428621d2 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -234,7 +234,7 @@ still applies for shorter search strings, which avoids flicker in the
search buffer due to too many matches being highlighted.
+++
-** 'revert-buffer' is now bound to 'C-x g' globally.
+** 'revert-buffer' is now bound to 'C-x g g' globally.
\f
* Editing Changes in Emacs 28.1
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 9ea188d1a0..3ddaf0cec1 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -1413,7 +1413,12 @@ if `inhibit-field-text-motion' is non-nil."
(define-key ctl-x-map "z" 'repeat)
-(define-key ctl-x-map "g" #'revert-buffer)
+(defvar ctl-x-g-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "g" #'revert-buffer)
+ map)
+ "Keymap for subcommands of C-x g.")
+(define-key ctl-x-map "g" ctl-x-g-map)
(define-key esc-map "\C-l" 'reposition-window)
--
2.29.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#46300: [External] : 28.0.50; Move revert-buffer global binding into a prefix map
2021-02-04 18:08 ` 28.0.50; Move revert-buffer global binding into a prefix map Sean Whitton
@ 2021-02-04 19:49 ` Drew Adams
2021-02-07 12:31 ` bug#46300: " Lars Ingebrigtsen
[not found] ` <87sg686oup.fsf@gnus.org>
2 siblings, 0 replies; 4+ messages in thread
From: Drew Adams @ 2021-02-04 19:49 UTC (permalink / raw)
To: spwhitton, 46300; +Cc: Lars Ingebrigtsen, Gregory Heytings, emacs-devel@gnu.org
> this seems like a solution which satisfies most.
Most what? Most users? Most users polled?
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#46300: 28.0.50; Move revert-buffer global binding into a prefix map
2021-02-04 18:08 ` 28.0.50; Move revert-buffer global binding into a prefix map Sean Whitton
2021-02-04 19:49 ` bug#46300: [External] : " Drew Adams
@ 2021-02-07 12:31 ` Lars Ingebrigtsen
[not found] ` <87sg686oup.fsf@gnus.org>
2 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-07 12:31 UTC (permalink / raw)
To: Sean Whitton; +Cc: 46300, Gregory Heytings, emacs-devel
Sean Whitton <spwhitton@spwhitton.name> writes:
> Here's a patch doing that, since this seems like a solution which
> satisfies most. Exactly what else to bind into that map I leave to
> others, for now, anyway.
Thanks; applied to Emacs 28 (but I changed the binding to `C-x x g' to
avoid the Magit collision).
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#46300: [External] : Re: bug#46300: 28.0.50; Move revert-buffer global binding into a prefix map
[not found] ` <87sg686oup.fsf@gnus.org>
@ 2021-02-07 18:41 ` Drew Adams
0 siblings, 0 replies; 4+ messages in thread
From: Drew Adams @ 2021-02-07 18:41 UTC (permalink / raw)
To: Lars Ingebrigtsen, Sean Whitton
Cc: 46300@debbugs.gnu.org, Gregory Heytings, emacs-devel@gnu.org
> Thanks; applied to Emacs 28 (but I changed the
> binding to `C-x x g' to avoid the Magit collision).
You traded a Bookmark+ collision for a Magit collision.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-02-07 18:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <87zh0mmr54.fsf@gmail.com>
[not found] ` <E1l7B5I-0008AF-5d@fencepost.gnu.org>
[not found] ` <87y2g5smya.fsf@gmail.com>
[not found] ` <4FF55FBF-573D-4A70-B3FC-682CA25B7ECB@gnu.org>
[not found] ` <SA2PR10MB4474F289D4FB3C4510DF6AE8F3B49@SA2PR10MB4474.namprd10.prod.outlook.com>
[not found] ` <83lfc53whk.fsf@gnu.org>
[not found] ` <20210203180142.seu6o3i6u7jhkyrh@Ergus>
[not found] ` <83eehx3to5.fsf@gnu.org>
[not found] ` <20210203221628.xgvvxjvh56gyswba@Ergus>
[not found] ` <CADwFkmkAb4o5mztty15pkMdp1dXVrVmq+KBD5JMgV=QYOgttjw@mail.gmail.com>
[not found] ` <20210204070033.pm4ido4hq7a6twif@Ergus>
[not found] ` <83sg6brhyg.fsf@gnu.org>
[not found] ` <de53393edf37fb957e3d@heytings.org>
[not found] ` <87a6sjpyqs.fsf@gnus.org>
2021-02-04 18:08 ` 28.0.50; Move revert-buffer global binding into a prefix map Sean Whitton
2021-02-04 19:49 ` bug#46300: [External] : " Drew Adams
2021-02-07 12:31 ` bug#46300: " Lars Ingebrigtsen
[not found] ` <87sg686oup.fsf@gnus.org>
2021-02-07 18:41 ` bug#46300: [External] : " Drew Adams
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).