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

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

[elpa] externals/el-search 188fb4a 259/332: [el-search] Minor tweaks and


From: Stefan Monnier
Subject: [elpa] externals/el-search 188fb4a 259/332: [el-search] Minor tweaks and bump version to 1.7.5
Date: Tue, 1 Dec 2020 15:48:59 -0500 (EST)

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

    [el-search] Minor tweaks and bump version to 1.7.5
    
    (el-search-hl-post-command-fun): Don't hide key input feedback when a
    prefix argument is entered.
    (el-search-jump-to-search-head): Simplify test when to call
    'el-search-barf-if-not-search-buffer'.
    (el-search-scroll-down, el-search-scroll-up): Call
    'el-search-barf-if-not-search-buffer'.
---
 NEWS         | 11 +++++++++++
 el-search.el | 23 +++++++++++++++--------
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/NEWS b/NEWS
index bc58997..2e44c8e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,17 @@
 Some of the user visible news were:
 
 
+Version: 1.7.5
+
+The meaning of the prefix argument of `el-search-jump-to-search-head'
+(C-J or M-s e j with the default bindings) has been extended: A
+numeric prefix N jumps to the Nth match after `window-start', while a
+negative prefix -N jumps to the Nth match before `window-end'.  Prefix
+0 jumps to the match following point, which is also useful to resume
+the current search from any buffer position.
+A former search can now be made current with a plain C-u prefix arg.
+
+
 Version: 1.7.3
 
 Match highlighting faces have been improved to look better on text
diff --git a/el-search.el b/el-search.el
index 40c24ad..51ef299 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.7.4
+;; Version: 1.7.5
 ;; Package-Requires: ((emacs "25") (stream "2.2.4") (cl-print "1.0"))
 
 
@@ -2241,7 +2241,13 @@ local binding of `window-scroll-functions'."
 (defun el-search-hl-post-command-fun ()
   (pcase this-command
     ('el-search-query-replace)
-    ('el-search-pattern (el-search-display-match-count))
+    ('el-search-pattern
+     (unless
+         ;; When entering a numerical prefix `this-command' isn't updated.  We
+         ;; test for this condition (is there a better one?) to avoid that key
+         ;; input feedback is hidden
+         (memq universal-argument-map overriding-terminal-local-map)
+       (el-search-display-match-count)))
     ((pred el-search-keep-session-command-p))
     (_ (unless el-search-keep-hl
          (el-search-hl-remove)
@@ -2287,12 +2293,11 @@ In a non-interactive call, ARG should be an integer, 
having the
 same meaning as a numeric prefix arg, or an el-search-object to
 make current."
   (interactive "P")
-  (pcase arg
-    ((or 'nil (pred el-search-object-p) `(,(pred integerp))))
-    (_ (el-search-barf-if-not-search-buffer
-        (current-buffer)
-        "Numeric ARG only allowed in current search's current buffer")))
-  (when (or (consp arg) (el-search-object-p arg))
+  (when (integerp arg)
+    (el-search-barf-if-not-search-buffer
+     (current-buffer)
+     "Numeric ARG only allowed in current search's current buffer"))
+  (when (or (el-search-object-p arg) (consp arg))
     ;; FIXME: would it be better to include some context around the search
     ;; head - or to even use an overview buffer for selection?
     (setq el-search--current-search
@@ -2773,6 +2778,7 @@ Use the normal search commands to seize the search."
 (defun el-search-scroll-down ()
   "Jump to the first match starting after `window-end'."
   (interactive)
+  (el-search-barf-if-not-search-buffer)
   (setq this-command 'el-search-pattern)
   (let ((here (point)))
     (goto-char (window-end))
@@ -2786,6 +2792,7 @@ Use the normal search commands to seize the search."
 (defun el-search-scroll-up ()
   "Jump to the hindmost match starting before `window-start'."
   (interactive)
+  (el-search-barf-if-not-search-buffer)
   (setq this-command 'el-search-pattern)
   (let ((here (point)))
     (goto-char (window-start))



reply via email to

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