mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-07 14:18:32 +00:00
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.
This commit is contained in:
parent
ccd5156c42
commit
639fd22e29
@ -848,7 +848,7 @@ if expansion occurred, else nil.)"
|
|||||||
"Default function to use for `abbrev-expand-function'.
|
"Default function to use for `abbrev-expand-function'.
|
||||||
This respects the wrapper hook `abbrev-expand-functions'.
|
This respects the wrapper hook `abbrev-expand-functions'.
|
||||||
Calls `abbrev-insert' to insert any expansion, and returns what it does."
|
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)))
|
(pcase-let ((`(,sym ,name ,wordstart ,wordend) (abbrev--before-point)))
|
||||||
(when sym
|
(when sym
|
||||||
(let ((startpos (copy-marker (point) t))
|
(let ((startpos (copy-marker (point) t))
|
||||||
|
@ -1970,7 +1970,7 @@ if there was no valid completion, else t."
|
|||||||
"Default function to use for `completion-in-region-function'.
|
"Default function to use for `completion-in-region-function'.
|
||||||
Its arguments and return value are as specified for `completion-in-region'.
|
Its arguments and return value are as specified for `completion-in-region'.
|
||||||
This respects the wrapper hook `completion-in-region-functions'."
|
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
|
;; FIXME: Maybe we should use this hook to provide a "display
|
||||||
;; completions" operation as well.
|
;; completions" operation as well.
|
||||||
completion-in-region-functions (start end collection predicate)
|
completion-in-region-functions (start end collection predicate)
|
||||||
|
@ -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',
|
This respects the wrapper hook `filter-buffer-substring-functions',
|
||||||
and the abnormal hook `buffer-substring-filters'.
|
and the abnormal hook `buffer-substring-filters'.
|
||||||
No filtering is done unless a hook says to."
|
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
|
(cond
|
||||||
((or delete buffer-substring-filters)
|
((or delete buffer-substring-filters)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
@ -1546,6 +1546,10 @@ FUN is then called once."
|
|||||||
(declare (indent 2) (debug (form sexp body))
|
(declare (indent 2) (debug (form sexp body))
|
||||||
(obsolete "use a <foo>-function variable modified by `add-function'."
|
(obsolete "use a <foo>-function variable modified by `add-function'."
|
||||||
"24.4"))
|
"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
|
;; We need those two gensyms because CL's lexical scoping is not available
|
||||||
;; for function arguments :-(
|
;; for function arguments :-(
|
||||||
(let ((funs (make-symbol "funs"))
|
(let ((funs (make-symbol "funs"))
|
||||||
|
Loading…
Reference in New Issue
Block a user