}
\f
-/* Actual minibuffer invocation. */
+/* Actual minibuffer invocation. */
static Lisp_Object read_minibuf_unwind (Lisp_Object);
static Lisp_Object run_exit_minibuf_hook (Lisp_Object);
error ("Error reading from stdin");
}
- /* If Lisp form desired instead of string, parse it. */
+ /* If Lisp form desired instead of string, parse it. */
if (expflag)
val = string_to_object (val, CONSP (defalt) ? XCAR (defalt) : defalt);
}
}
- /* If Lisp form desired instead of string, parse it. */
+ /* If Lisp form desired instead of string, parse it. */
if (expflag)
val = string_to_object (val, defalt);
/* Return a buffer to be used as the minibuffer at depth `depth'.
depth = 0 is the lowest allowed argument, and that is the value
- used for nonrecursive minibuffer invocations */
+ used for nonrecursive minibuffer invocations. */
Lisp_Object
get_minibuffer (int depth)
reset_buffer (XBUFFER (buf));
record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
Fset_buffer (buf);
- Fkill_all_local_variables ();
+ if (!NILP (Ffboundp (intern ("minibuffer-inactive-mode"))))
+ call0 (intern ("minibuffer-inactive-mode"));
+ else
+ Fkill_all_local_variables ();
unbind_to (count, Qnil);
}
}
/* This function is called on exiting minibuffer, whether normally or
- not, and it restores the current window, buffer, etc. */
+ not, and it restores the current window, buffer, etc. */
static Lisp_Object
read_minibuf_unwind (Lisp_Object data)
windows_or_buffers_changed++;
XSETFASTINT (XWINDOW (window)->last_modified, 0);
XSETFASTINT (XWINDOW (window)->last_overlay_modified, 0);
+
+ /* In case the previous minibuffer displayed in this miniwindow is
+ dead, we may keep displaying this buffer (tho it's inactive), so reset it,
+ to make sure we don't leave around bindings and stuff which only
+ made sense during the read_minibuf invocation. */
+ call0 (intern ("minibuffer-inactive-mode"));
return Qnil;
}
\f
Qnil);
}
-/* Functions that use the minibuffer to read various things. */
+/* Functions that use the minibuffer to read various things. */
DEFUN ("read-string", Fread_string, Sread_string, 1, 5, 0,
doc: /* Read a string from the minibuffer, prompting with string PROMPT.
args[1] = prompt;
args[2] = def;
args[3] = require_match;
- result = Ffuncall(4, args);
+ result = Ffuncall (4, args);
}
return unbind_to (count, result);
}
while (1)
{
- /* Get the next element of the alist, obarray, or hash-table. */
- /* Exit the loop if the elements are all used up. */
+ /* Get the next element of the alist, obarray, or hash-table. */
+ /* Exit the loop if the elements are all used up. */
/* elt gets the alist element or symbol.
- eltstring gets the name to check as a completion. */
+ eltstring gets the name to check as a completion. */
if (type == list_table)
{
elt = eltstring = HASH_KEY (XHASH_TABLE (collection), idx++);
}
- /* Is this element a possible completion? */
+ /* Is this element a possible completion? */
if (SYMBOLP (eltstring))
eltstring = Fsymbol_name (eltstring);
completion_ignore_case ? Qt : Qnil),
EQ (Qt, tem)))
{
- /* Yes. */
+ /* Yes. */
Lisp_Object regexps;
/* Ignore this element if it fails to match all the regexps. */
}
/* Ignore this element if there is a predicate
- and the predicate doesn't like it. */
+ and the predicate doesn't like it. */
if (!NILP (predicate))
{
}
if (NILP (bestmatch))
- return Qnil; /* No completions found */
+ return Qnil; /* No completions found. */
/* If we are ignoring case, and there is no exact match,
and no additional text was supplied,
don't change the case of what the user typed. */
return Qt;
XSETFASTINT (zero, 0); /* Else extract the part in which */
- XSETFASTINT (end, bestmatchsize); /* all completions agree */
+ XSETFASTINT (end, bestmatchsize); /* all completions agree. */
return Fsubstring (bestmatch, zero, end);
}
\f
while (1)
{
- /* Get the next element of the alist, obarray, or hash-table. */
- /* Exit the loop if the elements are all used up. */
+ /* Get the next element of the alist, obarray, or hash-table. */
+ /* Exit the loop if the elements are all used up. */
/* elt gets the alist element or symbol.
- eltstring gets the name to check as a completion. */
+ eltstring gets the name to check as a completion. */
if (type == 1)
{
elt = eltstring = HASH_KEY (XHASH_TABLE (collection), idx++);
}
- /* Is this element a possible completion? */
+ /* Is this element a possible completion? */
if (SYMBOLP (eltstring))
eltstring = Fsymbol_name (eltstring);
completion_ignore_case ? Qt : Qnil),
EQ (Qt, tem)))
{
- /* Yes. */
+ /* Yes. */
Lisp_Object regexps;
/* Ignore this element if it fails to match all the regexps. */
}
/* Ignore this element if there is a predicate
- and the predicate doesn't like it. */
+ and the predicate doesn't like it. */
if (!NILP (predicate))
{
}
if (NILP (tem)) continue;
}
- /* Ok => put it on the list. */
+ /* Ok => put it on the list. */
allmatches = Fcons (eltstring, allmatches);
}
}
if (SYMBOLP (tail))
while (1)
{
- if (EQ((Fcompare_strings (string, make_number (0), Qnil,
+ if (EQ (Fcompare_strings (string, make_number (0), Qnil,
Fsymbol_name (tail),
- make_number (0) , Qnil, Qt)),
+ make_number (0) , Qnil, Qt),
Qt))
{
tem = tail;
tem = HASH_KEY (h, i);
else
for (i = 0; i < HASH_TABLE_SIZE (h); ++i)
- if (!NILP (HASH_HASH (h, i)) &&
- EQ (Fcompare_strings (string, make_number (0), Qnil,
- HASH_KEY (h, i), make_number (0) , Qnil,
- completion_ignore_case ? Qt : Qnil),
- Qt))
+ if (!NILP (HASH_HASH (h, i))
+ && EQ (Fcompare_strings (string, make_number (0), Qnil,
+ HASH_KEY (h, i), make_number (0) , Qnil,
+ completion_ignore_case ? Qt : Qnil),
+ Qt))
{
tem = HASH_KEY (h, i);
break;
`all-completions', otherwise invoke `test-completion'.
The arguments STRING and PREDICATE are as in `try-completion',
-`all-completions', and `test-completion'. */)
+`all-completions', and `test-completion'. */)
(Lisp_Object string, Lisp_Object predicate, Lisp_Object flag)
{
if (NILP (flag))