changeset 16748:64f315c0e3f4

(internal_self_insert): If the abbrev has no expansion, just a hook, inhibit the insertion of the character.
author Richard M. Stallman <rms@gnu.org>
date Thu, 26 Dec 1996 20:54:22 +0000
parents 126a42ee62ac
children c85f62b1b749
files src/cmds.c
diffstat 1 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/cmds.c	Thu Dec 26 20:53:54 1996 +0000
+++ b/src/cmds.c	Thu Dec 26 20:54:22 1996 +0000
@@ -320,10 +320,20 @@
       && 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;
     }