/* Call a Lisp function interactively.
- Copyright (C) 1985, 86, 93, 94, 95, 1997, 2000, 2002
+ Copyright (C) 1985, 86, 93, 94, 95, 1997, 2000, 02, 03, 2004
Free Software Foundation, Inc.
This file is part of GNU Emacs.
Lisp_Object Vcommand_history;
extern Lisp_Object Vhistory_length;
+extern Lisp_Object Vthis_original_command, real_this_command;
Lisp_Object Vcommand_debug_status, Qcommand_debug_status;
Lisp_Object Qenable_recursive_minibuffers;
Lisp_Object intail, valtail;
for (intail = Fcdr (input), valtail = values;
CONSP (valtail);
- intail = Fcdr (intail), valtail = Fcdr (valtail))
+ intail = Fcdr (intail), valtail = XCDR (valtail))
{
Lisp_Object elt;
elt = Fcar (intail);
means unconditionally put this command in the command-history.
Otherwise, this is done only if an arg is read using the minibuffer.
Optional third arg KEYS, if given, specifies the sequence of events to
-supply if the command inquires which events were used to invoke it. */)
+supply if the command inquires which events were used to invoke it.
+If KEYS is omitted or nil, the return value of `this-command-keys' is used. */)
(function, record_flag, keys)
Lisp_Object function, record_flag, keys;
{
int key_count;
int record_then_fail = 0;
+ Lisp_Object save_this_command, save_last_command;
+ Lisp_Object save_this_original_command, save_real_this_command;
+
+ save_this_command = Vthis_command;
+ save_this_original_command = Vthis_original_command;
+ save_real_this_command = real_this_command;
+ save_last_command = current_kboard->Vlast_command;
+
if (NILP (keys))
keys = this_command_keys, key_count = this_command_key_count;
else
goto lose;
specs = XVECTOR (fun)->contents[COMPILED_INTERACTIVE];
}
- else if (!CONSP (fun))
- goto lose;
- else if (funcar = XCAR (fun), EQ (funcar, Qautoload))
+ else
{
+ Lisp_Object form;
GCPRO2 (function, prefix_arg);
- do_autoload (fun, function);
+ form = Finteractive_form (function);
UNGCPRO;
- goto retry;
- }
- else if (EQ (funcar, Qlambda))
- {
- specs = Fassq (Qinteractive, Fcdr (XCDR (fun)));
- if (NILP (specs))
+ if (CONSP (form))
+ specs = filter_specs = Fcar (XCDR (form));
+ else
goto lose;
- filter_specs = Fnth (make_number (1), specs);
- specs = Fcar (Fcdr (specs));
}
- else
- goto lose;
/* If either SPECS or STRING is set to a string, use it. */
if (STRINGP (specs))
if (i != num_input_events || !NILP (record_flag))
{
/* We should record this command on the command history. */
- Lisp_Object values, car;
+ Lisp_Object values;
/* Make a copy of the list of values, for the command history,
and turn them into things we can eval. */
values = quotify_args (Fcopy_sequence (specs));
XSETCDR (teml, Qnil);
}
}
+
+ Vthis_command = save_this_command;
+ Vthis_original_command = save_this_original_command;
+ real_this_command= save_real_this_command;
+ current_kboard->Vlast_command = save_last_command;
+
single_kboard_state ();
return apply1 (function, specs);
}
if (!NILP (Vmouse_leave_buffer_hook))
call1 (Vrun_hooks, Qmouse_leave_buffer_hook);
- Fselect_window (event);
+ Fselect_window (event, Qnil);
}
string++;
}
Qnil, Qnil, Qnil, Qnil);
unbind_to (speccount1, Qnil);
teml = args[i];
- visargs[i] = Fkey_description (teml);
+ visargs[i] = Fkey_description (teml, Qnil);
/* If the key sequence ends with a down-event,
discard the following up-event. */
args[i] = Fread_key_sequence (build_string (callint_message),
Qnil, Qt, Qnil, Qnil);
teml = args[i];
- visargs[i] = Fkey_description (teml);
+ visargs[i] = Fkey_description (teml, Qnil);
unbind_to (speccount1, Qnil);
/* If the key sequence ends with a down-event,
if (record_then_fail)
Fbarf_if_buffer_read_only ();
+ Vthis_command = save_this_command;
+ Vthis_original_command = save_this_original_command;
+ real_this_command= save_real_this_command;
+ current_kboard->Vlast_command = save_last_command;
+
single_kboard_state ();
{
defsubr (&Scall_interactively);
defsubr (&Sprefix_numeric_value);
}
+
+/* arch-tag: a3a7cad7-bcac-42ce-916e-1bd2546ebf37
+ (do not change this comment) */