/* Nonzero means display completion help for invalid input. */
-int auto_help;
+Lisp_Object Vcompletion_auto_help;
/* The maximum length of a minibuffer history. */
fprintf (stdout, "%s", XSTRING (prompt)->data);
fflush (stdout);
+ val = Qnil;
size = 100;
len = 0;
line = (char *) xmalloc (size * sizeof *line);
&& !NILP (Vrun_hooks))
call1 (Vrun_hooks, Qminibuffer_setup_hook);
+ /* Don't allow the user to undo past this point. */
+ current_buffer->undo_list = Qnil;
+
recursive_edit_1 ();
/* If cursor is on the minibuffer line,
if (NILP (keymap))
keymap = Vminibuffer_local_map;
else
- keymap = get_keymap (keymap);
+ keymap = get_keymap (keymap, 1, 0);
if (SYMBOLP (hist))
{
{
Lisp_Object bestmatch, tail, elt, eltstring;
/* Size in bytes of BESTMATCH. */
- int bestmatchsize;
+ int bestmatchsize = 0;
/* These are in bytes, too. */
int compare, matchsize;
int list = CONSP (alist) || NILP (alist);
- int index, obsize;
+ int index = 0, obsize = 0;
int matchcount = 0;
Lisp_Object bucket, zero, end, tem;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
if (!list && !VECTORP (alist))
return call3 (alist, string, predicate, Qnil);
- bestmatch = Qnil;
+ bestmatch = bucket = Qnil;
/* If ALIST is not a list, set TAIL just for gc pro. */
tail = alist;
Lisp_Object tail, elt, eltstring;
Lisp_Object allmatches;
int list = CONSP (alist) || NILP (alist);
- int index, obsize;
+ int index = 0, obsize = 0;
Lisp_Object bucket, tem;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
{
return call3 (alist, string, predicate, Qt);
}
- allmatches = Qnil;
+ allmatches = bucket = Qnil;
/* If ALIST is not a list, set TAIL just for gc pro. */
tail = alist;
tem = Fcompare_strings (completion, Qnil, Qnil, string, Qnil, Qnil, Qt);
completedp = !EQ (tem, Qt);
- tem = Fstring_equal (completion, string);
- if (NILP (tem))
+ tem = Fcompare_strings (completion, Qnil, Qnil, string, Qnil, Qnil, Qnil);
+ if (!EQ (tem, Qt))
/* Rewrite the user's input. */
{
Fdelete_field (make_number (ZV)); /* Some completion happened */
UNGCPRO;
if (completedp)
return 5;
- else if (auto_help)
+ else if (!NILP (Vcompletion_auto_help))
Fminibuffer_completion_help ();
else
temp_echo_area_glyphs (" [Next char not unique]");
struct buffer *obuf = current_buffer;
Fset_buffer (XWINDOW (window)->buffer);
- tem = Fpos_visible_in_window_p (make_number (ZV), window);
+ tem = Fpos_visible_in_window_p (make_number (ZV), window, Qnil);
if (! NILP (tem))
/* If end is in view, scroll up to the beginning. */
Fset_window_start (window, make_number (BEGV), Qnil);
return Qnil;
}
exit:
- Fthrow (Qexit, Qnil);
+ return Fthrow (Qexit, Qnil);
/* NOTREACHED */
}
if (i == ZV - prompt_end_charpos)
{
- if (auto_help)
+ if (!NILP (Vcompletion_auto_help))
Fminibuffer_completion_help ();
return Qnil;
}
int length;
Lisp_Object startpos, endpos;
+ startpos = Qnil;
+
elt = Fcar (tail);
/* Compute the length of this element. */
if (CONSP (elt))
else
bitch_at_user ();
- Fthrow (Qexit, Qnil);
+ return Fthrow (Qexit, Qnil);
}
DEFUN ("exit-minibuffer", Fexit_minibuffer, Sexit_minibuffer, 0, 0, "",
"Terminate this minibuffer argument.")
()
{
- Fthrow (Qexit, Qnil);
+ return Fthrow (Qexit, Qnil);
}
DEFUN ("minibuffer-depth", Fminibuffer_depth, Sminibuffer_depth, 0, 0, 0,
property of a history variable overrides this default.");
XSETFASTINT (Vhistory_length, 30);
- DEFVAR_BOOL ("completion-auto-help", &auto_help,
+ DEFVAR_LISP ("completion-auto-help", &Vcompletion_auto_help,
"*Non-nil means automatically provide help for invalid completion input.");
- auto_help = 1;
+ Vcompletion_auto_help = Qt;
DEFVAR_BOOL ("completion-ignore-case", &completion_ignore_case,
"Non-nil means don't consider case significant in completion.");