summaryrefslogtreecommitdiff
path: root/lisp/abbrev.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2016-09-26 19:02:01 +0300
committerEli Zaretskii <eliz@gnu.org>2016-09-26 19:02:01 +0300
commit9fc9988d4d08028fb37c588f5e0483ac85b713d3 (patch)
tree6d2ba61c39f4eda81a3233b3ce847b3c00eabbc1 /lisp/abbrev.el
parentc14a1d4580b831bb1c62f273a11cee90d6ee283e (diff)
downloademacs-9fc9988d4d08028fb37c588f5e0483ac85b713d3.tar.gz
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.
Diffstat (limited to 'lisp/abbrev.el')
-rw-r--r--lisp/abbrev.el9
1 files changed, 5 insertions, 4 deletions
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)))