diff options
| author | Richard M. Stallman | 1995-02-23 09:04:34 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-02-23 09:04:34 +0000 |
| commit | 3548e138463cfdda1105b8b6f5981f9b3c86035a (patch) | |
| tree | 61bff454423e965027cfe131890f618f74b9391f /src | |
| parent | 15cb2300cf80b1b3180c10fdc3fb96bff9c2a342 (diff) | |
| download | emacs-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.c | 72 |
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\ |
| 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 | ||
| @@ -3320,9 +3353,12 @@ See also `special-display-regexps'."); | |||
| 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 | ||