# HG changeset patch # User Richard M. Stallman # Date 692940967 0 # Node ID 8f18e7e890081fa00148e168586ab3772c6646f3 # Parent e442bb58975117244c77c143a5b60a3d8306422d *** empty log message *** diff -r e442bb589751 -r 8f18e7e89008 src/abbrev.c --- a/src/abbrev.c Fri Dec 13 18:50:18 1991 +0000 +++ b/src/abbrev.c Tue Dec 17 03:36:07 1991 +0000 @@ -75,6 +75,9 @@ 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 @@ 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 @@ "*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);