Mercurial > emacs
comparison src/window.c @ 10808:64fcde7a1438
(window_loop): Handle special display buffer frames
for DELETE_BUFFER_WINDOWS as for UNSHOW_BUFFER.
(syms_of_window): Doc fixes.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 23 Feb 1995 09:04:34 +0000 |
parents | e1dfb47b664e |
children | c0d821d95739 |
comparison
equal
deleted
inserted
replaced
10807:50f00b298a2d | 10808:64fcde7a1438 |
---|---|
1289 break; | 1289 break; |
1290 | 1290 |
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 |
1312 case GET_LARGEST_WINDOW: | 1342 case GET_LARGEST_WINDOW: |
1313 /* Ignore dedicated windows and minibuffers. */ | 1343 /* Ignore dedicated windows and minibuffers. */ |
3307 | 3337 |
3308 DEFVAR_LISP ("special-display-buffer-names", &Vspecial_display_buffer_names, | 3338 DEFVAR_LISP ("special-display-buffer-names", &Vspecial_display_buffer_names, |
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\ |
3310 Displaying a buffer whose name is in this list makes a special frame for it\n\ | 3340 Displaying a buffer whose name is in this list makes a special frame for it\n\ |
3311 using `special-display-function'.\n\ | 3341 using `special-display-function'.\n\ |
3312 Instead of a buffer name, the list entries can be cons cells. In that\n\ | 3342 \n\ |
3313 case the car should be a buffer name, and the cdr data to be passed as a\n\ | 3343 An element of the list can be a cons cell instead of just a string.\n\ |
3314 second argument to `special-display-function'.\n\ | 3344 Then the car should be a buffer name, and the cdr specifies frame\n\ |
3345 parameters for creating the frame for that buffer.\n\ | |
3346 More precisely, the cdr is passed as the second argument to\n\ | |
3347 the function found in `special-display-function', when making that frame.\n\ | |
3315 See also `special-display-regexps'."); | 3348 See also `special-display-regexps'."); |
3316 Vspecial_display_buffer_names = Qnil; | 3349 Vspecial_display_buffer_names = Qnil; |
3317 | 3350 |
3318 DEFVAR_LISP ("special-display-regexps", &Vspecial_display_regexps, | 3351 DEFVAR_LISP ("special-display-regexps", &Vspecial_display_regexps, |
3319 "*List of regexps saying which buffers should have their own special frames.\n\ | 3352 "*List of regexps saying which buffers should have their own special frames.\n\ |
3320 If a buffer name matches one of these regexps, it gets its own frame.\n\ | 3353 If a buffer name matches one of these regexps, it gets its own frame.\n\ |
3321 Displaying a buffer whose name is in this list makes a special frame for it\n\ | 3354 Displaying a buffer whose name is in this list makes a special frame for it\n\ |
3322 using `special-display-function'.\n\ | 3355 using `special-display-function'.\n\ |
3323 Instead of a buffer name, the list entries can be cons cells. In that\n\ | 3356 \n\ |
3324 case the car should be the regexp, and the cdr data to be passed as a\n\ | 3357 An element of the list can be a cons cell instead of just a string.\n\ |
3325 second argument to `special-display-function'.\n\ | 3358 Then the car should be the regexp, and the cdr specifies frame\n\ |
3359 parameters for creating the frame for buffers that match.\n\ | |
3360 More precisely, the cdr is passed as the second argument to\n\ | |
3361 the function found in `special-display-function', when making that frame.\n\ | |
3326 See also `special-display-buffer-names'."); | 3362 See also `special-display-buffer-names'."); |
3327 Vspecial_display_regexps = Qnil; | 3363 Vspecial_display_regexps = Qnil; |
3328 | 3364 |
3329 DEFVAR_LISP ("special-display-function", &Vspecial_display_function, | 3365 DEFVAR_LISP ("special-display-function", &Vspecial_display_function, |
3330 "Function to call to make a new frame for a special buffer.\n\ | 3366 "Function to call to make a new frame for a special buffer.\n\ |