/* Minibuffer input and completion.
-Copyright (C) 1985-1986, 1993-2013 Free Software Foundation, Inc.
+Copyright (C) 1985-1986, 1993-2014 Free Software Foundation, Inc.
This file is part of GNU Emacs.
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
bset_directory (current_buffer, ambient_dir);
else
{
- Lisp_Object buf_list;
-
- for (buf_list = Vbuffer_alist;
- CONSP (buf_list);
- buf_list = XCDR (buf_list))
- {
- Lisp_Object other_buf;
+ Lisp_Object tail, buf;
- other_buf = XCDR (XCAR (buf_list));
- if (STRINGP (BVAR (XBUFFER (other_buf), directory)))
- {
- bset_directory (current_buffer,
- BVAR (XBUFFER (other_buf), directory));
- break;
- }
- }
+ FOR_EACH_LIVE_BUFFER (tail, buf)
+ if (STRINGP (BVAR (XBUFFER (buf), directory)))
+ {
+ bset_directory (current_buffer,
+ BVAR (XBUFFER (buf), directory));
+ break;
+ }
}
if (!EQ (mini_frame, selected_frame))
XWINDOW (minibuf_window)->cursor.x = 0;
XWINDOW (minibuf_window)->must_be_updated_p = 1;
update_frame (XFRAME (selected_frame), 1, 1);
- {
- struct frame *f = XFRAME (XWINDOW (minibuf_window)->frame);
- struct redisplay_interface *rif = FRAME_RIF (f);
- if (rif && rif->flush_display)
- rif->flush_display (f);
- }
+ flush_frame (XFRAME (XWINDOW (minibuf_window)->frame));
}
/* Make minibuffer contents into a string. */
{
/* 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. */
if (minibuf_level == 0)
resize_mini_window (XWINDOW (window), 0);
- /* Make sure minibuffer window is erased, not ignored. */
- windows_or_buffers_changed++;
- XWINDOW (window)->last_modified = 0;
- 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
DEFUN ("read-string", Fread_string, Sread_string, 1, 5, 0,
doc: /* Read a string from the minibuffer, prompting with string PROMPT.
If non-nil, second arg INITIAL-INPUT is a string to insert before reading.
- This argument has been superseded by DEFAULT-VALUE and should normally
- be nil in new code. It behaves as in `read-from-minibuffer'. See the
- documentation string of that function for details.
+ This argument has been superseded by DEFAULT-VALUE and should normally be nil
+ in new code. It behaves as INITIAL-CONTENTS in `read-from-minibuffer' (which
+ see).
The third arg HISTORY, if non-nil, specifies a history list
and optionally the initial position in the list.
See `read-from-minibuffer' for details of HISTORY argument.
type = (HASH_TABLE_P (collection) ? hash_table
: VECTORP (collection) ? obarray_table
: ((NILP (collection)
- || (CONSP (collection)
- && (!SYMBOLP (XCAR (collection))
- || NILP (XCAR (collection)))))
+ || (CONSP (collection) && !FUNCTIONP (collection)))
? list_table : function_table));
ptrdiff_t idx = 0, obsize = 0;
int matchcount = 0;
Lisp_Object allmatches;
int type = HASH_TABLE_P (collection) ? 3
: VECTORP (collection) ? 2
- : NILP (collection) || (CONSP (collection)
- && (!SYMBOLP (XCAR (collection))
- || NILP (XCAR (collection))));
+ : NILP (collection) || (CONSP (collection) && !FUNCTIONP (collection));
ptrdiff_t idx = 0, obsize = 0;
ptrdiff_t bindcount = -1;
Lisp_Object bucket, tem, zero;
CHECK_STRING (string);
- if ((CONSP (collection)
- && (!SYMBOLP (XCAR (collection)) || NILP (XCAR (collection))))
- || NILP (collection))
+ if (NILP (collection) || (CONSP (collection) && !FUNCTIONP (collection)))
{
tem = Fassoc_string (string, collection, completion_ignore_case ? Qt : Qnil);
if (NILP (tem))