Mercurial > emacs
comparison src/abbrev.c @ 56523:588fc06a48ae
(Fexpand_abbrev): Run Qpre_abbrev_expand_hook
only when a real abbrev is present.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 24 Jul 2004 21:37:11 +0000 |
parents | 5407da499273 |
children | c35c8a6e6baa c08afac24467 |
comparison
equal
deleted
inserted
replaced
56522:6ed4179ba08b | 56523:588fc06a48ae |
---|---|
245 Lisp_Object expansion, hook, tem; | 245 Lisp_Object expansion, hook, tem; |
246 Lisp_Object value; | 246 Lisp_Object value; |
247 int multibyte = ! NILP (current_buffer->enable_multibyte_characters); | 247 int multibyte = ! NILP (current_buffer->enable_multibyte_characters); |
248 | 248 |
249 value = Qnil; | 249 value = Qnil; |
250 | |
251 Frun_hooks (1, &Qpre_abbrev_expand_hook); | |
252 | 250 |
253 wordstart = 0; | 251 wordstart = 0; |
254 if (!(BUFFERP (Vabbrev_start_location_buffer) | 252 if (!(BUFFERP (Vabbrev_start_location_buffer) |
255 && XBUFFER (Vabbrev_start_location_buffer) == current_buffer)) | 253 && XBUFFER (Vabbrev_start_location_buffer) == current_buffer)) |
256 Vabbrev_start_location = Qnil; | 254 Vabbrev_start_location = Qnil; |
323 if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym))) | 321 if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym))) |
324 sym = oblookup (Vglobal_abbrev_table, buffer, | 322 sym = oblookup (Vglobal_abbrev_table, buffer, |
325 wordend - wordstart, p - buffer); | 323 wordend - wordstart, p - buffer); |
326 if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym))) | 324 if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym))) |
327 return value; | 325 return value; |
326 | |
327 Frun_hooks (1, &Qpre_abbrev_expand_hook); | |
328 | 328 |
329 if (INTERACTIVE && !EQ (minibuf_window, selected_window)) | 329 if (INTERACTIVE && !EQ (minibuf_window, selected_window)) |
330 { | 330 { |
331 /* Add an undo boundary, in case we are doing this for | 331 /* Add an undo boundary, in case we are doing this for |
332 a self-inserting command which has avoided making one so far. */ | 332 a self-inserting command which has avoided making one so far. */ |