suppress_echo_on_tty (fileno (stdin));
}
- fprintf (stdout, "%s", SDATA (prompt));
+ fwrite (SDATA (prompt), 1, SBYTES (prompt), stdout);
fflush (stdout);
val = Qnil;
Lisp_Object dummy, frame;
specbind (Qminibuffer_default, defalt);
- specbind (intern ("inhibit-read-only"), Qnil);
+ specbind (Qinhibit_read_only, Qnil);
/* If Vminibuffer_completing_file_name is `lambda' on entry, it was t
in previous recursive minibuffer, but was not set explicitly
if ((noninteractive
/* In case we are running as a daemon, only do this before
detaching from the terminal. */
- || (IS_DAEMON && (daemon_pipe[1] >= 0)))
+ || (IS_DAEMON && DAEMON_RUNNING))
&& NILP (Vexecuting_kbd_macro))
{
val = read_minibuf_noninteractive (map, initial, prompt,
return Fintern (name, Qnil);
}
-DEFUN ("read-buffer", Fread_buffer, Sread_buffer, 1, 3, 0,
+DEFUN ("read-buffer", Fread_buffer, Sread_buffer, 1, 4, 0,
doc: /* Read the name of a buffer and return as a string.
Prompt with PROMPT.
Optional second arg DEF is value to return if user enters an empty line.
If `read-buffer-completion-ignore-case' is non-nil, completion ignores
case while reading the buffer name.
If `read-buffer-function' is non-nil, this works by calling it as a
-function, instead of the usual behavior. */)
- (Lisp_Object prompt, Lisp_Object def, Lisp_Object require_match)
+function, instead of the usual behavior.
+Optional arg PREDICATE if non-nil is a function limiting the buffers that can
+be considered. */)
+ (Lisp_Object prompt, Lisp_Object def, Lisp_Object require_match,
+ Lisp_Object predicate)
{
Lisp_Object result;
char *s;
}
AUTO_STRING (format, "%s (default %s): ");
- prompt = Fformat (3, ((Lisp_Object [])
- {format, prompt,
- CONSP (def) ? XCAR (def) : def}));
+ prompt = CALLN (Fformat, format, prompt,
+ CONSP (def) ? XCAR (def) : def);
}
result = Fcompleting_read (prompt, intern ("internal-complete-buffer"),
- Qnil, require_match, Qnil,
+ predicate, require_match, Qnil,
Qbuffer_name_history, def, Qnil);
}
else
- result = Ffuncall (4, ((Lisp_Object [])
- { Vread_buffer_function, prompt, def, require_match }));
+ result = (NILP (predicate)
+ /* Partial backward compatibility for older read_buffer_functions
+ which don't expect a `predicate' argument. */
+ ? call3 (Vread_buffer_function, prompt, def, require_match)
+ : call4 (Vread_buffer_function, prompt, def, require_match,
+ predicate));
return unbind_to (count, result);
}
\f
See also `completing-read-function'. */)
(Lisp_Object prompt, Lisp_Object collection, Lisp_Object predicate, Lisp_Object require_match, Lisp_Object initial_input, Lisp_Object hist, Lisp_Object def, Lisp_Object inherit_input_method)
{
- Lisp_Object args[9];
- args[0] = Fsymbol_value (intern ("completing-read-function"));
- args[1] = prompt;
- args[2] = collection;
- args[3] = predicate;
- args[4] = require_match;
- args[5] = initial_input;
- args[6] = hist;
- args[7] = def;
- args[8] = inherit_input_method;
- return Ffuncall (9, args);
+ return CALLN (Ffuncall,
+ Fsymbol_value (intern ("completing-read-function")),
+ prompt, collection, predicate, require_match, initial_input,
+ hist, def, inherit_input_method);
}
\f
/* Test whether TXT is an exact completion. */
staticpro (&minibuf_save_list);
DEFSYM (Qcompletion_ignore_case, "completion-ignore-case");
- DEFSYM (Qread_file_name_internal, "read-file-name-internal");
DEFSYM (Qminibuffer_default, "minibuffer-default");
Fset (Qminibuffer_default, Qnil);
DEFSYM (Qminibuffer_completion_table, "minibuffer-completion-table");
- DEFSYM (Qminibuffer_completion_confirm, "minibuffer-completion-confirm");
- DEFSYM (Qminibuffer_completion_predicate, "minibuffer-completion-predicate");
staticpro (&last_minibuf_string);
last_minibuf_string = Qnil;
For example, `eval-expression' uses this. */);
Vread_expression_history = Qnil;
- DEFSYM (Qread_expression_history, "read-expression-history");
-
DEFVAR_LISP ("read-buffer-function", Vread_buffer_function,
doc: /* If this is non-nil, `read-buffer' does its work by calling this function.
The function is called with the arguments passed to `read-buffer'. */);
doc: /* Text properties that are added to minibuffer prompts.
These are in addition to the basic `field' property, and stickiness
properties. */);
- /* We use `intern' here instead of Qread_only to avoid
- initialization-order problems. */
- Vminibuffer_prompt_properties = list2 (intern_c_string ("read-only"), Qt);
+ Vminibuffer_prompt_properties = list2 (Qread_only, Qt);
DEFVAR_LISP ("read-hide-char", Vread_hide_char,
doc: /* Whether to hide input characters in noninteractive mode.