GNU bug report logs -
#60381
[PATCH] Preserve Window Position with Proced
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#60381: [PATCH] Preserve Window Position with Proced
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 60381 <at> debbugs.gnu.org.
--
60381: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60381
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
> From: Laurence Warne <laurencewarne <at> gmail.com>
> Date: Sat, 7 Jan 2023 17:23:36 +0000
> Cc: 60381 <at> debbugs.gnu.org
>
> Cool, I think I've now fixed the second issue (preserving the position in proced buffers which are not
> displayed in any window) using your suggestion of setting switch-to-buffer-preserve-window-point locally to
> nil in proced buffers. I've attached a new patch, the same as the previous one but with one line change for
> the above.
Thanks, installed, and closing the bug.
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
Hi,
This patch fixes a minor issue with proced buffers. 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. To reproduce:
(require 'proced)
(setq-default proceed-auto-update-flag t)
(M-x proced)
Move down to the next process, then change to a different window, and wait
a bit. You should see the point in the proced buffer move back to the
beginning of the buffer. A similar issue occurs when the proced buffer is
not displayed in any window.
This patch addresses this by setting the window point (if applicable)
whenever a proced buffer is updated, and the second issue by not updating a
proced buffer if it is not displayed in any window.
I tried to add a test for this, but for example this:
(ert-deftest proced-update-preserves-point-test ()
(proced--within-buffer
'medium
'user
(proced--move-to-column "PID")
(let ((point (window-point))
(window (split-window)))
(select-window window)
(bury-buffer)
(with-current-buffer "*Proced*"
(proced-update t t))
(switch-to-buffer "*Proced*")
(should (= point (window-point))))))
passes even without this patch (though if I step through it with
edebug-defun it fails as expected).
Thanks, Laurence
[Message part 5 (text/html, inline)]
[0001-Preserve-the-window-position-with-proced.patch (text/x-patch, attachment)]
This bug report was last modified 2 years and 187 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.