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)]
> This looks promising.
I attach a patch. Note that in my Emacs, window configurations are much
more lightweight so I cannot reliably test it. You would have to do all
the testing yourself.
> One thing I don't understand is how to get
> the previously visited file name from this list of four entries?
But it's still there in the dead buffer (the only things that can get
collected as long as a window is in a tab are the previous and next
buffers shown in that window). Try the scenario below, using some
suitable file as argument to 'find-file-noselect'.
(defun foo (frame windows)
(while windows
(let* ((quad (car windows))
(window (car quad))
(buffer (find-file-noselect
(buffer-file-name (nth 1 quad)))))
(when buffer
(set-window-buffer window buffer)
(set-window-point window (nth 3 quad))
(set-window-start window (nth 2 quad) t)))
(setq windows (cdr windows))))
(add-hook 'post-set-window-configuration-functions 'foo)
(let ((window (selected-window))
(buffer (pop-to-buffer
(find-file-noselect "...")))
(window-1 (split-window))
(window-2 (split-window nil nil t))
configuration)
(set-window-point window-1 5000)
(set-window-point window-2 10000)
(setq configuration (current-window-configuration))
(y-or-n-p "Configuration saved ...")
(delete-other-windows window)
(kill-buffer buffer)
(y-or-n-p "Configuration reset ...")
(set-window-configuration configuration nil nil t)
(message "Configuration restored"))
Note that window point and start are stored as positions and not as
markers which means that if you modify the buffer after the call of
'current-window-configuration', they may not be accurate any more.
One could try to get their last position before the buffer was deleted
but that would mean to give ‘marker-position’ an extra argument to omit
the
if (XMARKER (marker)->buffer)
check with some "use at your own risk" caveats ('marker-buffer' at the
same time would still have to return nil).
martin
[keep-windows.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.