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

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

[elpa] externals/el-search 1e97c09 069/332: Fix for non-interactive call


From: Stefan Monnier
Subject: [elpa] externals/el-search 1e97c09 069/332: Fix for non-interactive calls of el-search-pattern
Date: Tue, 1 Dec 2020 15:48:13 -0500 (EST)

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

    Fix for non-interactive calls of el-search-pattern
---
 el-search.el | 36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/el-search.el b/el-search.el
index dea74b2..52e919a 100644
--- a/el-search.el
+++ b/el-search.el
@@ -849,23 +849,25 @@ The following additional pattern types are currently 
defined:"
                                         (not (eq (symbol-value pattern) 
pattern))))
                            (error "Please don't forget the quote when 
searching for a symbol"))
                          (el-search--wrap-pattern pattern)))))
-  (setq this-command 'el-search-pattern) ;in case we come from isearch
-  (setq el-search-current-pattern pattern)
-  (let ((opoint (point)))
-    (when (and (eq this-command last-command) el-search-success)
-      (el-search--skip-expression nil t))
-    (setq el-search-success nil)
-    (when (condition-case nil
-              (el-search--search-pattern pattern)
-            (end-of-buffer (message "No match")
-                           (goto-char opoint)
-                           (el-search-hl-remove)
-                           (ding)
-                           nil))
-      (setq el-search-success t)
-      (el-search-hl-sexp)
-      (unless (eq this-command last-command)
-        (el-search-hl-other-matches pattern)))))
+  (if (not (called-interactively-p 'any))
+      (el-search--search-pattern pattern)
+    (setq this-command 'el-search-pattern) ;in case we come from isearch
+    (setq el-search-current-pattern pattern)
+    (let ((opoint (point)))
+      (when (and (eq this-command last-command) el-search-success)
+        (el-search--skip-expression nil t))
+      (setq el-search-success nil)
+      (when (condition-case nil
+                (el-search--search-pattern pattern)
+              (end-of-buffer (message "No match")
+                             (goto-char opoint)
+                             (el-search-hl-remove)
+                             (ding)
+                             nil))
+        (setq el-search-success t)
+        (el-search-hl-sexp)
+        (unless (eq this-command last-command)
+          (el-search-hl-other-matches pattern))))))
 
 (defvar el-search-search-and-replace-help-string
   "\



reply via email to

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