[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/el-search fdb5656 270/332: [el-search] Make y move forw
From: |
Stefan Monnier |
Subject: |
[elpa] externals/el-search fdb5656 270/332: [el-search] Make y move forward after replacing |
Date: |
Tue, 1 Dec 2020 15:49:01 -0500 (EST) |
branch: externals/el-search
commit fdb565659dbeb33d48fe99399402221595627644
Author: Michael Heerdegen <michael_heerdegen@web.de>
Commit: Michael Heerdegen <michael_heerdegen@web.de>
[el-search] Make y move forward after replacing
Make y in 'el-search-query-replace' instead of n move to the next
match after replacing a match with r. This feels more logical when
thinking about y and n as abbreviating "yes" and "no".
Also do some related minor rewording.
* packages/el-search/el-search.el
(el-search--search-and-replace-pattern): Make y the key to confirm a
replacement and go to the next match after replacing the current match
with r.
---
el-search.el | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/el-search.el b/el-search.el
index 2c7246a..d598a2b 100644
--- a/el-search.el
+++ b/el-search.el
@@ -298,9 +298,9 @@
;; `(foo ,b ,a . ,rest) RET
;;
;; Type y to replace a match and go to the next one, r to replace
-;; without moving, SPC or n to go to the next match and ! to replace
-;; all remaining matches automatically. q quits. And ? shows a quick
-;; help summarizing all of these keys.
+;; without moving, n to go to the next match without replacing and !
+;; to replace all remaining matches automatically. q quits. ? shows
+;; a quick help summarizing all of these keys.
;;
;; It is possible to replace a match with an arbitrary number of
;; expressions using "splicing mode". When it is active, the
@@ -3711,13 +3711,14 @@ exactly you did? Thanks!"))))
(+ nbr-done nbr-to-do)))
(delq nil
(list
+ `(?y "y"
+ ,(if replaced-this
+ "Keep replacement and move
to the next match"
+ "Replace match and move to
the next"))
(and (not replaced-this)
- '(?y "y" "Replace this match
and move to the next"))
- (list ?n
- (if replaced-this "next" "n")
- "Go to the next match")
+ '(?n "n" "Move to the next
match"))
(and (not replaced-this)
- '(?r "r" "Replace this match
but don't move"))
+ '(?r "r" "Replace match but
don't move"))
'(?! "all" "Replace all remaining
matches in this buffer")
'(?b "skip buf"
"Skip this buffer and any
remaining matches in it")
@@ -3737,10 +3738,11 @@ Toggle splicing mode (\\[describe-function]
el-search-query-replace for details)
(while (not (pcase (funcall query)
(?r (funcall do-replace)
nil)
- (?y (funcall do-replace)
- t)
+ (?y
+ (unless replaced-this (funcall
do-replace))
+ t)
(?n
- (unless replaced-this (cl-incf
nbr-skipped))
+ (cl-incf nbr-skipped)
t)
(?!
(when (and use-current-search
- [elpa] externals/el-search bd67d58 239/332: [el-search] Raise user-error when replacement contains gensyms, (continued)
- [elpa] externals/el-search bd67d58 239/332: [el-search] Raise user-error when replacement contains gensyms, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 96b7423 245/332: [el-search] Special case 'el-search-make-matcher' for '_', Stefan Monnier, 2020/12/01
- [elpa] externals/el-search eef5de0 243/332: [el-search] Save two 'eval' calls, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 427afa8 253/332: [el-search] Bump version to 1.7.1, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 0907a21 248/332: [el-search] Bump version to 1.7, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 1bc9c89 252/332: [el-search] Improve 'el-search-display-match-count', Stefan Monnier, 2020/12/01
- [elpa] externals/el-search ba806ce 251/332: [el-search] Enforce defun start for heuristic matching, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search ab5bcd8 266/332: [el-search] Follow-up to "Fix nested match issues in *El Occur*", Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 2c2930b 256/332: * el-search/el-search.el: Again tweak commentary in header, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 5e97386 255/332: [el-search] Improve match faces, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search fdb5656 270/332: [el-search] Make y move forward after replacing,
Stefan Monnier <=
- [elpa] externals/el-search 75d0232 279/332: [el-search] Fix C-J with numeric arg in case of no match, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search a661225 272/332: [el-search] Minor tweaks in el-search-query-replace, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search e29370e 281/332: [el-search] Fix more "redundant _ pattern" warnings, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 5c903d9 292/332: [el-search] Small fix for my last commit, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search be0324a 301/332: [el-search] Some minor tweaks and bump version to 1.10.1, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 3b4b95b 304/332: [el-search] Small fix in el-search--changed-files-in-repo, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 2f427dd 318/332: [el-search] Query-replace: Change skip keys, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search a5dd88c 322/332: [el-search] Minor fix in el-search-query-replace--read-args, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 1939340 324/332: [el-search] Harmonize search and qu-replace prefix arg, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 43779b9 329/332: [el-search] Improve "New command el-search-repository", Stefan Monnier, 2020/12/01