diff options
| author | Glenn Morris | 2014-05-26 18:09:45 -0700 |
|---|---|---|
| committer | Glenn Morris | 2014-05-26 18:09:45 -0700 |
| commit | e38a5ebe6b225ecb31008cafcbd51d85c2305618 (patch) | |
| tree | 6454216bb8f7e3cd6249d0ea80b3cc6b2741a95d /lisp | |
| parent | cf2f54c4e3d8adb26e3f4b8e9e51364165877444 (diff) | |
| download | emacs-e38a5ebe6b225ecb31008cafcbd51d85c2305618.tar.gz emacs-e38a5ebe6b225ecb31008cafcbd51d85c2305618.zip | |
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')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/abbrev.el | 13 |
2 files changed, 14 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9d1e62baf8a..60b684fd8ad 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-05-27 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * abbrev.el (abbrev-expand-functions, abbrev-expand-function) | ||
| 4 | (expand-abbrev, abbrev--default-expand): Doc fixes. | ||
| 5 | |||
| 1 | 2014-05-26 Paul Eggert <eggert@cs.ucla.edu> | 6 | 2014-05-26 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 7 | ||
| 3 | Include sources used to create macuvs.h. | 8 | Include sources used to create macuvs.h. |
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." | |||
| 824 | value)) | 824 | value)) |
| 825 | 825 | ||
| 826 | (defvar abbrev-expand-functions nil | 826 | (defvar abbrev-expand-functions nil |
| 827 | "Wrapper hook around `expand-abbrev'.") | 827 | "Wrapper hook around `abbrev--default-expand'.") |
| 828 | (make-obsolete-variable 'abbrev-expand-functions 'abbrev-expand-function "24.4") | 828 | (make-obsolete-variable 'abbrev-expand-functions 'abbrev-expand-function "24.4") |
| 829 | 829 | ||
| 830 | (defvar abbrev-expand-function #'abbrev--default-expand | 830 | (defvar abbrev-expand-function #'abbrev--default-expand |
| 831 | "Function to perform abbrev expansion. | 831 | "Function that `expand-abbrev' uses to perform abbrev expansion. |
| 832 | Takes no argument and should return the abbrev symbol if expansion took place.") | 832 | Takes no argument and should return the abbrev symbol if expansion took place.") |
| 833 | 833 | ||
| 834 | (defun expand-abbrev () | 834 | (defun expand-abbrev () |
| 835 | "Expand the abbrev before point, if there is an abbrev there. | 835 | "Expand the abbrev before point, if there is an abbrev there. |
| 836 | Effective when explicitly called even when `abbrev-mode' is nil. | 836 | Effective when explicitly called even when `abbrev-mode' is nil. |
| 837 | Returns the abbrev symbol, if expansion took place. (The actual | 837 | Before doing anything else, runs `pre-abbrev-expand-hook'. |
| 838 | return value is that of `abbrev-insert'.)" | 838 | Calls `abbrev-expand-function' with no argument to do the work, |
| 839 | and returns whatever it does. (This should be the abbrev symbol | ||
| 840 | if expansion occurred, else nil.)" | ||
| 839 | (interactive) | 841 | (interactive) |
| 840 | (run-hooks 'pre-abbrev-expand-hook) | 842 | (run-hooks 'pre-abbrev-expand-hook) |
| 841 | (funcall abbrev-expand-function)) | 843 | (funcall abbrev-expand-function)) |
| 842 | 844 | ||
| 843 | (defun abbrev--default-expand () | 845 | (defun abbrev--default-expand () |
| 846 | "Default function to use for `abbrev-expand-function'. | ||
| 847 | This respects the wrapper hook `abbrev-expand-functions'. | ||
| 848 | Calls `abbrev-insert' to insert any expansion, and returns what it does." | ||
| 844 | (with-wrapper-hook abbrev-expand-functions () | 849 | (with-wrapper-hook abbrev-expand-functions () |
| 845 | (pcase-let ((`(,sym ,name ,wordstart ,wordend) (abbrev--before-point))) | 850 | (pcase-let ((`(,sym ,name ,wordstart ,wordend) (abbrev--before-point))) |
| 846 | (when sym | 851 | (when sym |