GNU bug report logs - #18510
24.4.50; ERC doesn't update mode line frequently enough

Previous Next

Package: emacs;

Reported by: Tom Tromey <tom <at> tromey.com>

Date: Fri, 19 Sep 2014 14:30:04 UTC

Severity: normal

Found in version 24.4.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 18510 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Tom Tromey <tom <at> tromey.com>
Cc: 18510 <at> debbugs.gnu.org
Subject: Re: bug#18510: 24.4.50; ERC doesn't update mode line frequently enough
Date: Fri, 19 Sep 2014 14:37:07 -0400
>> I've worked around it locally by advising erc-update-mode-line to call
>> (force-mode-line-update t).
> That's not a workaround, that's a fix.

Hmm... not sure what that was about, sorry.  Of course, the
(force-mode-line-update t) should only be called when changing
a variable that's visible in the global mode-line-format.

Does the patch below work?
[ I assume the problem is also present in 24.3.93.  ]


        Stefan


=== modified file 'lisp/erc/erc-track.el'
--- lisp/erc/erc-track.el	2014-02-10 01:34:22 +0000
+++ lisp/erc/erc-track.el	2014-09-19 18:34:57 +0000
@@ -767,8 +765,7 @@
 		  (erc-modified-channels-remove-buffer buffer))))
 	    erc-modified-channels-alist)
       (when removed-channel
-	(erc-modified-channels-display)
-	(force-mode-line-update t)))
+	(erc-modified-channels-display)))
     (remove-hook 'post-command-hook 'erc-modified-channels-update)))
 
 (defvar erc-track-mouse-face (if (featurep 'xemacs)
@@ -825,9 +822,10 @@
 	((eq 'importance erc-track-switch-direction)
 	 (erc-track-sort-by-importance)))
   (run-hooks 'erc-track-list-changed-hook)
-  (unless (eq erc-track-position-in-mode-line nil)
-  (if (null erc-modified-channels-alist)
-      (setq erc-modified-channels-object (erc-modified-channels-object nil))
+  (when erc-track-position-in-mode-line
+    (let* ((oldobject erc-modified-channels-object)
+	   (strings
+	    (when erc-modified-channels-alist
     ;; erc-modified-channels-alist contains all the data we need.  To
     ;; better understand what is going on, we split things up into
     ;; four lists: BUFFERS, COUNTS, SHORT-NAMES, and FACES.  These
@@ -858,10 +856,11 @@
 	      buffers (cdr buffers)
 	      counts (cdr counts)
 	      faces (cdr faces)))
-      (when (featurep 'xemacs)
-	(erc-modified-channels-object nil))
-      (setq erc-modified-channels-object
-	    (erc-modified-channels-object strings))))))
+		strings)))
+	   (newobject (erc-modified-channels-object strings)))
+      (unless (equal oldobject newobject)
+	(setq erc-modified-channels-object newobject)
+	(force-mode-line-update t)))))
 
 (defun erc-modified-channels-remove-buffer (buffer)
   "Remove BUFFER from `erc-modified-channels-alist'."





This bug report was last modified 10 years and 278 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.