diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2016-05-18 00:12:01 -0700 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-05-18 00:49:30 -0700 |
| commit | 639fd22e294fa1702c93531ebb96efb4f3cdffbd (patch) | |
| tree | 8190d9d9fc2f3512d38fa77892ece399040a8b02 | |
| parent | ccd5156c42771fc3262fa6b8103dc9d8429898d2 (diff) | |
| download | emacs-639fd22e294fa1702c93531ebb96efb4f3cdffbd.tar.gz | |
Pacify byte-compiler for with-wrapper-hook
* 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.
| -rw-r--r-- | lisp/abbrev.el | 2 | ||||
| -rw-r--r-- | lisp/minibuffer.el | 2 | ||||
| -rw-r--r-- | lisp/simple.el | 3 | ||||
| -rw-r--r-- | lisp/subr.el | 4 |
4 files changed, 8 insertions, 3 deletions
diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 7814ea24b4a..163dc8e5727 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -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)) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 1ee05d32de5..9190c1fb203 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -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) diff --git a/lisp/simple.el b/lisp/simple.el index e2570625f32..65664c93666 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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 diff --git a/lisp/subr.el b/lisp/subr.el index 0fa6404d37d..438f00a6f13 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -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")) |
