Don't permit C-x 8 RET &c in isearch.el to contaminate search string
authorPo Lu <luangruo@yahoo.com>
Sun, 5 May 2024 01:49:09 +0000 (09:49 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 5 May 2024 01:49:09 +0000 (09:49 +0800)
* 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

index a139a6fb84e1f5fafab612a841c4ff1abf093235..e8fb33ef6ea3d1eefc072ceb0c7d26c32b81d0ff 100644 (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 "")))))))