From e0993f5169ebf761d520b2e23630a3de7d13ccb3 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 5 May 2024 09:49:09 +0800 Subject: [PATCH] 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. --- lisp/isearch.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index a139a6fb84e..e8fb33ef6ea 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -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 "")))))))