aboutsummaryrefslogtreecommitdiffstats
path: root/src/minibuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/minibuf.c')
-rw-r--r--src/minibuf.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/minibuf.c b/src/minibuf.c
index 1bbe276776e..d4128ce01c1 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -20,7 +20,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21#include <config.h> 21#include <config.h>
22#include <errno.h> 22#include <errno.h>
23#include <stdio.h>
24 23
25#include <binary-io.h> 24#include <binary-io.h>
26 25
@@ -31,6 +30,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
31#include "frame.h" 30#include "frame.h"
32#include "window.h" 31#include "window.h"
33#include "keymap.h" 32#include "keymap.h"
33#include "sysstdio.h"
34#include "systty.h" 34#include "systty.h"
35 35
36/* List of buffers for use as minibuffers. 36/* List of buffers for use as minibuffers.
@@ -209,15 +209,15 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
209 suppress_echo_on_tty (STDIN_FILENO); 209 suppress_echo_on_tty (STDIN_FILENO);
210 } 210 }
211 211
212 fwrite (SDATA (prompt), 1, SBYTES (prompt), stdout); 212 fwrite_unlocked (SDATA (prompt), 1, SBYTES (prompt), stdout);
213 fflush (stdout); 213 fflush_unlocked (stdout);
214 214
215 val = Qnil; 215 val = Qnil;
216 size = 100; 216 size = 100;
217 len = 0; 217 len = 0;
218 line = xmalloc (size); 218 line = xmalloc (size);
219 219
220 while ((c = getchar ()) != '\n' && c != '\r') 220 while ((c = getchar_unlocked ()) != '\n' && c != '\r')
221 { 221 {
222 if (c == EOF) 222 if (c == EOF)
223 { 223 {
@@ -874,6 +874,30 @@ read_minibuf_unwind (void)
874 if (minibuf_level == 0) 874 if (minibuf_level == 0)
875 resize_mini_window (XWINDOW (window), 0); 875 resize_mini_window (XWINDOW (window), 0);
876 876
877 /* Deal with frames that should be removed when exiting the
878 minibuffer. */
879 {
880 Lisp_Object frames, frame1, val;
881 struct frame *f1;
882
883 FOR_EACH_FRAME (frames, frame1)
884 {
885 f1 = XFRAME (frame1);
886
887 if ((FRAME_PARENT_FRAME (f1)
888 || !NILP (get_frame_param (f1, Qdelete_before)))
889 && !NILP (val = (get_frame_param (f1, Qminibuffer_exit))))
890 {
891 if (EQ (val, Qiconify_frame))
892 Ficonify_frame (frame1);
893 else if (EQ (val, Qdelete_frame))
894 Fdelete_frame (frame1, Qnil);
895 else
896 Fmake_frame_invisible (frame1, Qnil);
897 }
898 }
899 }
900
877 /* In case the previous minibuffer displayed in this miniwindow is 901 /* In case the previous minibuffer displayed in this miniwindow is
878 dead, we may keep displaying this buffer (tho it's inactive), so reset it, 902 dead, we may keep displaying this buffer (tho it's inactive), so reset it,
879 to make sure we don't leave around bindings and stuff which only 903 to make sure we don't leave around bindings and stuff which only
@@ -1930,6 +1954,8 @@ syms_of_minibuf (void)
1930 DEFSYM (Qactivate_input_method, "activate-input-method"); 1954 DEFSYM (Qactivate_input_method, "activate-input-method");
1931 DEFSYM (Qcase_fold_search, "case-fold-search"); 1955 DEFSYM (Qcase_fold_search, "case-fold-search");
1932 DEFSYM (Qmetadata, "metadata"); 1956 DEFSYM (Qmetadata, "metadata");
1957 /* A frame parameter. */
1958 DEFSYM (Qminibuffer_exit, "minibuffer-exit");
1933 1959
1934 DEFVAR_LISP ("read-expression-history", Vread_expression_history, 1960 DEFVAR_LISP ("read-expression-history", Vread_expression_history,
1935 doc: /* A history list for arguments that are Lisp expressions to evaluate. 1961 doc: /* A history list for arguments that are Lisp expressions to evaluate.