diff options
| author | Richard M. Stallman | 2008-02-08 02:38:15 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2008-02-08 02:38:15 +0000 |
| commit | a31787b1e9fc5d63511ff7a85f67dbfa22596a9c (patch) | |
| tree | 23239340ce85f27f5a1f0189a43497f1e44cc3d8 /src | |
| parent | ec6d1b14133d0a48061c98d77d12ef983b712f06 (diff) | |
| download | emacs-a31787b1e9fc5d63511ff7a85f67dbfa22596a9c.tar.gz emacs-a31787b1e9fc5d63511ff7a85f67dbfa22596a9c.zip | |
(Fdelete_frame): If FORCE, don't call hooks.
If FORCE, and frame has a surrogate minibuffer for another frame,
delete the other frame first.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/frame.c | 22 |
2 files changed, 24 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 7cd786a22ff..350e5573d17 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2008-02-08 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * frame.c (Fdelete_frame): If FORCE, don't call hooks. | ||
| 4 | If FORCE, and frame has a surrogate minibuffer for another frame, | ||
| 5 | delete the other frame first. | ||
| 6 | |||
| 1 | 2008-02-07 Timo Savola <timo.savola@iki.fi> | 7 | 2008-02-07 Timo Savola <timo.savola@iki.fi> |
| 2 | 8 | ||
| 3 | * xterm.c (x_detect_focus_change): Handle embed client message. | 9 | * xterm.c (x_detect_focus_change): Handle embed client message. |
diff --git a/src/frame.c b/src/frame.c index 30c5e5e9d36..fec911f4b0c 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -1342,7 +1342,9 @@ but if the second optional argument FORCE is non-nil, you may do so. | |||
| 1342 | 1342 | ||
| 1343 | This function runs `delete-frame-functions' before actually deleting the | 1343 | This function runs `delete-frame-functions' before actually deleting the |
| 1344 | frame, unless the frame is a tooltip. | 1344 | frame, unless the frame is a tooltip. |
| 1345 | The functions are run with one arg, the frame to be deleted. */) | 1345 | The functions are run with one arg, the frame to be deleted. |
| 1346 | But FORCE inhibits this too. */) | ||
| 1347 | /* FORCE is non-nil when handling a disconnected terminal. */ | ||
| 1346 | (frame, force) | 1348 | (frame, force) |
| 1347 | Lisp_Object frame, force; | 1349 | Lisp_Object frame, force; |
| 1348 | { | 1350 | { |
| @@ -1393,12 +1395,21 @@ The functions are run with one arg, the frame to be deleted. */) | |||
| 1393 | && EQ (frame, | 1395 | && EQ (frame, |
| 1394 | WINDOW_FRAME (XWINDOW | 1396 | WINDOW_FRAME (XWINDOW |
| 1395 | (FRAME_MINIBUF_WINDOW (XFRAME (this)))))) | 1397 | (FRAME_MINIBUF_WINDOW (XFRAME (this)))))) |
| 1396 | error ("Attempt to delete a surrogate minibuffer frame"); | 1398 | { |
| 1399 | /* If we MUST delete this frame, delete the other first. */ | ||
| 1400 | if (!NILP (force)) | ||
| 1401 | Fdelete_frame (this, force); | ||
| 1402 | else | ||
| 1403 | error ("Attempt to delete a surrogate minibuffer frame"); | ||
| 1404 | } | ||
| 1397 | } | 1405 | } |
| 1398 | } | 1406 | } |
| 1399 | 1407 | ||
| 1400 | /* Run `delete-frame-functions' unless frame is a tooltip. */ | 1408 | /* Run `delete-frame-functions' |
| 1401 | if (!NILP (Vrun_hooks) | 1409 | unless FORCE is true or frame is a tooltip. |
| 1410 | FORCE is set when handling a disconnect from the terminal, | ||
| 1411 | so we don't dare call Lisp code. */ | ||
| 1412 | if (!NILP (Vrun_hooks) && NILP (force) | ||
| 1402 | && NILP (Fframe_parameter (frame, intern ("tooltip")))) | 1413 | && NILP (Fframe_parameter (frame, intern ("tooltip")))) |
| 1403 | { | 1414 | { |
| 1404 | Lisp_Object args[2]; | 1415 | Lisp_Object args[2]; |
| @@ -1418,6 +1429,9 @@ The functions are run with one arg, the frame to be deleted. */) | |||
| 1418 | if (! FRAME_LIVE_P (f)) | 1429 | if (! FRAME_LIVE_P (f)) |
| 1419 | return Qnil; | 1430 | return Qnil; |
| 1420 | 1431 | ||
| 1432 | /* At this point, we are committed to deleting the frame. | ||
| 1433 | There is no more chance for errors to prevent it. */ | ||
| 1434 | |||
| 1421 | minibuffer_selected = EQ (minibuf_window, selected_window); | 1435 | minibuffer_selected = EQ (minibuf_window, selected_window); |
| 1422 | 1436 | ||
| 1423 | /* Don't let the frame remain selected. */ | 1437 | /* Don't let the frame remain selected. */ |