[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/el-search a26b6e0 152/332: Reset wrap flag even when no
From: |
Stefan Monnier |
Subject: |
[elpa] externals/el-search a26b6e0 152/332: Reset wrap flag even when no match |
Date: |
Tue, 1 Dec 2020 15:48:33 -0500 (EST) |
branch: externals/el-search
commit a26b6e099b5278bcb3191c93e6fd74dfd5d0b048
Author: Michael Heerdegen <michael_heerdegen@web.de>
Commit: Michael Heerdegen <michael_heerdegen@web.de>
Reset wrap flag even when no match
---
el-search.el | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/el-search.el b/el-search.el
index 05b1387..94dc1df 100644
--- a/el-search.el
+++ b/el-search.el
@@ -1653,7 +1653,6 @@ local binding of `window-scroll-functions'."
(defun el-search-hl-post-command-fun ()
(unless (or (eq this-command 'el-search-query-replace)
(eq this-command 'el-search-pattern))
- (setq el-search--wrap-flag nil)
(if el-search-keep-hl
(when (eq el-search-keep-hl 'once)
(setq el-search-keep-hl nil))
@@ -1662,6 +1661,17 @@ local binding of `window-scroll-functions'."
(setq el-search--temp-buffer-flag nil)
(el-search-kill-left-over-search-buffers))))
+(defun el-search--reset-wrap-flag ()
+ (unless (or (eq this-command 'el-search-query-replace)
+ (eq this-command 'el-search-pattern))
+ (remove-hook 'post-command-hook 'el-search--reset-wrap-flag t)
+ (setq el-search--wrap-flag nil)))
+
+(defun el-search--set-wrap-flag (value)
+ (when value
+ (add-hook 'post-command-hook #'el-search--reset-wrap-flag t t))
+ (setq el-search--wrap-flag value))
+
;;;; Core functions
@@ -1706,7 +1716,7 @@ that the current search."
(number-sequence 0 (1- (ring-length
el-search-history))))))))))
(setq el-search--current-search entry)
(setq el-search--success t)
- (setq el-search--wrap-flag nil)))
+ (el-search--set-wrap-flag nil)))
(if-let ((search el-search--current-search)
(current-head (el-search-object-head search))
(current-search-buffer (el-search-head-buffer current-head)))
@@ -1768,7 +1778,7 @@ continued."
(progn
(el-search--message-no-log "No matches")
(sit-for .7))
- (setq el-search--wrap-flag 'forward)
+ (el-search--set-wrap-flag 'forward)
(let ((keys (car (where-is-internal 'el-search-pattern))))
(el-search--message-no-log
(if keys
@@ -1851,7 +1861,7 @@ additional pattern types are currently defined:"
(cond
((eq el-search--wrap-flag 'forward)
(progn
- (setq el-search--wrap-flag nil)
+ (el-search--set-wrap-flag nil)
(el-search--message-no-log "[Wrapped search]")
(sit-for .7)
(el-search-from-beginning 'restart)))
@@ -1904,7 +1914,7 @@ With prefix arg, restart the current search."
(el-search--next-buffer el-search--current-search))
(setq this-command 'el-search-pattern)
(when (eq el-search--wrap-flag 'backward)
- (setq el-search--wrap-flag nil)
+ (el-search--set-wrap-flag nil)
(el-search--message-no-log "[Wrapped backward search]")
(sit-for .7)
(goto-char (point-max)))
@@ -1951,7 +1961,7 @@ With prefix arg, restart the current search."
"No (more) match")))
(sit-for .7)
(goto-char original-point)
- (setq el-search--wrap-flag 'backward)))
+ (el-search--set-wrap-flag 'backward)))
(setq outer-loop-done t)
(goto-char last-match)
(setf (el-search-head-position (el-search-object-head
el-search--current-search))
- [elpa] externals/el-search 63172a4 222/332: Treat inserted replacements as potential to-replace candidates, (continued)
- [elpa] externals/el-search 63172a4 222/332: Treat inserted replacements as potential to-replace candidates, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search e0e2994 111/332: Some details, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search f26277b 117/332: Rewrite of el-search for version 1.0, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 1ef4266 114/332: Make el-search--make-docstring require a NAME argument, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 278a930 125/332: Speed up multi searching; version 1.1, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 0c2f0e5 127/332: Don't use the non-word "heuristical", Stefan Monnier, 2020/12/01
- [elpa] externals/el-search a38665c 115/332: Add section "Patterns for stylistic rewriting" and pattern `iffy-if', Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 8fdb91d 124/332: New command `el-search-load-path', Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 4202501 148/332: el-search version 1.3: Lots of fixes and improvements, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search d54491c 147/332: Add a FILE argument to `el-search-dired-marked-files', Stefan Monnier, 2020/12/01
- [elpa] externals/el-search a26b6e0 152/332: Reset wrap flag even when no match,
Stefan Monnier <=
- [elpa] externals/el-search 6919e8d 141/332: Also count pattern types starting with "_" as internal, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search b8e3812 144/332: Improve half-baked introduction of key bindings, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search e96c054 156/332: Handle read errors when reading and validating replacement, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 6f0f22c 155/332: Some details, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 6e6013a 159/332: Fix and speed up the `change' pattern type, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search c878a24 173/332: Fix "Make amount of context around occur matches adjustable", Stefan Monnier, 2020/12/01
- [elpa] externals/el-search f6b1aec 180/332: Some details, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 8583d46 191/332: Fix resuming a single-buffer query-replace, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 365f93f 197/332: * el-search/el-search.el: Some buffer display related minor tweaks, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search c69dd52 205/332: * el-search/el-search.el: Some minor tweaks, Stefan Monnier, 2020/12/01