]> git.eshelyaron.com Git - emacs.git/commitdiff
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)
committerEshel Yaron <me@eshelyaron.com>
Mon, 6 May 2024 16:40:02 +0000 (18:40 +0200)
* 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

index 814ab919d5eaec00b6a05dc2ec3b95575c121edc..88921c3179c6dbbe81ddd65ed5068a110fc2bb4c 100644 (file)
@@ -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 "")))))))