val = Qnil;
size = 100;
len = 0;
- line = xmalloc (size);
+ line = xmalloc_atomic (size);
while ((c = getchar ()) != '\n')
{
EMACS_INT pos = 0;
/* String to add to the history. */
Lisp_Object histstring;
+ Lisp_Object histval;
Lisp_Object empty_minibuf;
Lisp_Object dummy, frame;
in previous recursive minibuffer, but was not set explicitly
to t for this invocation, so set it to nil in this minibuffer.
Save the old value now, before we change it. */
- specbind (intern ("minibuffer-completing-file-name"), Vminibuffer_completing_file_name);
+ specbind (intern ("minibuffer-completing-file-name"),
+ Vminibuffer_completing_file_name);
if (EQ (Vminibuffer_completing_file_name, Qlambda))
Vminibuffer_completing_file_name = Qnil;
if (!NILP (Vminibuffer_completing_file_name))
Vminibuffer_completing_file_name = Qlambda;
+ /* If variable is unbound, make it nil. */
+ histval = find_symbol_value (Vminibuffer_history_variable);
+ if (EQ (histval, Qunbound))
+ {
+ Fset (Vminibuffer_history_variable, Qnil);
+ histval = Qnil;
+ }
+
if (inherit_input_method)
{
/* `current-input-method' is buffer local. So, remember it in
{
/* If the caller wanted to save the value read on a history list,
then do so if the value is not already the front of the list. */
- Lisp_Object histval;
-
- /* If variable is unbound, make it nil. */
-
- histval = find_symbol_value (Vminibuffer_history_variable);
- if (EQ (histval, Qunbound))
- Fset (Vminibuffer_history_variable, Qnil);
/* The value of the history variable must be a cons or nil. Other
values are unacceptable. We silently ignore these values. */
? list_table : function_table));
ptrdiff_t idx = 0, obsize = 0;
int matchcount = 0;
- ptrdiff_t bindcount = -1;
Lisp_Object bucket, zero, end, tem;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
/* Ignore this element if it fails to match all the regexps. */
{
+ dynwind_begin ();
+ specbind (Qcase_fold_search,
+ completion_ignore_case ? Qt : Qnil);
for (regexps = Vcompletion_regexp_list; CONSP (regexps);
regexps = XCDR (regexps))
{
- if (bindcount < 0) {
- bindcount = SPECPDL_INDEX ();
- specbind (Qcase_fold_search,
- completion_ignore_case ? Qt : Qnil);
- }
tem = Fstring_match (XCAR (regexps), eltstring, zero);
if (NILP (tem))
break;
}
+ dynwind_end ();
if (CONSP (regexps))
continue;
}
tem = Fcommandp (elt, Qnil);
else
{
- if (bindcount >= 0)
- {
- unbind_to (bindcount, Qnil);
- bindcount = -1;
- }
GCPRO4 (tail, string, eltstring, bestmatch);
tem = (type == hash_table
? call2 (predicate, elt,
}
}
- if (bindcount >= 0) {
- unbind_to (bindcount, Qnil);
- bindcount = -1;
- }
-
if (NILP (bestmatch))
return Qnil; /* No completions found. */
/* If we are ignoring case, and there is no exact match,
: VECTORP (collection) ? 2
: NILP (collection) || (CONSP (collection) && !FUNCTIONP (collection));
ptrdiff_t idx = 0, obsize = 0;
- ptrdiff_t bindcount = -1;
Lisp_Object bucket, tem, zero;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
/* Ignore this element if it fails to match all the regexps. */
{
+ dynwind_begin ();
+ specbind (Qcase_fold_search,
+ completion_ignore_case ? Qt : Qnil);
for (regexps = Vcompletion_regexp_list; CONSP (regexps);
regexps = XCDR (regexps))
{
- if (bindcount < 0) {
- bindcount = SPECPDL_INDEX ();
- specbind (Qcase_fold_search,
- completion_ignore_case ? Qt : Qnil);
- }
tem = Fstring_match (XCAR (regexps), eltstring, zero);
if (NILP (tem))
break;
}
+ dynwind_end ();
if (CONSP (regexps))
continue;
}
tem = Fcommandp (elt, Qnil);
else
{
- if (bindcount >= 0) {
- unbind_to (bindcount, Qnil);
- bindcount = -1;
- }
GCPRO4 (tail, eltstring, allmatches, string);
tem = type == 3
? call2 (predicate, elt,
}
}
- if (bindcount >= 0) {
- unbind_to (bindcount, Qnil);
- bindcount = -1;
- }
-
return Fnreverse (allmatches);
}
\f
void
syms_of_minibuf (void)
{
+#include "minibuf.x"
+
minibuf_level = 0;
minibuf_prompt = Qnil;
staticpro (&minibuf_prompt);
This variable only affects history lists that don't specify their own
maximum lengths. Setting the `history-length' property of a history
variable overrides this default. */);
- XSETFASTINT (Vhistory_length, 30);
+ XSETFASTINT (Vhistory_length, 100);
DEFVAR_BOOL ("history-delete-duplicates", history_delete_duplicates,
doc: /* Non-nil means to delete duplicates in history.
/* We use `intern' here instead of Qread_only to avoid
initialization-order problems. */
Vminibuffer_prompt_properties = list2 (intern_c_string ("read-only"), Qt);
-
- defsubr (&Sactive_minibuffer_window);
- defsubr (&Sset_minibuffer_window);
- defsubr (&Sread_from_minibuffer);
- defsubr (&Sread_string);
- defsubr (&Sread_command);
- defsubr (&Sread_variable);
- defsubr (&Sinternal_complete_buffer);
- defsubr (&Sread_buffer);
- defsubr (&Sread_no_blanks_input);
- defsubr (&Sminibuffer_depth);
- defsubr (&Sminibuffer_prompt);
-
- defsubr (&Sminibufferp);
- defsubr (&Sminibuffer_prompt_end);
- defsubr (&Sminibuffer_contents);
- defsubr (&Sminibuffer_contents_no_properties);
- defsubr (&Sminibuffer_completion_contents);
-
- defsubr (&Stry_completion);
- defsubr (&Sall_completions);
- defsubr (&Stest_completion);
- defsubr (&Sassoc_string);
- defsubr (&Scompleting_read);
}