aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1995-02-23 09:04:34 +0000
committerRichard M. Stallman1995-02-23 09:04:34 +0000
commit3548e138463cfdda1105b8b6f5981f9b3c86035a (patch)
tree61bff454423e965027cfe131890f618f74b9391f /src
parent15cb2300cf80b1b3180c10fdc3fb96bff9c2a342 (diff)
downloademacs-3548e138463cfdda1105b8b6f5981f9b3c86035a.tar.gz
emacs-3548e138463cfdda1105b8b6f5981f9b3c86035a.zip
(window_loop): Handle special display buffer frames
for DELETE_BUFFER_WINDOWS as for UNSHOW_BUFFER. (syms_of_window): Doc fixes.
Diffstat (limited to 'src')
-rw-r--r--src/window.c72
1 files changed, 54 insertions, 18 deletions
diff --git a/src/window.c b/src/window.c
index 47b9e120b69..76e63f1c1ea 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1291,21 +1291,51 @@ window_loop (type, obj, mini, frames)
1291 case DELETE_BUFFER_WINDOWS: 1291 case DELETE_BUFFER_WINDOWS:
1292 if (EQ (XWINDOW (w)->buffer, obj)) 1292 if (EQ (XWINDOW (w)->buffer, obj))
1293 { 1293 {
1294 /* If we're deleting the buffer displayed in the only window 1294#ifdef MULTI_FRAME
1295 on the frame, find a new buffer to display there. */ 1295 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (w)));
1296 if (NILP (XWINDOW (w)->parent)) 1296
1297 /* If this window is dedicated, and in a frame of its own,
1298 kill the frame. */
1299 if (EQ (w, FRAME_ROOT_WINDOW (f))
1300 && !NILP (XWINDOW (w)->dedicated)
1301 && other_visible_frames (f))
1297 { 1302 {
1298 Lisp_Object new_buffer; 1303 /* Skip the other windows on this frame.
1299 new_buffer = Fother_buffer (obj, Qnil); 1304 There might be one, the minibuffer! */
1300 if (NILP (new_buffer)) 1305 if (! EQ (w, last_window))
1301 new_buffer 1306 while (f == XFRAME (WINDOW_FRAME (XWINDOW (next_window))))
1302 = Fget_buffer_create (build_string ("*scratch*")); 1307 {
1303 Fset_window_buffer (w, new_buffer); 1308 /* As we go, check for the end of the loop.
1304 if (EQ (w, selected_window)) 1309 We mustn't start going around a second time. */
1305 Fset_buffer (XWINDOW (w)->buffer); 1310 if (EQ (next_window, last_window))
1311 {
1312 last_window = w;
1313 break;
1314 }
1315 next_window = Fnext_window (next_window,
1316 mini ? Qt : Qnil,
1317 frame_arg);
1318 }
1319 /* Now we can safely delete the frame. */
1320 Fdelete_frame (WINDOW_FRAME (XWINDOW (w)), Qnil);
1306 } 1321 }
1307 else 1322 else
1308 Fdelete_window (w); 1323#endif
1324 /* If we're deleting the buffer displayed in the only window
1325 on the frame, find a new buffer to display there. */
1326 if (NILP (XWINDOW (w)->parent))
1327 {
1328 Lisp_Object new_buffer;
1329 new_buffer = Fother_buffer (obj, Qnil);
1330 if (NILP (new_buffer))
1331 new_buffer
1332 = Fget_buffer_create (build_string ("*scratch*"));
1333 Fset_window_buffer (w, new_buffer);
1334 if (EQ (w, selected_window))
1335 Fset_buffer (XWINDOW (w)->buffer);
1336 }
1337 else
1338 Fdelete_window (w);
1309 } 1339 }
1310 break; 1340 break;
1311 1341
@@ -3309,9 +3339,12 @@ where `pop-up-frame-alist' would hold the default frame parameters.");
3309 "*List of buffer names that should have their own special frames.\n\ 3339 "*List of buffer names that should have their own special frames.\n\
3310Displaying a buffer whose name is in this list makes a special frame for it\n\ 3340Displaying a buffer whose name is in this list makes a special frame for it\n\
3311using `special-display-function'.\n\ 3341using `special-display-function'.\n\
3312Instead of a buffer name, the list entries can be cons cells. In that\n\ 3342\n\
3313case the car should be a buffer name, and the cdr data to be passed as a\n\ 3343An element of the list can be a cons cell instead of just a string.\n\
3314second argument to `special-display-function'.\n\ 3344Then the car should be a buffer name, and the cdr specifies frame\n\
3345parameters for creating the frame for that buffer.\n\
3346More precisely, the cdr is passed as the second argument to\n\
3347the function found in `special-display-function', when making that frame.\n\
3315See also `special-display-regexps'."); 3348See also `special-display-regexps'.");
3316 Vspecial_display_buffer_names = Qnil; 3349 Vspecial_display_buffer_names = Qnil;
3317 3350
@@ -3320,9 +3353,12 @@ See also `special-display-regexps'.");
3320If a buffer name matches one of these regexps, it gets its own frame.\n\ 3353If a buffer name matches one of these regexps, it gets its own frame.\n\
3321Displaying a buffer whose name is in this list makes a special frame for it\n\ 3354Displaying a buffer whose name is in this list makes a special frame for it\n\
3322using `special-display-function'.\n\ 3355using `special-display-function'.\n\
3323Instead of a buffer name, the list entries can be cons cells. In that\n\ 3356\n\
3324case the car should be the regexp, and the cdr data to be passed as a\n\ 3357An element of the list can be a cons cell instead of just a string.\n\
3325second argument to `special-display-function'.\n\ 3358Then the car should be the regexp, and the cdr specifies frame\n\
3359parameters for creating the frame for buffers that match.\n\
3360More precisely, the cdr is passed as the second argument to\n\
3361the function found in `special-display-function', when making that frame.\n\
3326See also `special-display-buffer-names'."); 3362See also `special-display-buffer-names'.");
3327 Vspecial_display_regexps = Qnil; 3363 Vspecial_display_regexps = Qnil;
3328 3364