]> code.delx.au - gnu-emacs/commitdiff
Pacify byte-compiler for with-wrapper-hook
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 18 May 2016 07:12:01 +0000 (00:12 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 18 May 2016 07:49:30 +0000 (00:49 -0700)
* lisp/subr.el (subr--with-wrapper-hook-no-warnings):
New macro, split out from with-wrapper-hook.
* lisp/abbrev.el (abbrev--default-expand):
* lisp/minibuffer.el (completion--in-region):
* lisp/simple.el (buffer-substring--filter):
* lisp/subr.el (with-wrapper-hook):
Use it.

lisp/abbrev.el
lisp/minibuffer.el
lisp/simple.el
lisp/subr.el

index 7814ea24b4a44daa4465d9ab26b610c9917f3696..163dc8e57273785cc540bba1d410fc8f9ffe742e 100644 (file)
@@ -848,7 +848,7 @@ if expansion occurred, else nil.)"
   "Default function to use for `abbrev-expand-function'.
 This respects the wrapper hook `abbrev-expand-functions'.
 Calls `abbrev-insert' to insert any expansion, and returns what it does."
-  (with-wrapper-hook abbrev-expand-functions ()
+  (subr--with-wrapper-hook-no-warnings abbrev-expand-functions ()
     (pcase-let ((`(,sym ,name ,wordstart ,wordend) (abbrev--before-point)))
       (when sym
         (let ((startpos (copy-marker (point) t))
index 1ee05d32de5bc484028bd9dca78c7cec8ddb99e4..9190c1fb203644faebb6b3b0e42730ffbb3dcdff 100644 (file)
@@ -1970,7 +1970,7 @@ if there was no valid completion, else t."
   "Default function to use for `completion-in-region-function'.
 Its arguments and return value are as specified for `completion-in-region'.
 This respects the wrapper hook `completion-in-region-functions'."
-  (with-wrapper-hook
+  (subr--with-wrapper-hook-no-warnings
       ;; FIXME: Maybe we should use this hook to provide a "display
       ;; completions" operation as well.
       completion-in-region-functions (start end collection predicate)
index e2570625f3207d8604e297ca5a62039fa6404421..65664c93666d8d19fa66e77769cbcba7e7f71675 100644 (file)
@@ -4061,7 +4061,8 @@ Its arguments and return value are as specified for `filter-buffer-substring'.
 This respects the wrapper hook `filter-buffer-substring-functions',
 and the abnormal hook `buffer-substring-filters'.
 No filtering is done unless a hook says to."
-  (with-wrapper-hook filter-buffer-substring-functions (beg end delete)
+  (subr--with-wrapper-hook-no-warnings
+    filter-buffer-substring-functions (beg end delete)
     (cond
      ((or delete buffer-substring-filters)
       (save-excursion
index 0fa6404d37dcb692171294e816231b3dd8481708..438f00a6f134c2ccf54fddf4342b6dabc7792ab4 100644 (file)
@@ -1546,6 +1546,10 @@ FUN is then called once."
   (declare (indent 2) (debug (form sexp body))
            (obsolete "use a <foo>-function variable modified by `add-function'."
                      "24.4"))
+  `(subr--with-wrapper-hook-no-warnings ,hook ,args ,@body))
+
+(defmacro subr--with-wrapper-hook-no-warnings (hook args &rest body)
+  "Like (with-wrapper-hook HOOK ARGS BODY), but without warnings."
   ;; We need those two gensyms because CL's lexical scoping is not available
   ;; for function arguments :-(
   (let ((funs (make-symbol "funs"))