]> git.eshelyaron.com Git - emacs.git/commitdiff
Make isearch respond to 'mouse-yank-at-point'
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 27 Apr 2022 12:02:23 +0000 (14:02 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 27 Apr 2022 12:02:23 +0000 (14:02 +0200)
* doc/emacs/killing.texi (Secondary Selection): Document it.
* lisp/isearch.el (isearch-mouse-2): Make isearch respond to
mouse-yank-at-point (bug#7787).

* lisp/mouse.el (mouse-yank-at-point): Mention it.

doc/emacs/killing.texi
etc/NEWS
lisp/isearch.el
lisp/mouse.el

index e3de2bc2faf346fa9809c5d8d0f16d4abffc80b1..02a42a34fc5bef12909e4be61bbda7408091de71 100644 (file)
@@ -698,6 +698,9 @@ lines, much like @kbd{mouse-1}.
 If @code{mouse-yank-at-point} is non-@code{nil}, @kbd{M-mouse-2} yanks
 at point.  Then it does not matter precisely where you click, or even
 which of the frame's windows you click on.  @xref{Mouse Commands}.
+This user option also as an effect on interactive search: If this
+variable is non-@code{nil}, yanking with the mouse anywhere in the
+frame will add the text to the search string.
 
 @node Accumulating Text
 @section Accumulating Text
index a2818c8bf79b6edf6b61dcb09f1af3aca33f3b38..2ecad81b11fcc82ba8dc678b2ae0e04302fa2647 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -766,6 +766,14 @@ but doesn't exit the minibuffer.
 
 ** Isearch and Replace
 
++++
+*** Changes in how isearch responds to 'mouse-yank-at-point'.
+If a user does 'C-s' and then uses '<mouse-2>' ('mouse-yank-primary')
+outside the echo area, Emacs will, by default, end the isearch and
+yank the text where the mouse cursor is.  In Emacs 29, if
+'mouse-yank-at-point' is non-nil, the text will be added to the
+isearch instead.
+
 +++
 *** New user option 'char-fold-override'.
 Non-nil means that the default definitions of equivalent characters
index be0227b6e75e718724079b3497114493a88c0e10..750324a9fe608059ee79d1a8bcbbc38f2449d4e3 100644 (file)
@@ -2631,9 +2631,10 @@ is bound to outside of Isearch."
                        ;; Key search depends on mode (bug#47755)
                        (isearch-mode nil))
                    (key-binding (this-command-keys-vector) t))))
-    (if (and (window-minibuffer-p w)
-            (not (minibuffer-window-active-p w))) ; in echo area
-       (isearch-yank-x-selection)
+    (if (or mouse-yank-at-point
+            (and (window-minibuffer-p w)
+                (not (minibuffer-window-active-p w)))) ; in echo area
+        (isearch-yank-x-selection)
       (when (functionp binding)
        (call-interactively binding)))))
 
index b66cfad487811a54017e16185dda508341126847..c08ecaf33479b1c86336101e1c488d1d1b754671 100644 (file)
@@ -42,7 +42,9 @@
   :group 'editing)
 
 (defcustom mouse-yank-at-point nil
-  "If non-nil, mouse yank commands yank at point instead of at click."
+  "If non-nil, mouse yank commands yank at point instead of at click.
+This also allows yanking text into an isearch without moving the
+mouse cursor to the echo area."
   :type 'boolean)
 
 (defcustom mouse-drag-copy-region nil