Add bindings for 'undo-redo'

* etc/NEWS: Describe the change.

* lisp/bindings.el (global-map): Add bindings for 'undo-redo'.

* lisp/simple.el (undo-no-redo): Turn into a user option.
This commit is contained in:
Dmitry Gutov 2021-09-29 22:44:40 +03:00
parent fd244c9e46
commit 6fecf6ef25
3 changed files with 11 additions and 3 deletions

View file

@ -957,7 +957,11 @@ for CJK text mixed with Latin text.
+++
** New command 'undo-redo'.
It undoes previous undo commands, but doesn't record itself as an
undoable command.
undoable command. It is bound to 'C-?' and 'C-M-_', the first binding
works well in graphical mode, and the second one is easy to hit on tty.
For full conventional undo/redo behavior, you can also customize the
user option 'undo-no-redo' to t.
+++
** New commands 'copy-matching-lines' and 'kill-matching-lines'.

View file

@ -994,6 +994,9 @@ if `inhibit-field-text-motion' is non-nil."
"Keymap to repeat undo key sequences `C-x u u'. Used in `repeat-mode'.")
(put 'undo 'repeat-map 'undo-repeat-map)
(define-key global-map (kbd "C-?") 'undo-redo)
(define-key global-map [?\C-\M-_] 'undo-redo)
(define-key esc-map "!" 'shell-command)
(define-key esc-map "|" 'shell-command-on-region)
(define-key esc-map "&" 'async-shell-command)

View file

@ -2942,8 +2942,9 @@ undo record: if we undo from 4, `pending-undo-list' will be at 3,
(defvar undo-in-region nil
"Non-nil if `pending-undo-list' is not just a tail of `buffer-undo-list'.")
(defvar undo-no-redo nil
"If t, `undo' doesn't go through redo entries.")
(defcustom undo-no-redo nil
"If t, `undo' doesn't go through redo entries."
:type 'boolean)
(defvar pending-undo-list nil
"Within a run of consecutive undo commands, list remaining to be undone.