[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 79f5e2c: Some details
From: |
Michael Heerdegen |
Subject: |
[elpa] master 79f5e2c: Some details |
Date: |
Mon, 7 Nov 2016 11:31:07 +0000 (UTC) |
branch: master
commit 79f5e2c1349073dd7228c680e9a39ae2da4cb61e
Author: Michael Heerdegen <address@hidden>
Commit: Michael Heerdegen <address@hidden>
Some details
---
packages/el-search/el-search-x.el | 4 ++--
packages/el-search/el-search.el | 28 +++++++++++++++++++---------
2 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/packages/el-search/el-search-x.el
b/packages/el-search/el-search-x.el
index d5ff11b..ddd015c 100644
--- a/packages/el-search/el-search-x.el
+++ b/packages/el-search/el-search-x.el
@@ -246,7 +246,7 @@ Use variable `el-search--cached-changes' for caching."
Requires library \"diff-hl\". REVISION defaults to the file's
repository's HEAD commit and is a git revision string. Customize
-`el-search-change-revision-transformer-function' to modify how
+`el-search-change-revision-transformer-function' to control how
REVISION is interpreted."
`(guard (el-search--change-p (point) ,(or revision "HEAD"))))
@@ -255,7 +255,7 @@ REVISION is interpreted."
Requires library \"diff-hl\". REVISION defaults to the file's
repository's HEAD commit and is a git revision string. Customize
-`el-search-change-revision-transformer-function' to modify how
+`el-search-change-revision-transformer-function' to control how
REVISION is interpreted."
`(guard (el-search--changed-p (point) ,(or revision "HEAD"))))
diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el
index 9c0a6b8..a823e0a 100644
--- a/packages/el-search/el-search.el
+++ b/packages/el-search/el-search.el
@@ -226,7 +226,11 @@
;; (el-search-all-matches (el-search-make-search pattern stream))
;;
;; where PATTERN is the search pattern and STREAM is a stream of
-;; buffers or files. For example,
+;; buffers or files (typical ways to construct such a STREAM are to
+;; call the `stream' function on a list of buffers, or to use
+;; `el-search-stream-of-directory-files').
+;;
+;; For example,
;;
;; (el-search-all-matches
;; (el-search-make-search
@@ -685,10 +689,12 @@ Keys are pattern names (i.e. symbols), and values the
associated
heuristical matcher functions.")
(defmacro el-search-defpattern (name args &rest body)
- "Like `pcase-defmacro', but limited to el-search patterns.
+ "Like `pcase-defmacro', but for defining el-search patterns.
+
The semantics is exactly that of `pcase-defmacro', but the scope
of the definitions is limited to \"el-search\", using a separate
-name space.
+name space. The expansion is allowed to use any defined `pcase'
+pattern as well as any defined el-search pattern.
The docstring may be followed by a `defun' style declaration list
DECL. There is only one respected specification, it has the form
@@ -718,16 +724,19 @@ match.
\(fn NAME ARGLIST &optional DOCSTRING DECL &rest BODY)"
(declare (indent 2) (debug defun))
- (let ((set-heuristical-matcher ()))
- (pcase body
- (`(,(and (pred stringp) doc) (declare (heuristical-matcher
,heuristical-matcher)) . ,real-body)
+ (let ((doc nil) (set-heuristical-matcher ()))
+ (when (stringp (car body))
+ (setq doc (car body)
+ body (cdr body)))
+ (pcase (car body)
+ (`(declare (heuristical-matcher ,heuristical-matcher))
(setq set-heuristical-matcher
`((setf (alist-get ',name el-search--heuristical-matchers)
,heuristical-matcher)))
- (setq body (cons doc real-body))))
+ (setq body (cdr body))))
`(progn
,@set-heuristical-matcher
(setf (alist-get ',name el-search--pcase-macros)
- (lambda ,args ,@body)))))
+ (lambda ,args ,doc ,@body)))))
(defmacro el-search--with-additional-pcase-macros (&rest body)
`(cl-letf ,(mapcar (pcase-lambda (`(,symbol . ,fun)) `((get ',symbol
'pcase-macroexpander) #',fun))
@@ -1431,7 +1440,8 @@ continued."
(setf (el-search-head-position head) (copy-marker (point))))
((and current-search-buffer (buffer-live-p current-search-buffer))
(error "Please resume from buffer %s" (buffer-name
current-search-buffer)))
- (t (error "Invalid search head: buffer killed")))))
+ (current-search-buffer
+ (error "Invalid search head: buffer killed")))))
(unwind-protect
(let ((stream-of-matches (el-search-object-matches
el-search--current-search)))
(if (not (stream-empty-p stream-of-matches))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] master 79f5e2c: Some details,
Michael Heerdegen <=