unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Tom Tromey <tom@tromey.com>
Cc: 18510@debbugs.gnu.org
Subject: bug#18510: 24.4.50; ERC doesn't update mode line frequently enough
Date: Fri, 19 Sep 2014 14:37:07 -0400	[thread overview]
Message-ID: <jwv8ulf5v3v.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <jwvpper5xq7.fsf-monnier+emacsbugs@gnu.org> (Stefan Monnier's message of "Fri, 19 Sep 2014 13:25:40 -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'."






  reply	other threads:[~2014-09-19 18:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-19 14:28 bug#18510: 24.4.50; ERC doesn't update mode line frequently enough Tom Tromey
2014-09-19 17:25 ` Stefan Monnier
2014-09-19 18:37   ` Stefan Monnier [this message]
2014-09-24 13:20     ` Stefan Monnier
2014-09-24 16:37       ` Tom Tromey
2014-09-24 17:32         ` Stefan Monnier
2014-10-11 13:30           ` Ivan Shmakov
2014-10-15  1:16             ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv8ulf5v3v.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=18510@debbugs.gnu.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).