]> code.delx.au - gnu-emacs-elpa/commitdiff
use uninterned symbol in `el-search--matcher'
authorMichael Heerdegen <michael_heerdegen@web.de>
Fri, 12 Feb 2016 20:39:04 +0000 (21:39 +0100)
committerMichael Heerdegen <michael_heerdegen@web.de>
Fri, 12 Feb 2016 20:40:12 +0000 (21:40 +0100)
packages/el-search/el-search.el

index 2f69f5f87c6c100df8bac663ed71c14d0ffa68bc..57e4505191c3c6a811134225ebfb111095c57b4f 100644 (file)
@@ -374,14 +374,15 @@ of the definitions is limited to \"el-search\"."
 
 (defun el-search--matcher (pattern &rest body)
   (eval ;use `eval' to allow for user defined pattern types at run time
-   `(el-search--with-additional-pcase-macros
-     (let ((byte-compile-debug t) ;make undefined pattern types raise an error
-           (warning-suppress-log-types '((bytecomp)))
-           (pcase--dontwarn-upats (cons '_ pcase--dontwarn-upats)))
-       (byte-compile (lambda (expression)
-                       (pcase expression
-                         (,pattern ,@(or body (list t)))
-                         (_        nil))))))))
+   (let ((expression (make-symbol "expression")))
+     `(el-search--with-additional-pcase-macros
+       (let ((byte-compile-debug t) ;make undefined pattern types raise an error
+             (warning-suppress-log-types '((bytecomp)))
+             (pcase--dontwarn-upats (cons '_ pcase--dontwarn-upats)))
+         (byte-compile (lambda (,expression)
+                         (pcase ,expression
+                           (,pattern ,@(or body (list t)))
+                           (_        nil)))))))))
 
 (defun el-search--match-p (matcher expression)
   (funcall matcher expression))