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

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

[elpa] externals/el-search 40217c0 174/332: Fix replacing matches with n


From: Stefan Monnier
Subject: [elpa] externals/el-search 40217c0 174/332: Fix replacing matches with nil
Date: Tue, 1 Dec 2020 15:48:38 -0500 (EST)

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

    Fix replacing matches with nil
    
    Replacing PATTERN -> nil replaced with t instead.  This commit fixes
    this.
---
 el-search.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/el-search.el b/el-search.el
index 1298e32..ffe8eda 100644
--- a/el-search.el
+++ b/el-search.el
@@ -811,7 +811,7 @@ N times."
   "Like `pcase--macroexpand' but also expanding \"el-search\" patterns."
   (eval `(el-search--with-additional-pcase-macros (pcase--macroexpand 
',pattern))))
 
-(defun el-search--matcher (pattern &optional result)
+(cl-defun el-search--matcher (pattern &optional (result nil result-specified))
   (eval ;use `eval' to allow for user defined pattern types at run time
    (let ((expression (make-symbol "expression")))
      `(el-search--with-additional-pcase-macros
@@ -820,7 +820,7 @@ N times."
              (pcase--dontwarn-upats (cons '_ pcase--dontwarn-upats)))
          (byte-compile (lambda (,expression)
                          (pcase ,expression
-                           (,pattern ,(or result t))
+                           (,pattern ,(if result-specified result t))
                            (_        nil)))))))))
 
 (defun el-search--match-p (matcher expression)



reply via email to

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