diff options
| author | Richard M. Stallman | 1996-12-26 20:54:22 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-12-26 20:54:22 +0000 |
| commit | e57640c004967183938e399399f3b3f13a6d99b0 (patch) | |
| tree | 128a64742603f19e58694c9a32c5ffe22f54be1b /src | |
| parent | f530ce274828aed540d41dd423fd91e6bd8e1019 (diff) | |
| download | emacs-e57640c004967183938e399399f3b3f13a6d99b0.tar.gz emacs-e57640c004967183938e399399f3b3f13a6d99b0.zip | |
(internal_self_insert): If the abbrev has no expansion,
just a hook, inhibit the insertion of the character.
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmds.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/cmds.c b/src/cmds.c index 8ca407a2abd..2e6464bf0ce 100644 --- a/src/cmds.c +++ b/src/cmds.c | |||
| @@ -320,10 +320,20 @@ internal_self_insert (c1, noautofill) | |||
| 320 | && PT > BEGV && SYNTAX (FETCH_CHAR (PT - 1)) == Sword) | 320 | && PT > BEGV && SYNTAX (FETCH_CHAR (PT - 1)) == Sword) |
| 321 | { | 321 | { |
| 322 | int modiff = MODIFF; | 322 | int modiff = MODIFF; |
| 323 | Fexpand_abbrev (); | 323 | Lisp_Object sym; |
| 324 | /* We can't trust the value of Fexpand_abbrev, | 324 | |
| 325 | but if Fexpand_abbrev changed the buffer, | 325 | sym = Fexpand_abbrev (); |
| 326 | assume it expanded something. */ | 326 | |
| 327 | /* If we expanded an abbrev which has only a hook, | ||
| 328 | return right away--don't really self-insert. */ | ||
| 329 | if (! NILP (sym) && ! NILP (XSYMBOL (sym)->function)) | ||
| 330 | { | ||
| 331 | Lisp_Object prop; | ||
| 332 | prop = Fget (sym, intern ("no-self-insert")); | ||
| 333 | if (! NILP (prop)) | ||
| 334 | return Qnil; | ||
| 335 | } | ||
| 336 | |||
| 327 | if (MODIFF != modiff) | 337 | if (MODIFF != modiff) |
| 328 | hairy = 2; | 338 | hairy = 2; |
| 329 | } | 339 | } |