emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/el-search e0e2994 111/332: Some details


From: Stefan Monnier
Subject: [elpa] externals/el-search e0e2994 111/332: Some details
Date: Tue, 1 Dec 2020 15:48:23 -0500 (EST)

branch: externals/el-search
commit e0e299400b7e07d420bdcd5435c42aba70a464ad
Author: Michael Heerdegen <michael_heerdegen@web.de>
Commit: Michael Heerdegen <michael_heerdegen@web.de>

    Some details
---
 el-search.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/el-search.el b/el-search.el
index d20d5fb..61aa9b8 100644
--- a/el-search.el
+++ b/el-search.el
@@ -210,6 +210,11 @@
 ;;
 ;; - improve docstrings
 ;;
+;; - Make it work in comments, too? (-> `parse-sexp-ignore-comments').
+;;   Related: should the pattern `symbol' also match strings that
+;;   contain matches for a symbol so that it's possible to replace
+;;   also occurrences of a symbol in docstrings?
+;;
 ;; - handle more reader syntaxes, e.g. #n, #n#
 ;;
 ;; - Implement sessions; add multi-file support based on iterators.  A
@@ -465,7 +470,7 @@ Return PATTERN if this pattern type was not defined with
                      el-search--pcase-macros)
      ,@body))
 
-(defun el-search--matcher (pattern &rest body)
+(defun el-search--matcher (pattern &optional result)
   (eval ;use `eval' to allow for user defined pattern types at run time
    (let ((expression (make-symbol "expression")))
      `(el-search--with-additional-pcase-macros
@@ -474,7 +479,7 @@ Return PATTERN if this pattern type was not defined with
              (pcase--dontwarn-upats (cons '_ pcase--dontwarn-upats)))
          (byte-compile (lambda (,expression)
                          (pcase ,expression
-                           (,pattern ,@(or body (list t)))
+                           (,pattern ,(or result t))
                            (_        nil)))))))))
 
 (defun el-search--match-p (matcher expression)
@@ -533,7 +538,7 @@ Return PATTERN if this pattern type was not defined with
     match-beg))
 
 (defun el-search--search-pattern (pattern &optional noerror)
-  "Search elisp buffer with `pcase' PATTERN.
+  "Search for el-search PATTERN in current buffer.
 Set point to the beginning of the occurrence found and return
 point.  Optional second argument, if non-nil, means if fail just
 return nil (no error)."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]