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

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 19 Jun 2014 11:19:04 +0000

Your bug report

#17769: 24.4.50; rcirc-omit-mode should only call `recenter' if `current-buffer' is equal to `window-buffer'

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 [email-masked].

-- 
17769: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17769
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#17769: 24.4.50; [PATCH] rcirc-omit-mode: `recenter'ing a window that does not display current-buffer.
From: Leo Liu <[email-masked]>
To: Daimrod <[email-masked]>
Cc: martin rudalics <[email-masked]>, Eli Zaretskii <[email-masked]>, [email-masked]
Date: Thu, 19 Jun 2014 19:18:12 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Fixed in 24.5.

On 2014-06-14 01:08 +0900, Daimrod wrote:
> I see, thanks for inputs.
>
> Here is an updated patch.

Thanks for the patch.

Leo

Subject: 24.4.50; rcirc-omit-mode should only call `recenter' if `current-buffer' is equal to `window-buffer'
From: Kan-Ru Chen (陳侃如) <[email-masked]>
To: [email-masked]
Date: Sat, 14 Jun 2014 19:27:22 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Step to reproduce:

 (add-hook 'rcirc-mode-hook 'rcirc-omit-mode)

When rcirc trys auto-connect to channels, emacs will show

 (error "`recenter'ing a window that does not display current-buffer.")

Patch attached

In GNU Emacs 24.4.50.6 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2)
 of 2014-06-14 on isil
Windowing system distributor `The X.Org Foundation', version 11.0.11501000
System Description:	Debian GNU/Linux unstable (sid)

>From 901b38e1f17def0b4ee64f78f54d04e3295eb6db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kan-Ru=20Chen=20=28=E9=99=B3=E4=BE=83=E5=A6=82=29?=
 <[email-masked]>
Date: Sat, 14 Jun 2014 19:21:00 +0800
Subject: [PATCH] net/rcirc.el: Only call `recenter' if `current-buffer' is
 equal to `window-buffer'

---
 lisp/ChangeLog    | 5 +++++
 lisp/net/rcirc.el | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1df12d4..8317393 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2014-06-14  Kan-Ru Chen  <[email-masked]>
+
+	* net/rcirc.el (rcirc-omit-mode): Only call `recenter' if
+	`current-buffer' is equal to `window-buffer'.
+
 2014-06-13  Glenn Morris  <[email-masked]>
 
 	* Makefile.in ($(lisp)/cus-load.el, $(lisp)/finder-inf.el)
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 41cc002..1e3ee32 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)))
+  (when (and (eq (current-buffer) (window-buffer))
+             (> (point) rcirc-prompt-start-marker))
+    (recenter -1)))
 
 (defun rcirc-switch-to-server-buffer ()
   "Switch to the server buffer associated with current channel buffer."
-- 
2.0.0