Subject: Re: bug#17769: 24.4.50; [PATCH] rcirc-omit-mode: `recenter'ing a window that does not display current-buffer.

From: Daimrod <[email-masked]>
Date: Sat, 14 Jun 2014 01:08:52 +0900

martin rudalics <[email-masked]> writes:

>>> Strictly spoken this should read "But if it is displayed in the selected
>>> window, recenter that window."
>>
>> No, because in that case it would already have been done by a normal
>> call to recenter.
>
> Unless the selected window displayed another buffer.  Then you probably
> mean something like
>
>   (dolist (window (get-buffer-window-list buffer))
>     (with-selected-window window (recenter)))

I see, thanks for inputs.

Here is an updated patch.

>From c9fb7786be4fd929ad81861b3ada47d8d2f385e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= <[email-masked]>
Date: Sat, 14 Jun 2014 00:57:06 +0900
Subject: [PATCH] * lisp/net/rcirc.el (rcirc-omit-mode): `recenter' the correct
 windows.

---
 lisp/net/rcirc.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 41cc002..a0e72d1 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -1903,7 +1903,9 @@ Uninteresting lines are those whose responses are listed in
 	(message "Rcirc-Omit mode enabled"))
     (remove-from-invisibility-spec '(rcirc-omit . nil))
     (message "Rcirc-Omit mode disabled"))
-    (recenter (when (> (point) rcirc-prompt-start-marker) -1)))
+  (dolist (window (get-buffer-window-list (current-buffer)))
+    (with-selected-window window
+      (recenter (when (> (point) rcirc-prompt-start-marker) -1)))))
 
 (defun rcirc-switch-to-server-buffer ()
   "Switch to the server buffer associated with current channel buffer."
-- 
1.8.0.2722.gc0242e5

--
Daimrod/Greg