]> git.eshelyaron.com Git - emacs.git/commit
Preserve the window position with proced (bug#60381)
authorLaurence Warne <laurencewarne@gmail.com>
Thu, 22 Dec 2022 17:16:08 +0000 (17:16 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 14 Jan 2023 08:36:15 +0000 (10:36 +0200)
commitf0ac01812f93ea8bea95e37415987e8d7a82fb1c
tree886de06bd731871393aeffe34e7e98c8f27dcdc6
parent4514b7ecc6fdf8d2642ea6ff84f0af3868a3a658
Preserve the window position with proced (bug#60381)

Preserve the window position for windows which display a proced
buffer, but are not the selected window when a proced buffer is
updated.  Previously, the window position would be set to the
start of the buffer when a proced buffer was updated and it was
not displayed in the selected window.

Similarly, preserve the position in proced buffers which are not
displayed in any window by setting
'switch-to-buffer-preserve-window-point' to nil in proced buffers.

* lisp/proced.el (proced-auto-update-timer): Only update a given
proced buffer if it is displayed in a window.
(proced-update): Set the window position if the proced buffer is
displayed in a window.
(proced--position-info, proced--determine-pos): New Functions.
(proced-mode): Set 'switch-to-buffer-preserve-window-point' to
nil in proced buffers.
* test/lisp/proced-tests.el
(proced-update-preserves-pid-at-point-test): New test.
lisp/proced.el
test/lisp/proced-tests.el