From: Juri Linkov <juri@linkov.net>
To: martin rudalics <rudalics@gmx.at>
Cc: 59862@debbugs.gnu.org
Subject: bug#59862: quit-restore per window buffer
Date: Sun, 14 Jul 2024 10:49:35 +0300 [thread overview]
Message-ID: <86h6csct0w.fsf@mail.linkov.net> (raw)
In-Reply-To: <3f399d4f-3dd2-4624-b857-e198f70b5565@gmx.at> (martin rudalics's message of "Fri, 12 Jul 2024 10:20:32 +0200")
>> Ok, I will try to move it.
>
> We could replace the
>
> (or (eq (nth 1 quit-restore) 'frame)
> (and (eq (nth 1 quit-restore) 'window)
> ;; If the window has been created on an existing
> ;; frame and ended up as the sole window on that
> ;; frame, do not delete it (Bug#12764).
> (not (eq window (frame-root-window window)))))
>
> clause with
>
> (or (eq (nth 1 quit-restore) 'frame)
> ;; If the window has been created on an existing
> ;; frame and ended up as the sole window on that
> ;; frame, do not delete it (Bug#12764).
> (not (eq window (frame-root-window window))))
>
> with the motivation that if a window does not have a previous buffer,
> there is no reason to switch to it. This will keep the frame around so
> Bu#12764 is not affected and the normal behavior of C-h i followed by
> C-h e is not affected either unless a user deleted *scratch* in between.
Sorry, I know nothing about the frame case.
> Try it and if it works for you I'll add it to the new patch.
OTOH, I tried to add the tab case handling to the same places
where the frame case is handled, and everything works nicely
with this patch applied over your previous patches:
diff --git a/lisp/window.el b/lisp/window.el
index 58120c919c7..82efb3c40ce 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -4120,6 +4120,11 @@ window-deletable-p
(let ((frame (window-frame window)))
(cond
+ ((and (eq (nth 1 (window-parameter window 'quit-restore)) 'tab)
+ (< (seq-count (lambda (w) (window-parameter w 'quit-restore))
+ (window-list-1 nil 'nomini))
+ 2))
+ 'tab)
((frame-root-window-p window)
;; WINDOW's frame can be deleted only if there are other frames
;; on the same terminal, and it does not contain the active
@@ -4990,6 +4995,9 @@ window--delete
(unless (and dedicated-only (not (window-dedicated-p window)))
(let ((deletable (window-deletable-p window)))
(cond
+ ((eq deletable 'tab)
+ (tab-bar-close-tab)
+ 'tab)
((eq deletable 'frame)
(let ((frame (window-frame window)))
(cond
@@ -5303,10 +5311,8 @@ quit-restore-window
((and (not prev-buffer)
(eq (nth 1 quit-restore) 'tab)
(eq (nth 3 quit-restore) buffer)
- (< (seq-count (lambda (w) (window-parameter w 'quit-restore))
- (window-list-1 nil 'nomini))
- 2))
- (tab-bar-close-tab)
+ (window--delete
+ window nil (memq bury-or-kill '(kill killing))))
;; If the previously selected window is still alive, select it.
(window--quit-restore-select-window quit-restore-2))
((and (not prev-buffer)
next prev parent reply other threads:[~2024-07-14 7:49 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 17:32 bug#59862: quit-restore per window buffer Juri Linkov
2024-06-02 6:45 ` Juri Linkov
2024-06-03 9:34 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-03 9:53 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-03 16:09 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-04 6:53 ` Juri Linkov
2024-06-05 16:56 ` Juri Linkov
2024-06-11 6:52 ` Juri Linkov
2024-06-12 8:57 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-13 6:47 ` Juri Linkov
2024-06-13 8:21 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-14 17:35 ` Juri Linkov
2024-06-15 8:41 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-16 16:50 ` Juri Linkov
2024-06-17 14:48 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-08 16:49 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-09 6:58 ` Juri Linkov
2024-07-09 8:52 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-10 6:50 ` Juri Linkov
2024-07-10 9:16 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-11 6:47 ` Juri Linkov
2024-07-11 8:36 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-12 6:54 ` Juri Linkov
2024-07-12 8:20 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-14 7:49 ` Juri Linkov [this message]
2024-07-15 7:32 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-16 6:09 ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-16 6:09 ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
[not found] ` <87frs9kgve.fsf@>
2024-07-16 8:22 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-16 22:14 ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-16 22:14 ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
[not found] ` <871q3tc7da.fsf@>
2024-07-17 9:23 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-30 8:20 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-31 17:30 ` Juri Linkov
2024-08-01 6:37 ` Juri Linkov
2024-08-01 7:50 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-01 7:49 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-01 16:01 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86h6csct0w.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=59862@debbugs.gnu.org \
--cc=rudalics@gmx.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.