]> git.eshelyaron.com Git - emacs.git/commitdiff
(internal_self_insert): If the abbrev has no expansion,
authorRichard M. Stallman <rms@gnu.org>
Thu, 26 Dec 1996 20:54:22 +0000 (20:54 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 26 Dec 1996 20:54:22 +0000 (20:54 +0000)
just a hook, inhibit the insertion of the character.

src/cmds.c

index 8ca407a2abda72f8ffbeaea56aa34878d145e319..2e6464bf0cedd28d03d7298feee199b702afdb2b 100644 (file)
@@ -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;
     }