[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/rcirc-menu 7d9cd61 02/13: rcirc-menu.el: add catching u
From: |
Stefan Monnier |
Subject: |
[elpa] externals/rcirc-menu 7d9cd61 02/13: rcirc-menu.el: add catching up and updating |
Date: |
Tue, 1 Dec 2020 16:56:11 -0500 (EST) |
branch: externals/rcirc-menu
commit 7d9cd61f97d1a8b3a95fd2e440c90d8a379a263a
Author: Alex Schroeder <alex@gnu.org>
Commit: Alex Schroeder <alex@gnu.org>
rcirc-menu.el: add catching up and updating
c and C will now mark a buffer as read. Changes to the rcirc activity
string will also update the menu buffer.
---
rcirc-menu.el | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/rcirc-menu.el b/rcirc-menu.el
index b490f39..6905130 100644
--- a/rcirc-menu.el
+++ b/rcirc-menu.el
@@ -66,6 +66,8 @@
(define-key map (kbd "M-s a C-s") 'Buffer-menu-isearch-buffers)
(define-key map (kbd "M-s a M-C-s") 'Buffer-menu-isearch-buffers-regexp)
(define-key map (kbd "M-s a C-o") 'Buffer-menu-multi-occur)
+ (define-key map "c" 'rcirc-menu-catchup)
+ (define-key map "C" 'rcirc-menu-catchup-all)
(define-key map [mouse-2] 'Buffer-menu-mouse-select)
(define-key map [follow-link] 'mouse-face)
@@ -78,6 +80,13 @@
'(menu-item "Refresh" revert-buffer
:help "Refresh the *Rcirc Menu* buffer contents"))
(bindings--define-key menu-map [s0] menu-bar-separator)
+ (bindings--define-key menu-map [cata]
+ '(menu-item "Catch up All" rcirc-menu-catchup-all
+ :help "Mark all buffers as read"))
+ (bindings--define-key menu-map [cat]
+ '(menu-item "Catch up" rcirc-menu-catchup
+ :help "Mark this buffer as read"))
+ (bindings--define-key menu-map [s1] menu-bar-separator)
(bindings--define-key menu-map [sel]
'(menu-item "Select Marked" Buffer-menu-select
:help "Select this line's buffer; also display buffers marked
with `>'"))
@@ -217,4 +226,31 @@ elements of ‘tabulated-list-entries’."
args))
(apply '< args))
+(defun rcirc-menu-catchup ()
+ "Mark the current buffer as read, i.e. no activity."
+ (interactive)
+ (rcirc-clear-activity (Buffer-menu-buffer t))
+ (run-hooks 'tabulated-list-revert-hook)
+ (tabulated-list-print))
+
+(defun rcirc-menu-catchup-all ()
+ "Mark all the buffers as read, i.e. no activity."
+ (interactive)
+ (dolist (buf (buffer-list))
+ (with-current-buffer buf
+ (when rcirc-activity-types
+ (rcirc-clear-activity buf))))
+ (run-hooks 'tabulated-list-revert-hook)
+ ;; don't move point
+ (tabulated-list-print))
+
+(add-hook 'rcirc-update-activity-string-hook
+ 'rcirc-menu-update)
+
+(defun rcirc-menu-update ()
+ "Update the Rcirc Menu buffer, if any."
+ (with-current-buffer (get-buffer-create "*Rcirc Menu*")
+ ;; this will move point
+ (tabulated-list-revert)))
+
;;; rcirc-menu.el ends here
- [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 <=
- [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, 2020/12/01
- [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