/* Minibuffer input and completion.
- Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1986, 1992, 1993 Free Software Foundation, Inc.
This file is part of GNU Emacs.
val = current_buffer->directory;
Fset_buffer (get_minibuffer (minibuf_level));
- current_buffer->directory = val;
- Fmake_local_variable (Qprint_escape_newlines);
- print_escape_newlines = 1;
-#ifdef MULTI_FRAME
- /* If the minibuffer window is on another frame, shift this frame's
- focus to that window, and arrange to put it back later. */
- if (XFRAME (WINDOW_FRAME (XWINDOW (minibuf_window)))
- != selected_frame)
+ /* The current buffer's default directory is usually the right thing
+ for our minibuffer here. However, if you're typing a command at
+ a minibuffer-only frame when minibuf_level is zero, then buf IS
+ the current_buffer, so reset_buffer leaves buf's default
+ directory unchanged. This is a bummer when you've just started
+ up Emacs and buf's default directory is Qnil. Here's a hack; can
+ you think of something better to do? Find another buffer with a
+ better directory, and use that one instead. */
+ if (XTYPE (val) == Lisp_String)
+ current_buffer->directory = val;
+ else
{
- record_unwind_protect (read_minibuf_unwind,
- Fcons (Fselected_frame (),
- FRAME_FOCUS_FRAME (selected_frame)));
+ Lisp_Object buf_list;
+
+ for (buf_list = Vbuffer_alist;
+ CONSP (buf_list);
+ buf_list = XCONS (buf_list)->cdr)
+ {
+ Lisp_Object other_buf = XCONS (XCONS (buf_list)->car)->cdr;
- Fredirect_frame_focus (Fselected_frame (), mini_frame);
+ if (XTYPE (XBUFFER (other_buf)->directory) == Lisp_String)
+ {
+ current_buffer->directory = XBUFFER (other_buf)->directory;
+ break;
+ }
+ }
}
- else
- record_unwind_protect (read_minibuf_unwind, Qnil);
-#else
- record_unwind_protect (read_minibuf_unwind, Qnil);
+
+#ifdef MULTI_FRAME
+ Fredirect_frame_focus (Fselected_frame (), mini_frame);
#endif
+ Fmake_local_variable (Qprint_escape_newlines);
+ print_escape_newlines = 1;
+
+ record_unwind_protect (read_minibuf_unwind, Qnil);
Vminibuf_scroll_window = selected_window;
Fset_window_buffer (minibuf_window, Fcurrent_buffer ());
/* Add the value to the appropriate history list. */
if (XTYPE (Vminibuffer_history_variable) == Lisp_Symbol
- && XSYMBOL (Vminibuffer_history_variable)->value != Qunbound)
+ && ! EQ (XSYMBOL (Vminibuffer_history_variable)->value, Qunbound))
Fset (Vminibuffer_history_variable,
Fcons (val, Fsymbol_value (Vminibuffer_history_variable)));
}
else
reset_buffer (XBUFFER (buf));
+
return buf;
}
= minibuf_save_vector[minibuf_level].history_position;
Vminibuffer_history_variable
= minibuf_save_vector[minibuf_level].history_variable;
-
-#ifdef MULTI_FRAME
- /* Redirect the focus of the frame that called the minibuffer. */
- if (CONSP (data))
- Fredirect_frame_focus (XCONS (data)->car, XCONS (data)->cdr);
-#endif
}
\f
temp_echo_area_glyphs (m)
char *m;
{
- /* It's not very modular to do things this way, but then it seems
- to me that the whole echo_area_glyphs thing is a hack anyway. */
- extern char *previous_echo_glyphs;
-
int osize = ZV;
Lisp_Object oinhibit;
oinhibit = Vinhibit_quit;
- /* Clear out any old echo-area message to make way for our new
- thing. */
- echo_area_glyphs = previous_echo_glyphs = 0;
+ /* Clear out any old echo-area message to make way for our new thing. */
+ message (0);
SET_PT (osize);
insert_string (m);
if (!NILP (Vquit_flag))
{
Vquit_flag = Qnil;
- unread_command_char = Ctl ('g');
+ unread_command_events = Fcons (make_number (Ctl ('g')), Qnil);
}
Vinhibit_quit = oinhibit;
}
if (XTYPE (Vstandard_output) != Lisp_Buffer)
{
Lisp_Object tem;
- tem = Flength (elt, Qt);
+ tem = Flength (elt);
column += XINT (tem);
}
Fprinc (elt, Qnil);