diff options
author | Richard M. Stallman <rms@gnu.org> | 1995-08-16 15:00:57 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1995-08-16 15:00:57 +0000 |
commit | 2718dfa4b84b569a7f03e42f257d984bd473fea6 (patch) | |
tree | 59145d046e73250d3629436e9a3e76f477a72585 /src/cmds.c | |
parent | 14a9bcda679613b9fb83521f7755c5315596e04d (diff) | |
download | emacs-2718dfa4b84b569a7f03e42f257d984bd473fea6.tar.gz |
(Fself_insert_command): Optimize the case with arg > 2
to avoid running change hooks lots of times.
Diffstat (limited to 'src/cmds.c')
-rw-r--r-- | src/cmds.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/cmds.c b/src/cmds.c index 48e89b2cabe..2a912368cb0 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -221,6 +221,18 @@ Whichever character you type to run this command is inserted.") /* Barf if the key that invoked this was not a character. */ if (!INTEGERP (last_command_char)) bitch_at_user (); + else if (XINT (arg) >= 2 && NILP (current_buffer->overwrite_mode)) + { + XSETFASTINT (arg, XFASTINT (arg) - 2); + /* The first one might want to expand an abbrev. */ + internal_self_insert (XINT (last_command_char), 1); + /* The bulk of the copies of this char can be inserted simply. + We don't have to handle a user-specified face specially + because it will get inherited from the first char inserted. */ + Finsert_char (last_command_char, arg, Qt); + /* The last one might want to auto-fill. */ + internal_self_insert (XINT (last_command_char), 0); + } else while (XINT (arg) > 0) { @@ -313,7 +325,8 @@ internal_self_insert (c1, noautofill) #endif synt = SYNTAX (c); if ((synt == Sclose || synt == Smath) - && !NILP (Vblink_paren_function) && INTERACTIVE) + && !NILP (Vblink_paren_function) && INTERACTIVE + && !noautofill) { call0 (Vblink_paren_function); hairy = 2; |