unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
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: Tue, 09 Jul 2024 09:58:49 +0300	[thread overview]
Message-ID: <86le2b12ni.fsf@mail.linkov.net> (raw)
In-Reply-To: <ca1388d2-3481-49c4-8721-42792a399340@gmx.at> (martin rudalics's message of "Mon, 8 Jul 2024 18:49:52 +0200")

> It took me some time to rewrite the code for this since I found a couple
> of leaks in the window handling code which I tried to plug now.  In a
> nutshell, the new patch is supposed to fix the following issues.
>
> - I introduced a new variable called 'kill-buffer-quit-windows'.  If
>   non-nil, it makes killing a buffer call 'quit-restore-window' for each
>   window showing the buffer thus implementing the behavior you want.  If
>   nil, killing a buffer works as before apart from the fixes I added
>   below.

Thanks, I hope it will help to replace such configurations:

  (defun quit-window-kill-buffer ()
    "Quit WINDOW and kill its buffer."
    (interactive)
    (quit-window 1))
  (define-key special-mode-map "q" 'quit-window-kill-buffer)
  (define-key image-mode-map "q" 'quit-window-kill-buffer)
  (define-key global-map "\C-q" 'quit-window-kill-buffer)
  (define-key dired-mode-map "q" 'quit-window-kill-buffer)
  (define-key archive-mode-map "q" 'quit-window-kill-buffer)
  (define-key tar-mode-map "q" 'quit-window-kill-buffer)
  ...

I suppose it will affect only interactive uses of 'kill-buffer'.

> In earlier versions of Emacs, window configurations were mostly used to
> handle window excursions and were consequently rather short-lived.  Your
> tab bar code has changed that.  Hence we should try to avoid any leaks
> introduced by long-lived configurations.

Indeed now window configurations are long-lived, so tab-bar uses
(split-window) followed by (delete-window) to create a new window
different from the window saved in a window configuration.

> Please test the patch intensively and report any problems you see.  I
> used the forms below to test the various features of the patch.

I have used your previous patch for a long time,
and it worked perfectly.  I hope your new patch
will be as good as the old one.

PS: I noticed one difference between handling of frames and tabs:

C-x 5 5   ;; other-frame-prefix
C-h i     ;; info
C-h e     ;; view-echo-area-messages
q         ;; quit-window
This deletes the Info window, and doesn't delete the frame.
Everything is correct.

C-x t t   ;; other-tab-prefix
C-h i     ;; info
C-h e     ;; view-echo-area-messages
q         ;; quit-window
This doesn't close the tab (correct),
but doesn't delete the Info window.
This differs from the frame case that keeps
only the Messages window on the frame.





  reply	other threads:[~2024-07-09  6:58 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 [this message]
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
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86le2b12ni.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).