]> code.delx.au - gnu-emacs-elpa/commitdiff
fix compiler errors and warnings
authorMichael Heerdegen <michael_heerdegen@web.de>
Thu, 5 Nov 2015 20:53:02 +0000 (21:53 +0100)
committerMichael Heerdegen <michael_heerdegen@web.de>
Thu, 5 Nov 2015 20:53:02 +0000 (21:53 +0100)
packages/el-search/el-search.el

index 0a12113c3d7da31f783b8d44654dc1e389e0d7a2..b286e07e3fd10e4f79b6dce536af17e51a4df80f 100644 (file)
 (require 'cl-lib)
 (require 'elisp-mode)
 (require 'thingatpt)
+(require 'help-fns) ;el-search--make-docstring
 
 
 ;;;; Configuration stuff
@@ -284,6 +285,8 @@ prompt to refer to the value of the currently tested expression."
     (read-from-minibuffer prompt initial-contents el-search-read-expression-map read
                           (or hist 'read-expression-history) default)))
 
+(defvar el-search--initial-mb-contents nil)
+
 (defun el-search--read-pattern (prompt &optional default read)
   (let ((this-sexp (sexp-at-point)))
     (minibuffer-with-setup-hook
@@ -341,7 +344,6 @@ Point must not be inside a string or comment."
   ;; code mainly from `pcase--make-docstring'
   (let* ((main (documentation (symbol-function 'el-search-pattern) 'raw))
          (ud (help-split-fundoc main 'pcase)))
-    (require 'help-fns)
     (with-temp-buffer
       (insert (or (cdr ud) main))
       (mapc
@@ -437,13 +439,14 @@ this pattern type."
      ,@body))
 
 (defun el-search--matcher (pattern &rest body)
-  (let ((warning-suppress-log-types '((bytecomp))))
-    (el-search--with-additional-pcase-macros
-     (byte-compile
-      `(lambda (expression)
-         (pcase expression
-           (,pattern ,@(or body (list t)))
-           (_        nil)))))))
+  (eval
+   `(el-search--with-additional-pcase-macros
+     (let ((warning-suppress-log-types '((bytecomp))))
+       (byte-compile
+        (lambda (expression)
+          (pcase expression
+            (,pattern ,@(or body (list t)))
+            (_        nil))))))))
 
 (defun el-search--match-p (matcher expression)
   (funcall matcher expression))
@@ -686,10 +689,6 @@ The following additional pattern types are currently defined:\n"
              (if (zerop nbr-skipped)  ""
                (format "   (%d skipped)" nbr-skipped)))))
 
-;; We need a variable for the initial contents because we want to `call-interactively'
-;; `el-search-query-replace-read-args'
-(defvar el-search--initial-mb-contents nil)
-
 (defun el-search-query-replace-read-args ()
   (barf-if-buffer-read-only)
   (let* ((from (el-search--read-pattern "Replace from: "))