1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00

Don't permit C-x 8 RET &c in isearch.el to contaminate search string

* lisp/isearch.el (isearch-char-by-name, isearch-emoji-by-name):
Concatenate new character to the query string saved by
with-isearch-suspended, not the current string, which might have
been modified by recursive I-search sessions within
completing-read.
This commit is contained in:
Po Lu 2024-05-05 09:49:09 +08:00
parent 129312aa12
commit e0993f5169

View File

@ -2800,8 +2800,8 @@ With argument, add COUNT copies of the character."
(let ((string (if (and (integerp count) (> count 1))
(make-string count char)
(char-to-string char))))
(setq isearch-new-string (concat isearch-string string)
isearch-new-message (concat isearch-message
(setq isearch-new-string (concat isearch-new-string string)
isearch-new-message (concat isearch-new-message
(mapconcat 'isearch-text-char-description
string ""))))))))
@ -2822,8 +2822,8 @@ The command accepts Unicode names like \"smiling face\" or
(when (and (integerp count) (> count 1))
(setq emoji (apply 'concat (make-list count emoji))))
(when emoji
(setq isearch-new-string (concat isearch-string emoji)
isearch-new-message (concat isearch-message
(setq isearch-new-string (concat isearch-new-string emoji)
isearch-new-message (concat isearch-new-message
(mapconcat 'isearch-text-char-description
emoji "")))))))