diff options
| author | Gerd Moellmann | 1999-12-30 12:26:53 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-12-30 12:26:53 +0000 |
| commit | 79d2af9c26e04a6094c593eb03262d3cb9f4c0e5 (patch) | |
| tree | 74c2cfedf6b2f3e34db8255a636205a64f7d0c57 /src | |
| parent | 345839e3eca33ab5a56a7e9e089532940144c371 (diff) | |
| download | emacs-79d2af9c26e04a6094c593eb03262d3cb9f4c0e5.tar.gz emacs-79d2af9c26e04a6094c593eb03262d3cb9f4c0e5.zip | |
(Fexpand_abbrev): If expanding an abbrev which has only
a hook, and the hook has a non-nil `no-self-insert' property, let
the return value of the hook specify whether an expansion took
place. If it returns nil, no expansion has been performed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/abbrev.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/abbrev.c b/src/abbrev.c index e3ee9e039b2..f5586f5c4d7 100644 --- a/src/abbrev.c +++ b/src/abbrev.c | |||
| @@ -364,7 +364,20 @@ Returns the abbrev symbol, if expansion took place.") | |||
| 364 | 364 | ||
| 365 | hook = XSYMBOL (sym)->function; | 365 | hook = XSYMBOL (sym)->function; |
| 366 | if (!NILP (hook)) | 366 | if (!NILP (hook)) |
| 367 | call0 (hook); | 367 | { |
| 368 | Lisp_Object expanded, prop; | ||
| 369 | |||
| 370 | /* If expanding an abbrev which has only a hook, and the hook | ||
| 371 | has a non-nil `no-self-insert' property, let the return value | ||
| 372 | of the hook specify whether an expansion took place. If it | ||
| 373 | returns nil, no expansion has been done. */ | ||
| 374 | expanded = call0 (hook); | ||
| 375 | if (SYMBOLP (hook) | ||
| 376 | && NILP (expanded) | ||
| 377 | && (prop = Fget (hook, intern ("no-self-insert")), | ||
| 378 | !NILP (prop))) | ||
| 379 | value = Qnil; | ||
| 380 | } | ||
| 368 | 381 | ||
| 369 | return value; | 382 | return value; |
| 370 | } | 383 | } |