diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-12-26 20:54:22 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-12-26 20:54:22 +0000 |
commit | 8a51c7a941434a73e16ce247eda4a873c308b531 (patch) | |
tree | 309e0e424b7102959dcef6bcddc723e5f6857efb /src/cmds.c | |
parent | 2f58e6f001845487eee053602fa95386cbb5116b (diff) | |
download | emacs-8a51c7a941434a73e16ce247eda4a873c308b531.tar.gz |
(internal_self_insert): If the abbrev has no expansion,
just a hook, inhibit the insertion of the character.
Diffstat (limited to 'src/cmds.c')
-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) && PT > BEGV && SYNTAX (FETCH_CHAR (PT - 1)) == Sword) { int modiff = MODIFF; - Fexpand_abbrev (); - /* We can't trust the value of Fexpand_abbrev, - but if Fexpand_abbrev changed the buffer, - assume it expanded something. */ + Lisp_Object sym; + + sym = Fexpand_abbrev (); + + /* If we expanded an abbrev which has only a hook, + return right away--don't really self-insert. */ + if (! NILP (sym) && ! NILP (XSYMBOL (sym)->function)) + { + Lisp_Object prop; + prop = Fget (sym, intern ("no-self-insert")); + if (! NILP (prop)) + return Qnil; + } + if (MODIFF != modiff) hairy = 2; } |