[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/el-search f02e86f 142/332: New command `el-search-from-
From: |
Stefan Monnier |
Subject: |
[elpa] externals/el-search f02e86f 142/332: New command `el-search-from-beginning' |
Date: |
Tue, 1 Dec 2020 15:48:30 -0500 (EST) |
branch: externals/el-search
commit f02e86f32394b023677382034131804f005ec36c
Author: Michael Heerdegen <michael_heerdegen@web.de>
Commit: Michael Heerdegen <michael_heerdegen@web.de>
New command `el-search-from-beginning'
---
el-search.el | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/el-search.el b/el-search.el
index 160e243..b8c0abe 100644
--- a/el-search.el
+++ b/el-search.el
@@ -41,6 +41,7 @@
;; (define-key global-map [(control ?J)]
#'el-search-jump-to-search-head)
;; (define-key global-map [(control ?N)]
#'el-search-continue-in-next-buffer)
;; (define-key global-map [(control ?O)] #'el-search-overview)
+;; (define-key global-map [(control ?A)] #'el-search-from-beginning)
;;
;; (define-key el-search-read-expression-map [(control ?S)]
#'exit-minibuffer)
;;
@@ -245,10 +246,6 @@
;; you select an older search to resume and switches to the buffer and
;; position where this search had been suspended.
;;
-;; There is no special command to restart a prior search from the
-;; beginning. I suggest to use the pattern input history or
-;; `repeat-complex-command'.
-;;
;;
;; Writing replacement rules for semi-automatic code rewriting
;; ===========================================================
@@ -1643,6 +1640,18 @@ additional pattern types are currently defined:"
(put 'el-search-pattern 'function-documentation '(el-search--make-docstring
'el-search-pattern))
+(defun el-search-from-beginning (&optional restart-search)
+ "Go to the first of the current search's recorded matches in this buffer.
+With prefix arg, restart the current search."
+ (interactive "P")
+ (if (not restart-search)
+ (setf (el-search-object-matches el-search--current-search)
el-search--this-buffer-matches)
+ (cl-callf el-search-reset-search el-search--current-search)
+ (setq el-search--success nil)
+ (el-search--message-no-log "[Wrapped search]")
+ (sit-for .7))
+ (el-search-continue-search))
+
(defun el-search-previous-match ()
"Revisit found matches in the current buffer in reverse order."
;; Implementing backward el-searching is very hard (or very slow,
- [elpa] externals/el-search 3b73e0e 154/332: Extend heuristic matching to top-level sexps, (continued)
- [elpa] externals/el-search 3b73e0e 154/332: Extend heuristic matching to top-level sexps, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 0cff5d2 153/332: Recompile search pattern when resuming searches, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 51a539a 158/332: Implement multi-buffer query-replace, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 56d9f20 165/332: Add some useful commands for *El Occur* buffers, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 40217c0 174/332: Fix replacing matches with nil, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 1bfe7c0 110/332: Simplify `el-search--transform-nontrivial-lpat', Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 6ff7aa4 116/332: Work around Emacs bug#24542, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 817c902 123/332: Document change-revision transformer function; make a defcustom, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 2d6aad6 132/332: Explicitly `error' when trying to jump to invalid search head, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 8875d2a 137/332: Avoid infinite recursion in circular programs, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search f02e86f 142/332: New command `el-search-from-beginning',
Stefan Monnier <=
- [elpa] externals/el-search 4b6a363 138/332: Improve handling of reader errors in el-search-atom-list, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 806bfc4 157/332: Add new command `el-search-this-sexp', Stefan Monnier, 2020/12/01
- [elpa] externals/el-search c66d1da 160/332: Make the el-search-object struct contain an alist of properties, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 4a6c3e2 162/332: Some details, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search d412688 199/332: Update copyrights of some packages, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search cf465e0 203/332: * el-search/el-search.el: Add two more autoload cookies, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 42c776a 207/332: * el-search/el-search.el: Tweak el-search-jump-to-search-head, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search ce97e9d 108/332: el-search: bump version to 0.2.2, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search e5bd647 214/332: * el-search/el-search.el: Work around Emacs Bug#29857, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search d995af1 166/332: Don't let el-search-pattern resume a paused search, Stefan Monnier, 2020/12/01