From 9fc9988d4d08028fb37c588f5e0483ac85b713d3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 26 Sep 2016 19:02:01 +0300 Subject: Improve documentation of 'expand-abbrev' and wrapper hooks * lisp/simple.el (filter-buffer-substring-functions) (buffer-substring--filter): Add a link to 'with-wrapper-hook' as the place to look for documentation of wrapper hooks. * lisp/minibuffer.el (completion-in-region-functions) (completion--in-region): Add a link to 'with-wrapper-hook' as the place to look for documentation of wrapper hooks. * lisp/abbrev.el (expand-abbrev, abbrev--default-expand): Clarify the doc strings. (Bug#24540) * doc/lispref/text.texi (Buffer Contents): Mention 'with-wrapper-hook's doc string as the place to learn about that obsolete facility. --- lisp/abbrev.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lisp/abbrev.el') diff --git a/lisp/abbrev.el b/lisp/abbrev.el index d181d97703e..8c4f6eb01b2 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -837,16 +837,17 @@ Takes no argument and should return the abbrev symbol if expansion took place.") "Expand the abbrev before point, if there is an abbrev there. Effective when explicitly called even when `abbrev-mode' is nil. Before doing anything else, runs `pre-abbrev-expand-hook'. -Calls `abbrev-expand-function' with no argument to do the work, -and returns whatever it does. (This should be the abbrev symbol -if expansion occurred, else nil.)" +Calls the value of `abbrev-expand-function' with no argument to do +the work, and returns whatever it does. (That return value should +be the abbrev symbol if expansion occurred, else nil.)" (interactive) (run-hooks 'pre-abbrev-expand-hook) (funcall abbrev-expand-function)) (defun abbrev--default-expand () "Default function to use for `abbrev-expand-function'. -This respects the wrapper hook `abbrev-expand-functions'. +This also respects the obsolete wrapper hook `abbrev-expand-functions'. +\(See `with-wrapper-hook' for details about wrapper hooks.) Calls `abbrev-insert' to insert any expansion, and returns what it does." (with-wrapper-hook abbrev-expand-functions () (pcase-let ((`(,sym ,name ,wordstart ,wordend) (abbrev--before-point))) -- cgit v1.2.3