/* Call a Lisp function interactively.
- Copyright (C) 1985-1986, 1993-1995, 1997, 2000-2011
+ Copyright (C) 1985-1986, 1993-1995, 1997, 2000-2012
Free Software Foundation, Inc.
This file is part of GNU Emacs.
C -- Command name: symbol with interactive function definition.
d -- Value of point as number. Does not do I/O.
D -- Directory name.
-e -- Parametrized event (i.e., one that's a list) that invoked this command.
+e -- Parameterized event (i.e., one that's a list) that invoked this command.
If used more than once, the Nth `e' returns the Nth parameterized event.
This skips events that are integers or symbols.
f -- Existing file name.
Lisp_Object teml;
Lisp_Object up_event;
Lisp_Object enable;
- int speccount = SPECPDL_INDEX ();
+ ptrdiff_t speccount = SPECPDL_INDEX ();
/* The index of the next element of this_command_keys to examine for
the 'e' interactive code. */
- int next_event;
+ ptrdiff_t next_event;
Lisp_Object prefix_arg;
char *string;
ptrdiff_t i, nargs;
int foo;
- char prompt1[100];
- char *tem1;
int arg_from_tty = 0;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
- int key_count;
+ ptrdiff_t key_count;
int record_then_fail = 0;
Lisp_Object save_this_command, save_last_command;
tem = string;
for (i = 1; *tem; i++)
{
- strncpy (prompt1, tem + 1, sizeof prompt1 - 1);
- prompt1[sizeof prompt1 - 1] = 0;
- tem1 = strchr (prompt1, '\n');
- if (tem1) *tem1 = 0;
-
- visargs[0] = build_string (prompt1);
- if (strchr (prompt1, '%'))
+ visargs[0] = make_string (tem + 1, strcspn (tem + 1, "\n"));
+ if (strchr (SSDATA (visargs[0]), '%'))
callint_message = Fformat (i, visargs);
else
callint_message = visargs[0];
message1_nolog ((char *) 0);
/* Passing args[i] directly stimulates compiler bug */
teml = args[i];
+ /* See bug#8479. */
+ if (! CHARACTERP (teml)) error ("Non-character input-event");
visargs[i] = Fchar_to_string (teml);
break;
case 'k': /* Key sequence. */
{
- int speccount1 = SPECPDL_INDEX ();
+ ptrdiff_t speccount1 = SPECPDL_INDEX ();
specbind (Qcursor_in_echo_area, Qt);
/* Prompt in `minibuffer-prompt' face. */
Fput_text_property (make_number (0),
case 'K': /* Key sequence to be defined. */
{
- int speccount1 = SPECPDL_INDEX ();
+ ptrdiff_t speccount1 = SPECPDL_INDEX ();
specbind (Qcursor_in_echo_area, Qt);
/* Prompt in `minibuffer-prompt' face. */
Fput_text_property (make_number (0),