]> code.delx.au - gnu-emacs/blobdiff - src/minibuf.c
(Fdocumentation, Fdocumentation_property, Fsubstitute_command_keys):
[gnu-emacs] / src / minibuf.c
index 27855e169909992c0d0c698834735c47fdc48a9d..c2a11a1d62a35cec7d955d5142d6f82b84465088 100644 (file)
@@ -102,6 +102,31 @@ extern Lisp_Object Vminibuf_scroll_window;
 
 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 ();
@@ -273,8 +298,10 @@ read_minibuf (map, initial, prompt, backup_n, expflag, histvar, histpos)
     }
 
   /* 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;
@@ -1062,7 +1089,7 @@ temp_echo_area_glyphs (m)
   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))
     {
@@ -1772,7 +1799,8 @@ t means to return a list of all possible completions of STRING.\n\
 
   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);