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

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

bug#17778: 24.4.50; rcirc-omit-mode should only call `recenter' if `curr


From: 陳侃如
Subject: bug#17778: 24.4.50; rcirc-omit-mode should only call `recenter' if `current-buffer' is equal to `window-buffer'
Date: Sat, 14 Jun 2014 19:27:22 +0800

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?=
 <kanru@kanru.info>
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  <kanru@kanru.info>
+
+       * net/rcirc.el (rcirc-omit-mode): Only call `recenter' if
+       `current-buffer' is equal to `window-buffer'.
+
 2014-06-13  Glenn Morris  <rgm@gnu.org>
 
        * 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


reply via email to

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