aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris2014-05-26 18:09:45 -0700
committerGlenn Morris2014-05-26 18:09:45 -0700
commite38a5ebe6b225ecb31008cafcbd51d85c2305618 (patch)
tree6454216bb8f7e3cd6249d0ea80b3cc6b2741a95d /lisp
parentcf2f54c4e3d8adb26e3f4b8e9e51364165877444 (diff)
downloademacs-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/ChangeLog5
-rw-r--r--lisp/abbrev.el13
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 @@
12014-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
12014-05-26 Paul Eggert <eggert@cs.ucla.edu> 62014-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.
832Takes no argument and should return the abbrev symbol if expansion took place.") 832Takes 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.
836Effective when explicitly called even when `abbrev-mode' is nil. 836Effective when explicitly called even when `abbrev-mode' is nil.
837Returns the abbrev symbol, if expansion took place. (The actual 837Before doing anything else, runs `pre-abbrev-expand-hook'.
838return value is that of `abbrev-insert'.)" 838Calls `abbrev-expand-function' with no argument to do the work,
839and returns whatever it does. (This should be the abbrev symbol
840if 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'.
847This respects the wrapper hook `abbrev-expand-functions'.
848Calls `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