Skip to content

Commit

Permalink
Move 'revert-buffer' global binding to 'C-x g g'
Browse files Browse the repository at this point in the history
* lisp/bindings.el: Define ctl-x-g-map and bind 'revert-buffer' to
'C-x x g' globally.
* doc/emacs/files.texi: Replace 'C-x g' with 'C-x x g'.
* etc/NEWS: Document the change (bug#46300).
  • Loading branch information
spwhitton authored and larsmagne committed Feb 7, 2021
1 parent 7e48430 commit a6a5d6a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/emacs/files.texi
Expand Up @@ -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 x g}. Since
reverting unintentionally could lose a lot of work, Emacs asks for
confirmation first.

Expand Down
2 changes: 1 addition & 1 deletion etc/NEWS
Expand Up @@ -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 x g' globally.


* Editing Changes in Emacs 28.1
Expand Down
7 changes: 6 additions & 1 deletion lisp/bindings.el
Expand Up @@ -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-x-map
(let ((map (make-sparse-keymap)))
(define-key map "g" #'revert-buffer)
map)
"Keymap for subcommands of C-x x.")
(define-key ctl-x-map "x" ctl-x-x-map)

(define-key esc-map "\C-l" 'reposition-window)

Expand Down

0 comments on commit a6a5d6a

Please sign in to comment.