[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/rcirc-menu e5cd887 10/13: rcirc-menu: reset activity st
From: |
Stefan Monnier |
Subject: |
[elpa] externals/rcirc-menu e5cd887 10/13: rcirc-menu: reset activity string when catching up |
Date: |
Tue, 1 Dec 2020 16:56:12 -0500 (EST) |
branch: externals/rcirc-menu
commit e5cd88718503dd2d93a281ea62ee3236fdb716ec
Author: Alex Schroeder <alex@gnu.org>
Commit: Alex Schroeder <alex@gnu.org>
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.
---
rcirc-menu.el | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/rcirc-menu.el b/rcirc-menu.el
index 4e13f893..e7cf0e3 100644
--- a/rcirc-menu.el
+++ b/rcirc-menu.el
@@ -5,7 +5,7 @@
;; Author: Alex Schroeder <alex@gnu.org>
;; Maintainer: Alex Schroeder <alex@gnu.org>
;; 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
- [elpa] branch externals/rcirc-menu created (now e25dbac), Stefan Monnier, 2020/12/01
- [elpa] externals/rcirc-menu bd5b548 01/13: Add rcirc-menu, Stefan Monnier, 2020/12/01
- [elpa] externals/rcirc-menu 7d9cd61 02/13: rcirc-menu.el: add catching up and updating, Stefan Monnier, 2020/12/01
- [elpa] externals/rcirc-menu 4e9c6d1 03/13: rcirc-menu.el: make rcirc-menu-update more resilient, Stefan Monnier, 2020/12/01
- [elpa] externals/rcirc-menu f1e0d9f 04/13: rcirc-menu.el: catchup marked buffers, Stefan Monnier, 2020/12/01
- [elpa] externals/rcirc-menu 3372cf1 07/13: rcirc-menu.el: explain what T and P are, Stefan Monnier, 2020/12/01
- [elpa] externals/rcirc-menu a02d79a 09/13: rcirc-menu: fix tabulated lists everywhere, Stefan Monnier, 2020/12/01
- [elpa] externals/rcirc-menu e5cd887 10/13: rcirc-menu: reset activity string when catching up,
Stefan Monnier <=
- [elpa] externals/rcirc-menu 0a5a113 05/13: rcirc-menu.el: fontify activity column, Stefan Monnier, 2020/12/01
- [elpa] externals/rcirc-menu 56794b4 06/13: rcirc-menu.el: guess target when rcirc-target is nil, Stefan Monnier, 2020/12/01
- [elpa] externals/rcirc-menu add03f4 08/13: * rcirc-menu, rcirc-color: Fix copyright, Stefan Monnier, 2020/12/01
- [elpa] externals/rcirc-menu 40eb60c 11/13: rcirc-menu: server buffer activity sorts lower, Stefan Monnier, 2020/12/01
- [elpa] externals/rcirc-menu e25dbac 13/13: * .gitignore: New file, Stefan Monnier, 2020/12/01
- [elpa] externals/rcirc-menu 01ce122 12/13: * packages/rcirc-menu/rcirc-menu.el: Fix first line, Stefan Monnier, 2020/12/01