diff options
author | Richard M. Stallman <rms@gnu.org> | 1991-12-17 03:36:07 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1991-12-17 03:36:07 +0000 |
commit | bfa9c977447d5f51134f7bd967bcf13aebd66b05 (patch) | |
tree | e3322ac899ec1328bd14b821173d911e42dc9578 /src/abbrev.c | |
parent | c0f93c869aa077aea6a15f747d3a691d4244e7f5 (diff) | |
download | emacs-bfa9c977447d5f51134f7bd967bcf13aebd66b05.tar.gz |
*** empty log message ***
Diffstat (limited to 'src/abbrev.c')
-rw-r--r-- | src/abbrev.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/abbrev.c b/src/abbrev.c index e3f1faf36ee..74c0e80010a 100644 --- a/src/abbrev.c +++ b/src/abbrev.c @@ -75,6 +75,9 @@ Lisp_Object Vlast_abbrev_text; int last_abbrev_point; +/* Hook to run before expanding any abbrev. */ + +Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook; DEFUN ("make-abbrev-table", Fmake_abbrev_table, Smake_abbrev_table, 0, 0, 0, "Create a new, empty abbrev table object.") @@ -218,6 +221,9 @@ Returns t if expansion took place.") register Lisp_Object sym; Lisp_Object expansion, hook, tem; + if (!NULL (Vrun_hooks)) + call1 (Vrun_hooks, Qpre_abbrev_expand_hook); + if (XBUFFER (Vabbrev_start_location_buffer) != current_buffer) Vabbrev_start_location = Qnil; if (!NULL (Vabbrev_start_location)) @@ -532,6 +538,14 @@ This causes `save-some-buffers' to offer to save the abbrevs."); "*Set non-nil means expand multi-word abbrevs all caps if abbrev was so."); abbrev_all_caps = 0; + DEFVAR_LISP ("pre-abbrev-expand-hook", &Vpre_abbrev_expand_hook, + "Function or functions to be called before abbrev expansion is done.\n\ +This is the first thing that `expand-abbrev' does, and so this may change\n\ +the current abbrev table before abbrev lookup happens."); + Vpre_abbrev_expand_hook = Qnil; + Qpre_abbrev_expand_hook = intern ("pre-abbrev-expand-hook"); + staticpro (&Qpre_abbrev_expand_hook); + defsubr (&Smake_abbrev_table); defsubr (&Sclear_abbrev_table); defsubr (&Sdefine_abbrev); |