aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2018-11-17 10:47:48 -0500
committerStefan Monnier2018-11-17 10:47:48 -0500
commit81f0e05a02013bd1c9ea177e234561348b108578 (patch)
tree43ac15d6ceadb08f6ea63c9799ed26e23699060f /src
parent644a308b4e1513e04be9360e1586e14b32ec0159 (diff)
downloademacs-81f0e05a02013bd1c9ea177e234561348b108578.tar.gz
emacs-81f0e05a02013bd1c9ea177e234561348b108578.zip
* src/cmds.c (Fself_insert_command): Get last-command-event via (new) arg.
Diffstat (limited to 'src')
-rw-r--r--src/cmds.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/cmds.c b/src/cmds.c
index 1616efbb446..f6803f460a8 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -260,11 +260,10 @@ because it respects values of `delete-active-region' and `overwrite-mode'. */)
260 return Qnil; 260 return Qnil;
261} 261}
262 262
263/* Note that there's code in command_loop_1 which typically avoids 263DEFUN ("self-insert-command", Fself_insert_command, Sself_insert_command, 1, 2,
264 calling this. */ 264 "(list (prefix-numeric-value current-prefix-arg) last-command-event)",
265DEFUN ("self-insert-command", Fself_insert_command, Sself_insert_command, 1, 1, "p",
266 doc: /* Insert the character you type. 265 doc: /* Insert the character you type.
267Whichever character you type to run this command is inserted. 266Whichever character C you type to run this command is inserted.
268The numeric prefix argument N says how many times to repeat the insertion. 267The numeric prefix argument N says how many times to repeat the insertion.
269Before insertion, `expand-abbrev' is executed if the inserted character does 268Before insertion, `expand-abbrev' is executed if the inserted character does
270not have word syntax and the previous character in the buffer does. 269not have word syntax and the previous character in the buffer does.
@@ -272,10 +271,14 @@ After insertion, `internal-auto-fill' is called if
272`auto-fill-function' is non-nil and if the `auto-fill-chars' table has 271`auto-fill-function' is non-nil and if the `auto-fill-chars' table has
273a non-nil value for the inserted character. At the end, it runs 272a non-nil value for the inserted character. At the end, it runs
274`post-self-insert-hook'. */) 273`post-self-insert-hook'. */)
275 (Lisp_Object n) 274 (Lisp_Object n, Lisp_Object c)
276{ 275{
277 CHECK_FIXNUM (n); 276 CHECK_FIXNUM (n);
278 277
278 /* Backward compatibility. */
279 if (NILP (c))
280 c = last_command_event;
281
279 if (XFIXNUM (n) < 0) 282 if (XFIXNUM (n) < 0)
280 error ("Negative repetition argument %"pI"d", XFIXNUM (n)); 283 error ("Negative repetition argument %"pI"d", XFIXNUM (n));
281 284
@@ -283,11 +286,11 @@ a non-nil value for the inserted character. At the end, it runs
283 call0 (Qundo_auto_amalgamate); 286 call0 (Qundo_auto_amalgamate);
284 287
285 /* Barf if the key that invoked this was not a character. */ 288 /* Barf if the key that invoked this was not a character. */
286 if (!CHARACTERP (last_command_event)) 289 if (!CHARACTERP (c))
287 bitch_at_user (); 290 bitch_at_user ();
288 else { 291 else {
289 int character = translate_char (Vtranslation_table_for_input, 292 int character = translate_char (Vtranslation_table_for_input,
290 XFIXNUM (last_command_event)); 293 XFIXNUM (c));
291 int val = internal_self_insert (character, XFIXNAT (n)); 294 int val = internal_self_insert (character, XFIXNAT (n));
292 if (val == 2) 295 if (val == 2)
293 Fset (Qundo_auto__this_command_amalgamating, Qnil); 296 Fset (Qundo_auto__this_command_amalgamating, Qnil);