emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/el-search da1f46b 282/332: [el-search] Make mouse click


From: Stefan Monnier
Subject: [elpa] externals/el-search da1f46b 282/332: [el-search] Make mouse clicks not abort the search
Date: Tue, 1 Dec 2020 15:49:04 -0500 (EST)

branch: externals/el-search
commit da1f46bc17431fb94512d7c2f560da5fb7a9781a
Author: Michael Heerdegen <michael_heerdegen@web.de>
Commit: Michael Heerdegen <michael_heerdegen@web.de>

    [el-search] Make mouse clicks not abort the search
    
    Also bump version to 1.8.8.
    
    * packages/el-search/el-search.el (el-search-keep-session-command-p):
    Make 'mouse-drag-region' and 'mouse-set-point' succeed.
    Enhance docstring.
---
 el-search.el | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/el-search.el b/el-search.el
index 65e2dfd..8652b15 100644
--- a/el-search.el
+++ b/el-search.el
@@ -7,7 +7,7 @@
 ;; Created: 29 Jul 2015
 ;; Keywords: lisp
 ;; Compatibility: GNU Emacs 25
-;; Version: 1.8.7
+;; Version: 1.8.8
 ;; Package-Requires: ((emacs "25") (stream "2.2.4") (cl-print "1.0"))
 
 
@@ -1820,12 +1820,18 @@ Go back to the place where the search had been started."
     transient-map))
 
 (defun el-search-keep-session-command-p (command)
-  "Non-nil when COMMAND should not deactivate the current search."
-  (and
-   el-search-allow-scroll
-   (symbolp command)
-   (or (get command 'isearch-scroll) ;isearch is preloaded
-       (get command 'scroll-command))))
+  "Non-nil when COMMAND should not deactivate the current search.
+
+The default is to allow scrolling commands when
+`el-search-allow-scroll' is non-nil and `mouse-set-point'.
+
+For controlling which commands should or should not deactivate an
+active search it is recommended to advice this function."
+  (or (and el-search-allow-scroll
+           (symbolp command)
+           (or (get command 'isearch-scroll) ;isearch is preloaded
+               (get command 'scroll-command)))
+      (memq command '(mouse-drag-region mouse-set-point))))
 
 (defun el-search-prefix-key-maybe-set-transient-map ()
   (set-transient-map



reply via email to

[Prev in Thread] Current Thread [Next in Thread]