[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/el-search 16a5f70 193/332: * el-search/el-search.el: Sh
From: |
Stefan Monnier |
Subject: |
[elpa] externals/el-search 16a5f70 193/332: * el-search/el-search.el: Shorten the query-replace prompt |
Date: |
Tue, 1 Dec 2020 15:48:43 -0500 (EST) |
branch: externals/el-search
commit 16a5f709fad36edfde5e0559d484609c4985ff1d
Author: Michael Heerdegen <michael_heerdegen@web.de>
Commit: Michael Heerdegen <michael_heerdegen@web.de>
* el-search/el-search.el: Shorten the query-replace prompt
Try to make the prompt of `el-search-query-replace' fit into one
visible line.
(el-search--search-and-replace-pattern): Do it.
(el-search-query-replace): Move the elaborations about splicing
submode to this command's documentation.
---
el-search.el | 41 ++++++++++++++++++++++-------------------
1 file changed, 22 insertions(+), 19 deletions(-)
diff --git a/el-search.el b/el-search.el
index 95441d6..05789c4 100644
--- a/el-search.el
+++ b/el-search.el
@@ -2981,35 +2981,31 @@ reindent."
(lambda ()
(car
(read-multiple-choice
- (concat
- (let ((nbr-done (+ nbr-replaced
nbr-skipped))
- (nbr-to-do (el-search-count-matches
pattern)))
- (format "[%d/%d] "
- (if replaced-this nbr-done (1+
nbr-done))
- (+ nbr-done nbr-to-do)))
- (if replaced-this "" "Replace?"))
+ (let ((nbr-done (+ nbr-replaced nbr-skipped))
+ (nbr-to-do (el-search-count-matches
pattern)))
+ (format "[%d/%d]"
+ (if replaced-this nbr-done (1+
nbr-done))
+ (+ nbr-done nbr-to-do)))
(delq nil
(list
(and (not replaced-this)
- '(?y "yes" "Replace this match
and move to the next"))
+ '(?y "y" "Replace this match and
move to the next"))
(list ?n
- (if replaced-this "next" "no")
+ (if replaced-this "next" "n")
"Go to the next match")
(and (not replaced-this)
- '(?r "replace" "Replace this
match but don't move"))
+ '(?r "r" "Replace this match but
don't move"))
'(?! "all" "Replace all remaining
matches in this buffer")
- '(?b "skip buffer"
+ (and multiple
+ '(?A "All" "Replace all remaining
matches in all buffers"))
+ '(?b "skip buf"
"Skip this buffer and any
remaining matches in it")
(and buffer-file-name
'(?d "skip dir" "Skip a parent
directory of current file"))
- (and multiple
- '(?A "All" "Replace all remaining
matches in all buffers"))
(and (not replaced-this)
- (list ?s (concat "turn splicing "
(if splice "off" "on"))
- "\
-Toggle splicing mode. When splicing mode is on (default off),
-the replacement expression must evaluate to a list, and all of
-the list's elements are inserted."))
+ (list ?s (concat (if splice
"disable" "enable") " splice")
+ (substitute-command-keys "\
+Toggle splicing mode (\\[describe-function] el-search-query-replace for
details).")))
'(?o "show" "Show replacement in a
buffer")
'(?q "quit"))))))))
(if replace-all
@@ -3211,7 +3207,14 @@ When called directly after a search command, use the
current
search to drive query-replace (like in isearch). You get a
multi-buffer query-replace this way when the current search is
multi-buffer. When not called after a search command,
-query-replace all matches following point in the current buffer."
+query-replace all matches following point in the current buffer.
+
+It is also possible to replace matches with any number of expressions
+(even with zero expressions, effectively deleting matches) by using the
+\"splicing\" submode that can be toggled from the prompt with \"s\".
+When splicing mode is on (default off), the replacement
+expression must evaluate to a list, and all of the list's
+elements are inserted in order."
(interactive (el-search-query-replace--read-args)) ;this binds the optional
argument
(setq this-command 'el-search-query-replace) ;in case we come from isearch
(barf-if-buffer-read-only)
- [elpa] externals/el-search cdfe8c1 136/332: Call `user-error' instead of `error' where appropriate, (continued)
- [elpa] externals/el-search cdfe8c1 136/332: Call `user-error' instead of `error' where appropriate, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 5fbbcd1 168/332: Restore current search head in case of error or quit, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 6e4b9cc 170/332: Show line numbers in *El Occur* buffers, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search a20a333 171/332: Use a separate function to document defined pattern types, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 79ab903 179/332: Always use the current search for query-replace, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 6a7ca23 181/332: Don't limit `el-search-emacs-elisp-sources' to "lisp/" subdir, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 8dc608e 187/332: Improve folding behavior in *El Occur* buffers, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search a2e367e 189/332: Fix starting a search with `el-search-this-sexp', Stefan Monnier, 2020/12/01
- [elpa] externals/el-search d1706eb 190/332: Display match count for *El Occur* buffers, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 97626ac 192/332: Use local binding of `post-command-hook' to reset wrap flag, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 16a5f70 193/332: * el-search/el-search.el: Shorten the query-replace prompt,
Stefan Monnier <=
- [elpa] externals/el-search 224f384 196/332: ; * el-search/el-search.el: Mention Emacs Bug#29857 in the header, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 1175d21 200/332: Allow `string' and `symbol' el-search patterns to set match data, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search b88b65a 204/332: Declare any search started with `el-search-this-sexp' single-buffer, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 6b01504 210/332: Add command `el-search-ibuffer-marked-buffers', Stefan Monnier, 2020/12/01
- [elpa] externals/el-search d869368 211/332: Implement `cl-print-object' for el-search-objects, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 6251577 213/332: * el-search/el-search.el: Add `el-search-edit-search-description', Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 48103e3 221/332: * el-search/el-search.el: Fix handling of void replacements, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 7c099aa 225/332: Small improvements to el-search--search-and-replace-pattern, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search da7857b 227/332: * el-search/el-search.el: Add `el-search-looking-at', Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 9f400b4 234/332: * el-search/el-search.el: Fix infloop in el-search--flatten-tree, Stefan Monnier, 2020/12/01