diff options
author | Glenn Morris <rgm@gnu.org> | 2014-05-26 18:09:45 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2014-05-26 18:09:45 -0700 |
commit | e38a5ebe6b225ecb31008cafcbd51d85c2305618 (patch) | |
tree | 6454216bb8f7e3cd6249d0ea80b3cc6b2741a95d /lisp/abbrev.el | |
parent | cf2f54c4e3d8adb26e3f4b8e9e51364165877444 (diff) | |
download | emacs-e38a5ebe6b225ecb31008cafcbd51d85c2305618.tar.gz |
Doc updates re abbrev-expand-function
* doc/emacs/abbrevs.texi (Expanding Abbrevs): Update re abbrev-expand-function.
* doc/lispref/abbrevs.texi (Abbrev Expansion): Update for expand-abbrev changes.
* doc/lispref/functions.texi (Advising Functions): Standardize menu case.
* lisp/abbrev.el (abbrev-expand-functions, abbrev-expand-function)
(expand-abbrev, abbrev--default-expand): Doc fixes.
Diffstat (limited to 'lisp/abbrev.el')
-rw-r--r-- | lisp/abbrev.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 43b6a5583ee..9e11adadfc0 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -824,23 +824,28 @@ see `define-abbrev' for details." value)) (defvar abbrev-expand-functions nil - "Wrapper hook around `expand-abbrev'.") + "Wrapper hook around `abbrev--default-expand'.") (make-obsolete-variable 'abbrev-expand-functions 'abbrev-expand-function "24.4") (defvar abbrev-expand-function #'abbrev--default-expand - "Function to perform abbrev expansion. + "Function that `expand-abbrev' uses to perform abbrev expansion. Takes no argument and should return the abbrev symbol if expansion took place.") (defun expand-abbrev () "Expand the abbrev before point, if there is an abbrev there. Effective when explicitly called even when `abbrev-mode' is nil. -Returns the abbrev symbol, if expansion took place. (The actual -return value is that of `abbrev-insert'.)" +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.)" (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'. +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))) (when sym |