From f686f18e7884b003c530037b066b7181ad074386 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. (cherry picked from commit e0993f5169ebf761d520b2e23630a3de7d13ccb3) --- lisp/isearch.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 814ab919d5e..88921c3179c 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2802,8 +2802,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 "")))))))) @@ -2824,8 +2824,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 ""))))))) -- 2.39.5