From 830e876d94a8cfc5a516e7fcd867525754508cf3 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Fri, 25 Sep 2020 13:25:08 +0200 Subject: [PATCH] Use the char history in zap-up-to-char * lisp/misc.el (zap-up-to-char): Use read-char-from-minibuffer (bug#39154). --- etc/NEWS | 7 +++++++ lisp/misc.el | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 9cd8aaa41c8..4cd40c3657c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1064,6 +1064,13 @@ window after starting). This variable defaults to nil. ** Miscellaneous +--- +*** 'zap-up-to-char' now uses 'read-char-from-minibuffer'. +This allows navigating through the history of characters that have +been input. This is mostly useful for characters that have complex +input methods where inputting the character again may involve many +keystrokes. + +++ *** Interactive regular expression search now uses faces for sub-groups. E.g., 'C-M-s foo-\([0-9]+\)' will now use the 'isearch-group-1' face diff --git a/lisp/misc.el b/lisp/misc.el index 8c39492784b..be191c50d2f 100644 --- a/lisp/misc.el +++ b/lisp/misc.el @@ -69,7 +69,9 @@ The characters copied are inserted in the buffer before point." Case is ignored if `case-fold-search' is non-nil in the current buffer. Goes backward if ARG is negative; error if CHAR not found. Ignores CHAR at point." - (interactive "p\ncZap up to char: ") + (interactive (list (prefix-numeric-value current-prefix-arg) + (read-char-from-minibuffer "Zap up to char: " + nil 'read-char-history))) (let ((direction (if (>= arg 0) 1 -1))) (kill-region (point) (progn -- 2.39.5