[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f1e5957: * el-search/el-search.el: Bump version to 1.6; so
From: |
Michael Heerdegen |
Subject: |
[elpa] master f1e5957: * el-search/el-search.el: Bump version to 1.6; some minor tweaks |
Date: |
Sat, 24 Feb 2018 09:25:32 -0500 (EST) |
branch: master
commit f1e5957b4d049ca410ef4d1fbf354a6a3593b812
Author: Michael Heerdegen <address@hidden>
Commit: Michael Heerdegen <address@hidden>
* el-search/el-search.el: Bump version to 1.6; some minor tweaks
---
packages/el-search/el-search-x.el | 69 ++++++++++++++++++++-------------------
packages/el-search/el-search.el | 33 ++++++++++++++-----
2 files changed, 61 insertions(+), 41 deletions(-)
diff --git a/packages/el-search/el-search-x.el
b/packages/el-search/el-search-x.el
index 1664a14..30b5c52 100644
--- a/packages/el-search/el-search-x.el
+++ b/packages/el-search/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/packages/el-search/el-search.el b/packages/el-search/el-search.el
index 225861c..5b4cb5d 100644
--- a/packages/el-search/el-search.el
+++ b/packages/el-search/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))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] master f1e5957: * el-search/el-search.el: Bump version to 1.6; some minor tweaks,
Michael Heerdegen <=