# HG changeset patch # User Richard M. Stallman # Date 714207625 0 # Node ID 22f807391becf555be70ba8e132b6436c82a735f # Parent 7c2565dd644cac0095ae031ee014812894b23d1f (Fexpand_abbrev): If pre-expand hook changes the buffer, assume that means we "did an expansion". diff -r 7c2565dd644c -r 22f807391bec src/abbrev.c --- a/src/abbrev.c Wed Aug 19 06:51:44 1992 +0000 +++ b/src/abbrev.c Wed Aug 19 07:00:25 1992 +0000 @@ -219,9 +219,14 @@ int uccount = 0, lccount = 0; register Lisp_Object sym; Lisp_Object expansion, hook, tem; + int oldmodiff = MODIFF; + Lisp_Object value; if (!NILP (Vrun_hooks)) call1 (Vrun_hooks, Qpre_abbrev_expand_hook); + /* If the hook changes the buffer, treat that as + having "done an expansion". */ + value = (MODIFF != oldmodiff ? Qt : Qnil); if (XBUFFER (Vabbrev_start_location_buffer) != current_buffer) Vabbrev_start_location = Qnil; @@ -238,17 +243,17 @@ wordstart = scan_words (point, -1); if (!wordstart) - return Qnil; + return value; wordend = scan_words (wordstart, 1); if (!wordend) - return Qnil; + return value; if (wordend > point) wordend = point; whitecnt = point - wordend; if (wordend <= wordstart) - return Qnil; + return value; p = buffer = (char *) alloca (wordend - wordstart); @@ -269,7 +274,7 @@ if (XTYPE (sym) == Lisp_Int || NILP (XSYMBOL (sym)->value)) sym = oblookup (Vglobal_abbrev_table, buffer, p - buffer); if (XTYPE (sym) == Lisp_Int || NILP (XSYMBOL (sym)->value)) - return Qnil; + return value; if (INTERACTIVE && !EQ (minibuf_window, selected_window)) {