GNU bug report logs -
#68235
29.1.90; Switching tabs stops following process output in selected window
Previous Next
Reported by: Dan McCarthy <daniel.c.mccarthy <at> gmail.com>
Date: Wed, 3 Jan 2024 20:49:02 UTC
Severity: normal
Found in version 29.1.90
Fixed in version 30.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
> In addition to the previous patch I also have more questions:
>
> 1. window-kept-windows-functions should be announced in etc/NEWS?
Maybe, once we fixed all bugs and know how to make good use of it.
> 2. window-kept-windows-functions is called too often.
> Most of the calls contain just the minibuffer:
>
> ((#<window 4 on *Minibuf-0*> #<buffer *Minibuf-0*> 1 1))
>
> Is it possible not to include the minibuffer window?
Yes. Emacs master never deletes a minibuffer window unless it's about
to delete its frame.
> So when most of the time this list of kept windows will be empty,
> then maybe better to not call the hook at all?
But earlier you said "Running the hook with an empty list of windows
makes sense as well." So it's up to you.
> 3. Very often the message inserted by the patch that I posted
> are quite useless because they look like this:
>
> This window displayed the buffer #<killed buffer>.
>
> This would be much more informative:
>
> This window displayed the buffer *Help*.
>
> Maybe 'buffer-last-name' could help to achieve this?
I tried to implement it. Tested with
(let ((buffer (get-buffer-create "*foo*")))
(y-or-n-p (format "current %s last %s"
(buffer-name buffer) (buffer-last-name buffer)))
(with-current-buffer buffer
(rename-buffer "*bar*"))
(y-or-n-p (format "current %s last %s"
(buffer-name buffer) (buffer-last-name buffer)))
(kill-buffer buffer)
(y-or-n-p (format "current %s last %s"
(buffer-name buffer) (buffer-last-name buffer))))
> 4. I don't understand this part, but maybe this is already correct:
>
> /* Scan dead buffer windows. */
> if (!NILP (Vwindow_kept_windows_functions))
> for (; CONSP (dead_windows); dead_windows = XCDR (dead_windows))
> {
> window = XCAR (dead_windows);
> if (WINDOW_LIVE_P (window) && !EQ (window, FRAME_ROOT_WINDOW (f)))
> delete_deletable_window (window);
> }
>
> Should it be if(NILP (Vwindow_kept_windows_functions)) instead?
It should. Thanks for catching it.
> However, this already works correctly in my tests.
Because 'set-window-configuration' does not try to delete a window with
a dead buffer unless that window was dedicated to its buffer. That's
the way it was coded back in 2011. 'window-state-put' OTOH deletes
such a window even if it was not dedicated to its buffer. I now made
'window-state-put' behave like 'set-window-configuration' in this
regard.
Have a look at the attached patch.
martin
[buffer-last-name.diff (text/x-patch, attachment)]
This bug report was last modified 1 year and 30 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.