comparison src/frame.c @ 440:8de8e3f6228a r21-2-28

Import from CVS: tag r21-2-28
author cvs
date Mon, 13 Aug 2007 11:33:38 +0200
parents 84b14dcb0985
children abe6d1db359e
comparison
equal deleted inserted replaced
439:357dd071b03c 440:8de8e3f6228a
224 buf = Fcurrent_buffer (); 224 buf = Fcurrent_buffer ();
225 /* If buf is a 'hidden' buffer (i.e. one whose name starts with 225 /* If buf is a 'hidden' buffer (i.e. one whose name starts with
226 a space), try to find another one. */ 226 a space), try to find another one. */
227 if (string_char (XSTRING (Fbuffer_name (buf)), 0) == ' ') 227 if (string_char (XSTRING (Fbuffer_name (buf)), 0) == ' ')
228 buf = Fother_buffer (buf, Qnil, Qnil); 228 buf = Fother_buffer (buf, Qnil, Qnil);
229 Fset_window_buffer (root_window, buf); 229 Fset_window_buffer (root_window, buf, Qnil);
230 } 230 }
231 231
232 return f; 232 return f;
233 } 233 }
234 234
247 XWINDOW (mini_window)->frame = frame; 247 XWINDOW (mini_window)->frame = frame;
248 f->minibuffer_window = mini_window; 248 f->minibuffer_window = mini_window;
249 f->has_minibuffer = 1; 249 f->has_minibuffer = 1;
250 250
251 XWINDOW (mini_window)->buffer = Qt; 251 XWINDOW (mini_window)->buffer = Qt;
252 Fset_window_buffer (mini_window, Vminibuffer_zero); 252 Fset_window_buffer (mini_window, Vminibuffer_zero, Qt);
253 } 253 }
254 254
255 /* Make a frame using a separate minibuffer window on another frame. 255 /* Make a frame using a separate minibuffer window on another frame.
256 MINI_WINDOW is the minibuffer window to use. nil means use the 256 MINI_WINDOW is the minibuffer window to use. nil means use the
257 default-minibuffer-frame. */ 257 default-minibuffer-frame. */
284 mini_window = XFRAME (con->default_minibuffer_frame)->minibuffer_window; 284 mini_window = XFRAME (con->default_minibuffer_frame)->minibuffer_window;
285 } 285 }
286 286
287 /* Install the chosen minibuffer window, with proper buffer. */ 287 /* Install the chosen minibuffer window, with proper buffer. */
288 store_minibuf_frame_prop (f, mini_window); 288 store_minibuf_frame_prop (f, mini_window);
289 Fset_window_buffer (mini_window, Vminibuffer_zero); 289 Fset_window_buffer (mini_window, Vminibuffer_zero, Qt);
290 } 290 }
291 291
292 /* Make a frame containing only a minibuffer window. */ 292 /* Make a frame containing only a minibuffer window. */
293 293
294 static void 294 static void
314 XWINDOW (mini_window)->prev = Qnil; 314 XWINDOW (mini_window)->prev = Qnil;
315 XWINDOW (mini_window)->frame = frame; 315 XWINDOW (mini_window)->frame = frame;
316 316
317 /* Put the proper buffer in that window. */ 317 /* Put the proper buffer in that window. */
318 318
319 Fset_window_buffer (mini_window, Vminibuffer_zero); 319 Fset_window_buffer (mini_window, Vminibuffer_zero, Qt);
320 } 320 }
321 321
322 static Lisp_Object 322 static Lisp_Object
323 make_sure_its_a_fresh_plist (Lisp_Object foolist) 323 make_sure_its_a_fresh_plist (Lisp_Object foolist)
324 { 324 {
1320 device = FRAME_DEVICE (f); 1320 device = FRAME_DEVICE (f);
1321 d = XDEVICE (device); 1321 d = XDEVICE (device);
1322 console = DEVICE_CONSOLE (d); 1322 console = DEVICE_CONSOLE (d);
1323 con = XCONSOLE (console); 1323 con = XCONSOLE (console);
1324 1324
1325 if (!called_from_delete_device) 1325 if (!called_from_delete_device &&
1326 !(MAYBE_INT_DEVMETH (d, device_implementation_flags, ())
1327 & XDEVIMPF_FRAMELESS_OK))
1326 { 1328 {
1327 /* If we're deleting the only non-minibuffer frame on the 1329 /* If we're deleting the only non-minibuffer frame on the
1328 device, delete the device. */ 1330 device, delete the device. */
1329 if (EQ (frame, next_frame (frame, Qnomini, FRAME_DEVICE (f)))) 1331 if (EQ (frame, next_frame (frame, Qnomini, FRAME_DEVICE (f))))
1330 { 1332 {
1506 { 1508 {
1507 Lisp_Object next_f = 1509 Lisp_Object next_f =
1508 next_frame_internal (frame, Qt, device, 1510 next_frame_internal (frame, Qt, device,
1509 called_from_delete_device); 1511 called_from_delete_device);
1510 if (NILP (next_f) || EQ (next_f, frame)) 1512 if (NILP (next_f) || EQ (next_f, frame))
1511 ; 1513 set_device_selected_frame (d, Qnil);
1512 else 1514 else
1513 set_device_selected_frame (d, next_f); 1515 set_device_selected_frame (d, next_f);
1514 } 1516 }
1515 else if (! did_select) 1517 else if (! did_select)
1516 set_device_selected_frame (d, next); 1518 set_device_selected_frame (d, next);
1521 /* Don't allow minibuf_window to remain on a deleted frame. */ 1523 /* Don't allow minibuf_window to remain on a deleted frame. */
1522 if (EQ (f->minibuffer_window, minibuf_window)) 1524 if (EQ (f->minibuffer_window, minibuf_window))
1523 { 1525 {
1524 struct frame *sel_frame = selected_frame (); 1526 struct frame *sel_frame = selected_frame ();
1525 Fset_window_buffer (sel_frame->minibuffer_window, 1527 Fset_window_buffer (sel_frame->minibuffer_window,
1526 XWINDOW (minibuf_window)->buffer); 1528 XWINDOW (minibuf_window)->buffer, Qt);
1527 minibuf_window = sel_frame->minibuffer_window; 1529 minibuf_window = sel_frame->minibuffer_window;
1528 1530
1529 /* If the dying minibuffer window was selected, 1531 /* If the dying minibuffer window was selected,
1530 select the new one. */ 1532 select the new one. */
1531 if (minibuffer_selected) 1533 if (minibuffer_selected)
1927 1929
1928 /* Don't allow minibuf_window to remain on a deleted frame. */ 1930 /* Don't allow minibuf_window to remain on a deleted frame. */
1929 if (EQ (f->minibuffer_window, minibuf_window)) 1931 if (EQ (f->minibuffer_window, minibuf_window))
1930 { 1932 {
1931 Fset_window_buffer (sel_frame->minibuffer_window, 1933 Fset_window_buffer (sel_frame->minibuffer_window,
1932 XWINDOW (minibuf_window)->buffer); 1934 XWINDOW (minibuf_window)->buffer, Qt);
1933 minibuf_window = sel_frame->minibuffer_window; 1935 minibuf_window = sel_frame->minibuffer_window;
1934 } 1936 }
1935 1937
1936 MAYBE_FRAMEMETH (f, make_frame_invisible, (f)); 1938 MAYBE_FRAMEMETH (f, make_frame_invisible, (f));
1937 1939
1953 1955
1954 /* Don't allow minibuf_window to remain on a deleted frame. */ 1956 /* Don't allow minibuf_window to remain on a deleted frame. */
1955 if (EQ (f->minibuffer_window, minibuf_window)) 1957 if (EQ (f->minibuffer_window, minibuf_window))
1956 { 1958 {
1957 Fset_window_buffer (sel_frame->minibuffer_window, 1959 Fset_window_buffer (sel_frame->minibuffer_window,
1958 XWINDOW (minibuf_window)->buffer); 1960 XWINDOW (minibuf_window)->buffer, Qt);
1959 minibuf_window = sel_frame->minibuffer_window; 1961 minibuf_window = sel_frame->minibuffer_window;
1960 } 1962 }
1961 1963
1962 MAYBE_FRAMEMETH (f, iconify_frame, (f)); 1964 MAYBE_FRAMEMETH (f, iconify_frame, (f));
1963 1965
2140 static int 2142 static int
2141 dissect_as_face_setting (Lisp_Object sym, Lisp_Object *face_out, 2143 dissect_as_face_setting (Lisp_Object sym, Lisp_Object *face_out,
2142 Lisp_Object *face_prop_out) 2144 Lisp_Object *face_prop_out)
2143 { 2145 {
2144 Lisp_Object list = Vbuilt_in_face_specifiers; 2146 Lisp_Object list = Vbuilt_in_face_specifiers;
2145 struct Lisp_String *s; 2147 Lisp_String *s;
2146 2148
2147 if (!SYMBOLP (sym)) 2149 if (!SYMBOLP (sym))
2148 return 0; 2150 return 0;
2149 2151
2150 s = symbol_name (XSYMBOL (sym)); 2152 s = symbol_name (XSYMBOL (sym));
2151 2153
2152 while (!NILP (list)) 2154 while (!NILP (list))
2153 { 2155 {
2154 Lisp_Object prop = Fcar (list); 2156 Lisp_Object prop = Fcar (list);
2155 struct Lisp_String *prop_name; 2157 Lisp_String *prop_name;
2156 2158
2157 if (!SYMBOLP (prop)) 2159 if (!SYMBOLP (prop))
2158 continue; 2160 continue;
2159 prop_name = symbol_name (XSYMBOL (prop)); 2161 prop_name = symbol_name (XSYMBOL (prop));
2160 if (string_length (s) > string_length (prop_name) + 1 2162 if (string_length (s) > string_length (prop_name) + 1
2847 + FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH (f) 2849 + FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH (f)
2848 + 2 * FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH (f) 2850 + 2 * FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH (f)
2849 - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) 2851 - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f)
2850 - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f); 2852 - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f);
2851 2853
2854 new_pixwidth += 2 * f->internal_border_width;
2855
2852 /* Adjust the width for the end glyph which may be a different width 2856 /* Adjust the width for the end glyph which may be a different width
2853 than the default character width. */ 2857 than the default character width. */
2854 { 2858 {
2855 int adjustment, trunc_width, cont_width; 2859 int adjustment, trunc_width, cont_width;
2856 2860
2857 trunc_width = glyph_width (Vtruncation_glyph, 2861 trunc_width = glyph_width (Vtruncation_glyph,
2858 FRAME_SELECTED_WINDOW (f)); 2862 FRAME_SELECTED_WINDOW (f));
2859 cont_width = glyph_width (Vcontinuation_glyph, 2863 cont_width = glyph_width (Vcontinuation_glyph,
2860 FRAME_SELECTED_WINDOW (f)); 2864 FRAME_SELECTED_WINDOW (f));
2861 adjustment = max (trunc_width, cont_width); 2865 adjustment = max (trunc_width, cont_width);
2862 adjustment = max (adjustment, font_width); 2866 adjustment = max (adjustment, font_width);
2863 2867
2864 new_pixwidth += adjustment; 2868 new_pixwidth += adjustment;