[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/mastodon 7bc28cc75f 12/18: add prefix and view check to no
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/mastodon 7bc28cc75f 12/18: add prefix and view check to notif cycle |
Date: |
Mon, 2 Dec 2024 16:00:34 -0500 (EST) |
branch: elpa/mastodon
commit 7bc28cc75f68f4179c55063d80325b8b3647f5d4
Author: marty hiatt <martianhiatus@disroot.org>
Commit: marty hiatt <martianhiatus@disroot.org>
add prefix and view check to notif cycle
---
lisp/mastodon-notifications.el | 35 +++++++++++++++++++++++------------
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el
index 6a67fa8e24..2dff11f576 100644
--- a/lisp/mastodon-notifications.el
+++ b/lisp/mastodon-notifications.el
@@ -509,7 +509,6 @@ NO-GROUP means don't render grouped notifications."
(defun mastodon-notifications--get-type (&optional type)
"Read a notification type and load its timeline."
- (interactive)
(let ((choice (or type
(completing-read
"View notifications: "
@@ -518,19 +517,31 @@ NO-GROUP means don't render grouped notifications."
choice mastodon-notifications--filter-types-alist
nil nil #'equal))))
-(defun mastodon-notifications--cycle-type ()
- "Cycle the current notifications view."
- (interactive)
+(defun mastodon-notifications--cycle-type (&optional prefix)
+ "Cycle the current notifications view.
+With a prefix arg, completing-read a type and load it."
+ (interactive "P")
+ ;; FIXME: do we need a sept buffer-type result for all notifs views?
+ (if (not (mastodon-tl--buffer-type-eq 'notifications))
+ (user-error "Not in a notifications view.")
+ (let* ((choice
+ (if prefix
+ (completing-read "Notifs by type: "
+ mastodon-notifications--types)
+ (mastodon-notifications--get-next-type)))
+ (fun (alist-get choice mastodon-notifications--filter-types-alist
+ nil nil #'equal)))
+ (funcall fun))))
+
+(defun mastodon-notifications--get-next-type ()
+ "Return the next notif type based on current buffer spec."
(let* ((update-params (mastodon-tl--buffer-property
'update-params nil :no-error))
- (type (alist-get "types[]" update-params nil nil #'equal))
- (next (if (not update-params)
- (cadr mastodon-notifications--types)
- (or (cadr (member type mastodon-notifications--types))
- (car mastodon-notifications--types))))
- (fun (alist-get next mastodon-notifications--filter-types-alist
- nil nil #'equal)))
- (funcall fun)))
+ (type (alist-get "types[]" update-params nil nil #'equal)))
+ (if (not update-params)
+ (cadr mastodon-notifications--types)
+ (or (cadr (member type mastodon-notifications--types))
+ (car mastodon-notifications--types)))))
(defun mastodon-notifications--get-mentions ()
"Display mention notifications in buffer."
- [nongnu] elpa/mastodon updated (cf64163130 -> 10be1f9c28), ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon 2cfaf7458c 01/18: prefix for profile cycle completing-read. FIX #624., ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon 7b98a4ca2a 02/18: notifs: typo in fun name prefix, ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon 7bc28cc75f 12/18: add prefix and view check to notif cycle,
ELPA Syncer <=
- [nongnu] elpa/mastodon 12d174dfd3 06/18: thread-do on reload after reply and bookmark load. FIX #625, ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon a472f873a3 09/18: add widget to notifs view., ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon 1545f3b78e 05/18: get-toot-author: never get booster profile. #630., ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon e9f77777dd 11/18: add cycle notif function. FIX #628., ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon 10be1f9c28 18/18: Merge branch 'develop', ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon 95d06a03eb 15/18: flycheck notifs.el, ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon 241d26dc1f 10/18: notif types: use types[] not exclude_types[], ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon be4a64a4ff 13/18: index, ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon ba7e98c29c 17/18: bump, ELPA Syncer, 2024/12/02
- [nongnu] elpa/mastodon 08307fee1b 14/18: notifs: require mastodon-widget, ELPA Syncer, 2024/12/02