extern Lisp_Object Voverriding_local_map;
\f
+/* Put minibuf on currently selected frame's minibuffer.
+ We do this whenever the user starts a new minibuffer
+ or when a minibuffer exits. */
+
+void
+choose_minibuf_frame ()
+{
+ if (selected_frame != 0
+ && !EQ (minibuf_window, selected_frame->minibuffer_window))
+ {
+#if defined(MSDOS) && !defined(HAVE_X_WINDOWS)
+ selected_frame->minibuffer_window = minibuf_window;
+#else
+ /* I don't think that any frames may validly have a null minibuffer
+ window anymore. */
+ if (NILP (selected_frame->minibuffer_window))
+ abort ();
+
+ Fset_window_buffer (selected_frame->minibuffer_window,
+ XWINDOW (minibuf_window)->buffer);
+ minibuf_window = selected_frame->minibuffer_window;
+#endif
+ }
+}
+\f
/* Actual minibuffer invocation. */
void read_minibuf_unwind ();
}
/* Make minibuffer contents into a string */
- val = make_buffer_string (1, Z);
+ val = make_buffer_string (1, Z, 1);
+#if 0 /* make_buffer_string should handle the gap. */
bcopy (GAP_END_ADDR, XSTRING (val)->data + GPT - BEG, Z - GPT);
+#endif
/* VAL is the string of minibuffer text. */
last_minibuf_string = val;
so run the hook. */
if (!NILP (Vminibuffer_exit_hook) && !EQ (Vminibuffer_exit_hook, Qunbound)
&& !NILP (Vrun_hooks))
- call1 (Vrun_hooks, Qminibuffer_exit_hook);
+ safe_run_hooks (Qminibuffer_exit_hook);
/* Erase the minibuffer we were using at this level. */
Fset_buffer (XWINDOW (minibuf_window)->buffer);
char *m;
{
int osize = ZV;
+ int opoint = PT;
Lisp_Object oinhibit;
oinhibit = Vinhibit_quit;
SET_PT (osize);
insert_string (m);
- SET_PT (osize);
+ SET_PT (opoint);
Vinhibit_quit = Qt;
Fsit_for (make_number (2), Qnil, Qnil);
- del_range (PT, ZV);
+ del_range (osize, ZV);
+ SET_PT (opoint);
if (!NILP (Vquit_flag))
{
Vquit_flag = Qnil;
(completions)
Lisp_Object completions;
{
- register Lisp_Object tail, elt;
+ Lisp_Object tail, elt;
register int i;
int column = 0;
- struct gcpro gcpro1;
+ struct gcpro gcpro1, gcpro2;
struct buffer *old = current_buffer;
int first = 1;
/* Note that (when it matters) every variable
- points to a non-string that is pointed to by COMPLETIONS. */
- GCPRO1 (completions);
+ points to a non-string that is pointed to by COMPLETIONS,
+ except for ELT. ELT can be pointing to a string
+ when terpri or Findent_to calls a change hook. */
+ elt = Qnil;
+ GCPRO2 (completions, elt);
if (BUFFERP (Vstandard_output))
set_buffer_internal (XBUFFER (Vstandard_output));
{
Lisp_Object tem;
int length;
+ Lisp_Object startpos, endpos;
elt = Fcar (tail);
/* Compute the length of this element. */
Sadly, the window it will appear in is not known
until after the text has been made. */
+ if (BUFFERP (Vstandard_output))
+ XSETINT (startpos, BUF_PT (XBUFFER (Vstandard_output)));
+
/* If the previous completion was very wide,
or we have two on this line already,
don't put another on the same line. */
if (BUFFERP (Vstandard_output))
{
tem = Findent_to (make_number (35), make_number (2));
+
column = XINT (tem);
}
else
}
}
+ if (BUFFERP (Vstandard_output))
+ {
+ XSETINT (endpos, BUF_PT (XBUFFER (Vstandard_output)));
+ Fset_text_properties (startpos, endpos,
+ Qnil, Vstandard_output);
+ }
+
/* Output this element and update COLUMN. */
if (CONSP (elt))
{
DEFVAR_LISP ("minibuffer-history-variable", &Vminibuffer_history_variable,
"History list symbol to add minibuffer values to.\n\
-Each minibuffer output is added with\n\
+Each string of minibuffer input, as it appears on exit from the minibuffer,\n\
+is added with\n\
(set minibuffer-history-variable\n\
(cons STRING (symbol-value minibuffer-history-variable)))");
XSETFASTINT (Vminibuffer_history_variable, 0);