From: Sean Whitton Date: Tue, 2 Feb 2021 08:44:44 +0000 (+0100) Subject: Bind 'revert-buffer' to 'C-x g' globally X-Git-Tag: emacs-28.0.90~3975 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7d15fa008af774789a91d7242055dc87497df66f;p=emacs.git Bind 'revert-buffer' to 'C-x g' globally * lisp/bindings.el: Bind 'revert-buffer' to 'C-x g' globally. * doc/emacs/files.texi: Replace 'M-x revert-buffer' with 'C-x g'. * etc/NEWS: Document the change (bug#46151). --- diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index ede382c146c..12ceac800ef 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -927,9 +927,9 @@ 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{M-x -revert-buffer}. Since reverting unintentionally could lose a lot of -work, Emacs asks for confirmation first. +the saved version of the file. To do this, type @kbd{C-x g}. Since +reverting unintentionally could lose a lot of work, Emacs asks for +confirmation first. The @code{revert-buffer} command tries to position point in such a way that, if the file was edited only slightly, you will be at diff --git a/etc/NEWS b/etc/NEWS index fc3a3dafb8d..a376df62e33 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -233,6 +233,9 @@ search string is at least this long. 'lazy-highlight-initial-delay' 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. + * Editing Changes in Emacs 28.1 diff --git a/lisp/bindings.el b/lisp/bindings.el index 43b62f9bbfc..9ea188d1a00 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -1413,6 +1413,8 @@ if `inhibit-field-text-motion' is non-nil." (define-key ctl-x-map "z" 'repeat) +(define-key ctl-x-map "g" #'revert-buffer) + (define-key esc-map "\C-l" 'reposition-window) (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window)