}
}
+/* Helper function to call `read-file-name' from C. */
+
+static Lisp_Object
+read_file_name (Lisp_Object default_filename, Lisp_Object mustmatch,
+ Lisp_Object initial, Lisp_Object predicate)
+{
+ struct gcpro gcpro1;
+ Lisp_Object args[7];
+
+ GCPRO1 (default_filename);
+ args[0] = intern ("read-file-name");
+ args[1] = callint_message;
+ args[2] = Qnil;
+ args[3] = default_filename;
+ args[4] = mustmatch;
+ args[5] = initial;
+ args[6] = predicate;
+ RETURN_UNGCPRO (Ffuncall (7, args));
+}
+
/* BEWARE: Calling this directly from C would defeat the purpose! */
DEFUN ("funcall-interactively", Ffuncall_interactively, Sfuncall_interactively,
1, MANY, 0, doc: /* Like `funcall' but marks the call as interactive.
Lisp_Object teml;
Lisp_Object up_event;
Lisp_Object enable;
- ptrdiff_t speccount = SPECPDL_INDEX ();
+ dynwind_begin ();
/* The index of the next element of this_command_keys to examine for
the 'e' interactive code. */
kset_last_command (current_kboard, save_last_command);
{
- Lisp_Object args[3];
+ Lisp_Object tem0, args[3];
args[0] = Qfuncall_interactively;
args[1] = function;
args[2] = specs;
- return unbind_to (speccount, Fapply (3, args));
+ tem0 = Fapply (3, args);
+ dynwind_end ();
+ return tem0;
}
}
{
visargs[1] = make_string (tem + 1, strcspn (tem + 1, "\n"));
if (strchr (SSDATA (visargs[1]), '%'))
- callint_message = Fformat (i, visargs);
+ callint_message = Fformat (i - 1, visargs + 1);
else
callint_message = visargs[1];
break;
case 'D': /* Directory name. */
- args[i] = Fread_file_name (callint_message, Qnil,
- BVAR (current_buffer, directory), Qlambda, Qnil,
- Qfile_directory_p);
+ args[i] = read_file_name (BVAR (current_buffer, directory), Qlambda, Qnil,
+ Qfile_directory_p);
break;
case 'f': /* Existing file name. */
- args[i] = Fread_file_name (callint_message,
- Qnil, Qnil, Qlambda, Qnil, Qnil);
+ args[i] = read_file_name (Qnil, Qlambda, Qnil, Qnil);
break;
case 'F': /* Possibly nonexistent file name. */
- args[i] = Fread_file_name (callint_message,
- Qnil, Qnil, Qnil, Qnil, Qnil);
+ args[i] = read_file_name (Qnil, Qnil, Qnil, Qnil);
break;
case 'G': /* Possibly nonexistent file name,
default to directory alone. */
- args[i] = Fread_file_name (callint_message,
- Qnil, Qnil, Qnil, empty_unibyte_string, Qnil);
+ args[i] = read_file_name (Qnil, Qnil, empty_unibyte_string, Qnil);
break;
case 'i': /* Ignore an argument -- Does not do I/O. */
case 'k': /* Key sequence. */
{
- ptrdiff_t speccount1 = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qcursor_in_echo_area, Qt);
/* Prompt in `minibuffer-prompt' face. */
Fput_text_property (make_number (0),
Qface, Qminibuffer_prompt, callint_message);
args[i] = Fread_key_sequence (callint_message,
Qnil, Qnil, Qnil, Qnil);
- unbind_to (speccount1, Qnil);
+ dynwind_end ();
teml = args[i];
visargs[i] = Fkey_description (teml, Qnil);
case 'K': /* Key sequence to be defined. */
{
- ptrdiff_t speccount1 = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (Qcursor_in_echo_area, Qt);
/* Prompt in `minibuffer-prompt' face. */
Fput_text_property (make_number (0),
Qnil, Qt, Qnil, Qnil);
teml = args[i];
visargs[i] = Fkey_description (teml, Qnil);
- unbind_to (speccount1, Qnil);
+ dynwind_end ();
/* If the key sequence ends with a down-event,
discard the following up-event. */
if (tem) tem++;
else tem = "";
}
- unbind_to (speccount, Qnil);
+ dynwind_end ();
QUIT;
{
Lisp_Object val = Ffuncall (nargs, args);
UNGCPRO;
- return unbind_to (speccount, val);
+ dynwind_end ();
+ return val;
}
}
void
syms_of_callint (void)
{
+#include "callint.x"
+
point_marker = Fmake_marker ();
staticpro (&point_marker);
Its purpose is to give temporary modes such as Isearch mode
a way to turn themselves off when a mouse command switches windows. */);
Vmouse_leave_buffer_hook = Qnil;
-
- defsubr (&Sinteractive);
- defsubr (&Scall_interactively);
- defsubr (&Sfuncall_interactively);
- defsubr (&Sprefix_numeric_value);
}