emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master 2206eff: rcirc-menu: reset activity string when catching u


From: Alex Schroeder
Subject: [elpa] master 2206eff: rcirc-menu: reset activity string when catching up
Date: Mon, 21 Aug 2017 03:40:19 -0400 (EDT)

branch: master
commit 2206eff3120390b12aae19609755dc33ed031750
Author: Alex Schroeder <address@hidden>
Commit: Alex Schroeder <address@hidden>

    rcirc-menu: reset activity string when catching up
    
    The rcirc activity string only gets updated when there is any new
    activity to record, or the window configuration changes. This is
    particularly noticeable after doing a catchup all for the rcirc-menu:
    the activity string in the modeline might remain unchanged for quite a
    while. This commit calls rcirc-update-activity-string after catching
    up and makes sure that rcirc-update-activity-string-hook is bound to a
    value without rcirc-menu-update while doing so, in order to prevent
    the rcirc-menu-update from calling tabulated-list-revert because we
    don't like to revert. Reverting moves point and the existing catchup
    code carefully avoids it by calling tabulated-list-print without the
    remember-pos argument.
---
 packages/rcirc-menu/rcirc-menu.el | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/packages/rcirc-menu/rcirc-menu.el 
b/packages/rcirc-menu/rcirc-menu.el
index 4e13f89..e7cf0e3 100644
--- a/packages/rcirc-menu/rcirc-menu.el
+++ b/packages/rcirc-menu/rcirc-menu.el
@@ -5,7 +5,7 @@
 ;; Author: Alex Schroeder <address@hidden>
 ;; Maintainer: Alex Schroeder <address@hidden>
 ;; Created: 2017-08-10
-;; Version: 1.0
+;; Version: 1.1
 ;; Keywords: comm
 
 ;; This file is part of GNU Emacs.
@@ -268,8 +268,7 @@ This resets their activity."
         (buffers (or marked-buffers this-buffer)))
     (dolist (buf buffers)
       (rcirc-clear-activity buf)))
-  (run-hooks 'tabulated-list-revert-hook)
-  (tabulated-list-print))
+  (rcirc-menu-catchup-finish))
 
 (defun rcirc-menu-catchup-all ()
   "Mark all the buffers as read, i.e. no activity."
@@ -278,8 +277,17 @@ This resets their activity."
     (with-current-buffer buf
       (when rcirc-activity-types
        (rcirc-clear-activity buf))))
+  (rcirc-menu-catchup-finish))
+
+(defun rcirc-menu-catchup-finish ()
+  "Update buffer and activity string after catching up."
+  ;; Don't call rcirc-menu-update which reverts the tabulated list.
+  (let ((rcirc-update-activity-string-hook
+        (delete 'rcirc-menu-update rcirc-update-activity-string-hook)))
+    (rcirc-update-activity-string))
+  ;; These two are from `tabulated-list-revert' but we don't want to
+  ;; move point.
   (run-hooks 'tabulated-list-revert-hook)
-  ;; don't move point
   (tabulated-list-print))
 
 (add-hook 'rcirc-update-activity-string-hook



reply via email to

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