[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/el-search 41e0251 224/332: * el-search/el-search.el: Bu
From: |
Stefan Monnier |
Subject: |
[elpa] externals/el-search 41e0251 224/332: * el-search/el-search.el: Bump version to 1.6; some minor tweaks |
Date: |
Tue, 1 Dec 2020 15:48:50 -0500 (EST) |
branch: externals/el-search
commit 41e02510e5d32a809366b17939da20d05c9fcef7
Author: Michael Heerdegen <michael_heerdegen@web.de>
Commit: Michael Heerdegen <michael_heerdegen@web.de>
* el-search/el-search.el: Bump version to 1.6; some minor tweaks
---
el-search-x.el | 69 ++++++++++++++++++++++++++++++----------------------------
el-search.el | 33 +++++++++++++++++++++-------
2 files changed, 61 insertions(+), 41 deletions(-)
diff --git a/el-search-x.el b/el-search-x.el
index 1664a14..30b5c52 100644
--- a/el-search-x.el
+++ b/el-search-x.el
@@ -349,6 +349,42 @@ files."
`(guard (el-search--changed-p (point) ,(or revision "HEAD"))))
+;;;; `outermost' and `top-level'
+
+(el-search-defpattern outermost (pattern &optional not-pattern)
+ "Matches when PATTERN matches but the parent sexp does not.
+For toplevel expressions, this is equivalent to PATTERN.
+
+Optional NOT-PATTERN defaults to PATTERN; when given, match when
+PATTERN matches but the parent sexp is not matched by
+NOT-PATTERN.
+
+
+This pattern is useful to match only the outermost expression
+when subexpressions would match recursively. For
+example, (outermost _) matches only top-level expressions.
+Another example: For the `change' pattern, any subexpression of a
+match is typically also an according change. Wrapping the
+`change' pattern into `outermost' prevents el-search from
+descending into any found expression - only the outermost
+expression matching the `change' pattern will be matched."
+ `(and ,pattern
+ (not (guard (save-excursion
+ (condition-case nil
+ (progn
+ (backward-up-list)
+ (el-search--match-p
+ ',(el-search--matcher (or not-pattern pattern))
+ (save-excursion (el-search-read
(current-buffer)))))
+ (scan-error)))))))
+
+(el-search-defpattern top-level ()
+ "Matches any toplevel expression."
+ '(outermost _))
+
+
+;;; Sloppy pattern types for quick navigation
+
;;;; `keys'
(defun el-search--match-key-sequence (keys expr)
@@ -384,39 +420,6 @@ matches any of these expressions:
`(pred (el-search--match-key-sequence ,key-sequence)))
-;;;; `outermost' and `top-level'
-
-(el-search-defpattern outermost (pattern &optional not-pattern)
- "Matches when PATTERN matches but the parent sexp does not.
-For toplevel expressions, this is equivalent to PATTERN.
-
-Optional NOT-PATTERN defaults to PATTERN; when given, match when
-PATTERN matches but the parent sexp is not matched by
-NOT-PATTERN.
-
-
-This pattern is useful to match only the outermost expression
-when subexpressions would match recursively. For
-example, (outermost _) matches only top-level expressions.
-Another example: For the `change' pattern, any subexpression of a
-match is typically also an according change. Wrapping the
-`change' pattern into `outermost' prevents el-search from
-descending into any found expression - only the outermost
-expression matching the `change' pattern will be matched."
- `(and ,pattern
- (not (guard (save-excursion
- (condition-case nil
- (progn
- (backward-up-list)
- (el-search--match-p
- ',(el-search--matcher (or not-pattern pattern))
- (save-excursion (el-search-read
(current-buffer)))))
- (scan-error)))))))
-
-(el-search-defpattern top-level ()
- "Matches any toplevel expression."
- '(outermost _))
-
;;; Patterns for stylistic rewriting and syntactical simplification
diff --git a/el-search.el b/el-search.el
index 225861c..5b4cb5d 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.5.4
+;; Version: 1.6
;; Package-Requires: ((emacs "25") (stream "2.2.4") (cl-print "1.0"))
@@ -385,9 +385,20 @@
;; syntax "##" (a syntax for an interned symbol whose name is the
;; empty string) can lead to errors while searching.
;;
+;; - In *El Occur* buffers, when there are adjacent or nested matches,
+;; the movement commands (el-search-occur-previous-match,
+;; el-search-occur-next-match aka n and p) may skip matches, and the
+;; shown match count can be inaccurate.
+;;
;;
;; TODO:
;;
+;; - There should be a way to go back to the starting position, like
+;; in Isearch, which does this with (push-mark isearch-opoint t) in
+;; `isearch-done'.
+;;
+;; - Add a help command that can be called while searching.
+;;
;; - Make searching work in comments, too? (->
;; `parse-sexp-ignore-comments'). Related: should the pattern
;; `symbol' also match strings that contain matches for a symbol so
@@ -432,7 +443,7 @@
(require 'help-fns) ;el-search--make-docstring
(require 'ring) ;el-search-history
(require 'hideshow) ;folding in *El Occur*
-(eval-when-compile (require 'outline)) ;folding in *El Occur*
+(require 'outline) ;folding in *El Occur*
;;;; Configuration stuff
@@ -2172,7 +2183,7 @@ current."
(redisplay)
;; Don't just `sit-for' here: `pop-to-buffer' may have generated
frame
;; focus events
- (sleep-for 3))
+ (sleep-for 1.5))
(if (not match-pos)
(el-search-continue-search)
(goto-char match-pos)
@@ -2848,7 +2859,7 @@ Prompt for a new pattern and revert."
(if (zerop overall-matches)
";;; * No matches"
(concat
- (format ";;; ** Found %d matches in " overall-matches)
+ (format ";;; ** %d matches in " overall-matches)
(unless (zerop matching-files) (format "%d files"
matching-files))
(unless (or (zerop matching-files) (zerop
matching-buffers)) " and ")
(unless (zerop matching-buffers) (format "%d buffers"
matching-buffers))
@@ -2860,8 +2871,10 @@ Prompt for a new pattern and revert."
(which-func-ff-hook)))
(quit (insert "\n\n;;; * Aborted"))
(error (insert "\n\n;;; * Error: " (error-message-string err)
- "\n;;; Please make a bug report to the maintainer.
-;;; Thanks in advance!")))
+ "\n\
+;;; If you think this error could be caused by a bug in
+;;; el-search, please make a bug report to the maintainer.
+;;; Thanks!")))
(el-search--message-no-log "")
(set-buffer-modified-p nil))))
(el-search-kill-left-over-search-buffers)))
@@ -3410,8 +3423,12 @@ Toggle splicing mode (\\[describe-function]
el-search-query-replace for details)
(format " (%d skipped)"
nbr-skipped)))
'((?y "yes")
(?n "no")
- (?Y "Yes to all")
- (?N "No to all"))))
+ (?Y "Yes to all"
+ "\
+Save this buffer and all following buffers without asking again")
+ (?N "No to all"
+ "\
+Don't save this buffer and all following buffers; don't ask again"))))
(?y t)
(?n nil)
(?Y (cdr (setq save-all-answered (cons t
t))))
- [elpa] externals/el-search 1175d21 200/332: Allow `string' and `symbol' el-search patterns to set match data, (continued)
- [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
- [elpa] externals/el-search 3bb5b76 236/332: * el-search/el-search.el: Prefer adverb "backward" in names and text, Stefan Monnier, 2020/12/01
- [elpa] externals/el-search 41e0251 224/332: * el-search/el-search.el: Bump version to 1.6; some minor tweaks,
Stefan Monnier <=
- [elpa] externals/el-search c4eeae5 223/332: * el-search/el-search.el: Fix single buffer query-replace, Stefan Monnier, 2020/12/01
- [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