emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#60381: closed ([PATCH] Preserve Window Position with Proced)


From: GNU bug Tracking System
Subject: bug#60381: closed ([PATCH] Preserve Window Position with Proced)
Date: Sat, 14 Jan 2023 08:42:01 +0000

Your message dated Sat, 14 Jan 2023 10:40:58 +0200
with message-id <83bkn18q5h.fsf@gnu.org>
and subject line Re: bug#60381: [PATCH] Preserve Window Position with Proced
has caused the debbugs.gnu.org bug report #60381,
regarding [PATCH] Preserve Window Position with Proced
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
60381: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60381
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] Preserve Window Position with Proced Date: Wed, 28 Dec 2022 15:55:20 +0000
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

Attachment: 0001-Preserve-the-window-position-with-proced.patch
Description: Text Data


--- End Message ---
--- Begin Message --- Subject: Re: bug#60381: [PATCH] Preserve Window Position with Proced Date: Sat, 14 Jan 2023 10:40:58 +0200
> From: Laurence Warne <laurencewarne@gmail.com>
> Date: Sat, 7 Jan 2023 17:23:36 +0000
> Cc: 60381@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.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]