aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1991-12-17 03:36:07 +0000
committerRichard M. Stallman1991-12-17 03:36:07 +0000
commitdbd7a9698cfa912f32b463c000642522c38081ab (patch)
tree6c0ca70881b838e6a94890cfdaadfacda7113db2 /src
parent9b71f02b8a03ec8b8d0f5e4053a76e8f71920a57 (diff)
downloademacs-dbd7a9698cfa912f32b463c000642522c38081ab.tar.gz
emacs-dbd7a9698cfa912f32b463c000642522c38081ab.zip
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/abbrev.c14
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;
75 75
76int last_abbrev_point; 76int last_abbrev_point;
77 77
78/* Hook to run before expanding any abbrev. */
79
80Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook;
78 81
79DEFUN ("make-abbrev-table", Fmake_abbrev_table, Smake_abbrev_table, 0, 0, 0, 82DEFUN ("make-abbrev-table", Fmake_abbrev_table, Smake_abbrev_table, 0, 0, 0,
80 "Create a new, empty abbrev table object.") 83 "Create a new, empty abbrev table object.")
@@ -218,6 +221,9 @@ Returns t if expansion took place.")
218 register Lisp_Object sym; 221 register Lisp_Object sym;
219 Lisp_Object expansion, hook, tem; 222 Lisp_Object expansion, hook, tem;
220 223
224 if (!NULL (Vrun_hooks))
225 call1 (Vrun_hooks, Qpre_abbrev_expand_hook);
226
221 if (XBUFFER (Vabbrev_start_location_buffer) != current_buffer) 227 if (XBUFFER (Vabbrev_start_location_buffer) != current_buffer)
222 Vabbrev_start_location = Qnil; 228 Vabbrev_start_location = Qnil;
223 if (!NULL (Vabbrev_start_location)) 229 if (!NULL (Vabbrev_start_location))
@@ -532,6 +538,14 @@ This causes `save-some-buffers' to offer to save the abbrevs.");
532 "*Set non-nil means expand multi-word abbrevs all caps if abbrev was so."); 538 "*Set non-nil means expand multi-word abbrevs all caps if abbrev was so.");
533 abbrev_all_caps = 0; 539 abbrev_all_caps = 0;
534 540
541 DEFVAR_LISP ("pre-abbrev-expand-hook", &Vpre_abbrev_expand_hook,
542 "Function or functions to be called before abbrev expansion is done.\n\
543This is the first thing that `expand-abbrev' does, and so this may change\n\
544the current abbrev table before abbrev lookup happens.");
545 Vpre_abbrev_expand_hook = Qnil;
546 Qpre_abbrev_expand_hook = intern ("pre-abbrev-expand-hook");
547 staticpro (&Qpre_abbrev_expand_hook);
548
535 defsubr (&Smake_abbrev_table); 549 defsubr (&Smake_abbrev_table);
536 defsubr (&Sclear_abbrev_table); 550 defsubr (&Sclear_abbrev_table);
537 defsubr (&Sdefine_abbrev); 551 defsubr (&Sdefine_abbrev);