1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-14 19:01:45 -07:00

New user option 'after-delete-frame-select-mru-frame' (bug#80397)

Users can revert to the old 'delete-frame' behavior of selecting
the oldest frame in 'frame-list' rather than the most-recently
used frame.

* src/frame.c (delete_frame): Consult
'after-delete-frame-select-mru-frame'.
(syms_of_frame): New defvar
'after-delete-frame-select-mru-frame'.
* etc/NEWS: Reflect the new user option.
This commit is contained in:
Stéphane Marks 2026-02-22 10:33:34 +01:00 committed by Martin Rudalics
parent 2ae21d78ec
commit 77aac20ce6
2 changed files with 13 additions and 4 deletions

View file

@ -511,9 +511,9 @@ terminal.
---
*** After deleting, 'delete-frame' now selects the most recently used frame.
Previously, after deleting a specified frame, 'delete-frame' would
select the next eligible frame in the order of the frame list. This is
often unrelated to frames' recent use and can appear somewhat random to
users.
select the oldest visible frame on the same terminal. To revert to the
old behavior, set the new user option
'after-delete-frame-select-mru-frame' to nil.
+++
*** New value 'force' for user option 'frame-inhibit-implied-resize'.

View file

@ -2749,7 +2749,9 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
else
{
frame1 = Qnil;
if (!EQ (force, Qnoelisp))
if (after_delete_frame_select_mru_frame
&& !EQ (force, Qnoelisp))
{
/* Find the most recently used visible frame among all
frames on the same terminal as FRAME, excluding FRAME
@ -7778,6 +7780,13 @@ The default is \\+`inhibit' in NS builds and nil everywhere else. */);
alter_fullscreen_frames = Qnil;
#endif
DEFVAR_BOOL ("after-delete-frame-select-mru-frame",
after_delete_frame_select_mru_frame,
doc: /* Non-nil means `delete-frame' selects most recently used frame.
If this is nil, `delete-frame' will select the oldest visible frame on
the same terminal. */);
after_delete_frame_select_mru_frame = true;
defsubr (&Sframe_id);
defsubr (&Sframep);
defsubr (&Sframe_live_p);