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

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

[nongnu] elpa/mastodon 10be1f9c28 18/18: Merge branch 'develop'


From: ELPA Syncer
Subject: [nongnu] elpa/mastodon 10be1f9c28 18/18: Merge branch 'develop'
Date: Mon, 2 Dec 2024 16:00:35 -0500 (EST)

branch: elpa/mastodon
commit 10be1f9c2845a6012cee84b68dc566ea92df40a6
Merge: cf64163130 ba7e98c29c
Author: marty hiatt <martianhiatus@disroot.org>
Commit: marty hiatt <martianhiatus@disroot.org>

    Merge branch 'develop'
---
 lisp/mastodon-notifications.el | 141 +++++++++++++++++++++++++++++++++--------
 lisp/mastodon-profile.el       |  56 ++++++++++------
 lisp/mastodon-tl.el            |  16 ++---
 lisp/mastodon-widget.el        |  10 +--
 lisp/mastodon.el               | 140 ++++++++++++++++++++--------------------
 mastodon-index.org             |   5 ++
 6 files changed, 240 insertions(+), 128 deletions(-)

diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el
index bd6cb777b1..c3b71beb4f 100644
--- a/lisp/mastodon-notifications.el
+++ b/lisp/mastodon-notifications.el
@@ -32,6 +32,7 @@
 
 (require 'subr-x)
 (require 'cl-lib)
+(require 'mastodon-widget)
 
 (autoload 'mastodon-http--api "mastodon-http")
 (autoload 'mastodon-http--get-params-async-json "mastodon-http")
@@ -62,6 +63,9 @@
 (autoload 'mastodon-tl--image-trans-check "mastodon-tl")
 (autoload 'mastodon-tl--symbol "mastodon-tl")
 (autoload 'mastodon-tl--display-or-uname "mastodon-tl")
+(autoload 'mastodon-tl--goto-next-item "mastodon-tl")
+(autoload 'mastodon-tl--buffer-type-eq "mastodon-tl")
+(autoload 'mastodon-tl--buffer-property "mastodon-tl")
 
 ;; notifications defcustoms moved into mastodon.el
 ;; as some need to be available without loading this file
@@ -75,21 +79,35 @@
 (defvar mastodon-profile-note-in-foll-reqs-max-length)
 (defvar mastodon-group-notifications)
 (defvar mastodon-notifications-grouped-names-count)
+
 (defvar mastodon-notifications--types
-  '("favourite" "reblog" "mention" "poll"
-    "follow_request" "follow" "status" "update"
-    "severed_relationships" "moderation_warning")
-  "A list of notification types according to their name on the server.")
+  '("all" "favourite" "reblog" "mention" "poll"
+    "follow_request" "follow" "status" "update")
+  ;; "severed_relationships" "moderation_warning")
+  "A list of notification types according to their name on the server, plus 
\"all\".")
+
+(defvar mastodon-notifications--filter-types-alist
+  '(("all"                    . mastodon-notifications-get)
+    ("favourite"              . mastodon-notifications--get-favourites)
+    ("reblog"                 . mastodon-notifications--get-boosts)
+    ("mention"                . mastodon-notifications--get-mentions)
+    ("poll"                   . mastodon-notifications--get-polls)
+    ("follow_request"         . mastodon-notifications--get-follow-requests)
+    ("follow"                 . mastodon-notifications--get-follows)
+    ("status"                 . mastodon-notifications--get-statuses)
+    ("update"                 . mastodon-notifications--get-edits))
+  "An alist of notification types and their corresponding load functions.
+Notification types are named according to their name on the server.")
 
 (defvar mastodon-notifications--response-alist
-  '(("Followed" . "you")
-    ("Favourited" . "your post")
-    ("Boosted" . "your post")
-    ("Mentioned" . "you")
-    ("Posted a poll" . "that has now ended")
-    ("Requested to follow" . "you")
-    ("Posted" . "a post")
-    ("Edited" . "their post"))
+  '(("Followed"             . "you")
+    ("Favourited"           . "your post")
+    ("Boosted"              . "your post")
+    ("Mentioned"            . "you")
+    ("Posted a poll"        . "that has now ended")
+    ("Requested to follow"  . "you")
+    ("Posted"               . "a post")
+    ("Edited"               . "their post"))
   "Alist of subjects for notification types.")
 
 (defvar mastodon-notifications--map
@@ -98,6 +116,7 @@
     (define-key map (kbd "a") #'mastodon-notifications--follow-request-accept)
     (define-key map (kbd "j") #'mastodon-notifications--follow-request-reject)
     (define-key map (kbd "C-k") #'mastodon-notifications--clear-current)
+    (define-key map (kbd "C-c C-c") #'mastodon-notifications--cycle-type)
     map)
   "Keymap for viewing notifications.")
 
@@ -171,14 +190,14 @@ Can be called in notifications view or in follow-requests 
view."
   "List of notification types for which grouping is implemented.")
 
 (defvar mastodon-notifications--action-alist
-  '((reblog . "Boosted")
-    (favourite . "Favourited")
-    (follow_request . "Requested to follow")
-    (follow . "Followed")
-    (mention . "Mentioned")
-    (status . "Posted")
-    (poll . "Posted a poll")
-    (update . "Edited"))
+  '((reblog          . "Boosted")
+    (favourite       . "Favourited")
+    (follow_request  . "Requested to follow")
+    (follow          . "Followed")
+    (mention         . "Mentioned")
+    (status          . "Posted")
+    (poll            . "Posted a poll")
+    (update          . "Edited"))
   "Action strings keyed by notification type.
 Types are those of the Mastodon API.")
 
@@ -241,7 +260,7 @@ JSON is a list of alists."
        ;; later on:
        note
        ;; body
-       (mastodon-notifiations--body-arg
+       (mastodon-notifications--body-arg
         type filters status profile-note follower-name)
        ;; action-byline (top)
        (mastodon-notifications--action-byline
@@ -278,7 +297,7 @@ ACCOUNTS is data of the accounts that have reacted to the 
notification."
                follower
              status)
            ;; body
-           (mastodon-notifiations--body-arg
+           (mastodon-notifications--body-arg
             type filters status profile-note follower-name group)
            ;; action-byline
            (mastodon-notifications--action-byline
@@ -313,7 +332,7 @@ NOTE and FOLLOWER-NAME are used for non-grouped notifs."
      (concat action-symbol " " action-authors action-str)
      'byline-top t)))
 
-(defun mastodon-notifiations--body-arg
+(defun mastodon-notifications--body-arg
     (type &optional filters status profile-note follower-name group)
   "TYPE is a symbol, a member of `mastodon-notifiations--types'.
 FILTERS STATUS PROFILE-NOTE FOLLOWER-NAME GROUP."
@@ -463,7 +482,12 @@ NO-GROUP means don't render grouped notifications."
                        (alist-get 'sample_account_ids g)
                        (alist-get 'accounts json))
        for status = (mastodon-notifications--alist-by-value
-                     (alist-get 'status_id g) 'id
+                     (or (alist-get 'status_id g)
+                         ;; if no status_id, just try the first item?
+                         (alist-get 'id
+                                    (car
+                                     (alist-get 'statuses json))))
+                     'id
                      (alist-get 'statuses json))
        do (mastodon-notifications--format-group-note g status accounts)
        (when mastodon-tl--display-media-p
@@ -471,12 +495,60 @@ NO-GROUP means don't render grouped notifications."
          ;; `mastodon-tl--media-attachment', not here
          (mastodon-media--inline-images start-pos (point)))))))
 
-(defun mastodon-notifications--timeline (json)
-  "Format JSON in Emacs buffer."
+(defun mastodon-notifications--timeline (json &optional type)
+  "Format JSON in Emacs buffer.
+Optionally specify TYPE."
   (if (seq-empty-p json)
       (user-error "Looks like you have no (more) notifications for now")
+    (mastodon-widget--create
+     "Filter" mastodon-notifications--types
+     (or type "all")
+     (lambda (widget &rest _ignore)
+       (let ((value (widget-value widget)))
+         (mastodon-notifications--get-type value)))
+     :newline)
+    (insert "\n")
     (mastodon-notifications--render json (not mastodon-group-notifications))
-    (goto-char (point-min))))
+    (goto-char (point-min))
+    (mastodon-tl--goto-next-item)))
+
+(defun mastodon-notifications--get-type (&optional type)
+  "Read a notification type and load its timeline.
+Optionally specify TYPE."
+  (let ((choice (or type
+                    (completing-read
+                     "View notifications: "
+                     mastodon-notifications--filter-types-alist))))
+    (funcall (alist-get
+              choice mastodon-notifications--filter-types-alist
+              nil nil #'equal))))
+
+(defun mastodon-notifications--cycle-type (&optional prefix)
+  "Cycle the current notifications view.
+With arg PREFIX, `completing-read' a type and load it."
+  (interactive "P")
+  ;; FIXME: do we need a sept buffer-type result for all notifs views?
+  (if (not (or (mastodon-tl--buffer-type-eq 'notifications)
+               (mastodon-tl--buffer-type-eq 'mentions)))
+      (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)))
+    (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."
@@ -505,6 +577,21 @@ Status notifications are created when you call
   (interactive)
   (mastodon-notifications-get "status" "statuses"))
 
+(defun mastodon-notifications--get-follows ()
+  "Display follow notifications in buffer."
+  (interactive)
+  (mastodon-notifications-get "follow" "follows"))
+
+(defun mastodon-notifications--get-follow-requests ()
+  "Display follow request notifications in buffer."
+  (interactive)
+  (mastodon-notifications-get "follow_request" "follow-requests"))
+
+(defun mastodon-notifications--get-edits ()
+  "Display edited post notifications in buffer."
+  (interactive)
+  (mastodon-notifications-get "update" "edits"))
+
 (defun mastodon-notifications--filter-types-list (type)
   "Return a list of notification types with TYPE removed."
   (remove type mastodon-notifications--types))
diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el
index a94fd16423..ee3f3d23c1 100644
--- a/lisp/mastodon-profile.el
+++ b/lisp/mastodon-profile.el
@@ -85,6 +85,7 @@
 (autoload 'mastodon-search--query "mastodon-search")
 (autoload 'mastodon-tl--field-status "mastodon-tl")
 (autoload 'mastodon-toot--with-toot-item "mastodon-toot" nil nil 'macro)
+(autoload 'mastodon-tl--toot-or-base "mastodon-tl")
 
 (defvar mastodon-active-user)
 (defvar mastodon-tl--horiz-bar)
@@ -163,22 +164,37 @@ MAX-ID is a flag to include the max_id pagination 
parameter."
 
 ;;; PROFILE VIEW COMMANDS
 
+(defvar mastodon-profile--account-view-alist
+  '(("statuses"     . mastodon-profile--open-statuses)
+    ("no boosts"   . mastodon-profile--open-statuses-no-reblogs)
+    ("no replies"    . mastodon-profile--open-statuses-no-replies)
+    ("only media"   . mastodon-profile--open-statuses-only-media)
+    ("followers"    . mastodon-profile--open-followers)
+    ("following"    . mastodon-profile--open-following)))
+
 ;; TODO: we shd just load all views' data then switch coz this is slow af:
-(defun mastodon-profile--account-view-cycle ()
+(defun mastodon-profile--account-view-cycle (&optional prefix)
   "Cycle through profile view: toots, toot sans boosts, followers, and 
following."
-  (interactive)
-  (cond ((mastodon-tl--buffer-type-eq 'profile-statuses)
-         (mastodon-profile--open-statuses-no-reblogs))
-        ((mastodon-tl--buffer-type-eq 'profile-statuses-no-boosts)
-         (mastodon-profile--open-statuses-no-replies))
-        ((mastodon-tl--buffer-type-eq 'profile-statuses-no-replies)
-         (mastodon-profile--open-statuses-only-media))
-        ((mastodon-tl--buffer-type-eq 'profile-statuses-only-media)
-         (mastodon-profile--open-followers))
-        ((mastodon-tl--buffer-type-eq 'profile-followers)
-         (mastodon-profile--open-following))
-        ((mastodon-tl--buffer-type-eq 'profile-following)
-         (mastodon-profile--make-author-buffer mastodon-profile--account))))
+  (interactive "P")
+  (if prefix
+      (let* ((choice
+              (completing-read "Profile view:"
+                               mastodon-profile--account-view-alist))
+             (fun (alist-get choice mastodon-profile--account-view-alist
+                             nil nil #'equal)))
+        (funcall fun))
+    (cond ((mastodon-tl--buffer-type-eq 'profile-statuses)
+           (mastodon-profile--open-statuses-no-reblogs))
+          ((mastodon-tl--buffer-type-eq 'profile-statuses-no-boosts)
+           (mastodon-profile--open-statuses-no-replies))
+          ((mastodon-tl--buffer-type-eq 'profile-statuses-no-replies)
+           (mastodon-profile--open-statuses-only-media))
+          ((mastodon-tl--buffer-type-eq 'profile-statuses-only-media)
+           (mastodon-profile--open-followers))
+          ((mastodon-tl--buffer-type-eq 'profile-followers)
+           (mastodon-profile--open-following))
+          ((mastodon-tl--buffer-type-eq 'profile-following)
+           (mastodon-profile--open-statuses)))))
 
 (defun mastodon-profile--open-statuses ()
   "Open a profile showing statuses."
@@ -795,13 +811,15 @@ the format \"2000-01-31T00:00:00.000Z\"."
 
 (defun mastodon-profile--get-toot-author (&optional max-id)
   "Open profile of author of toot under point.
-If toot is a boost, opens the profile of the booster.
+If toot is a boost, load the profile of the author of the original item.
 MAX-ID is a flag to include the max_id pagination parameter."
   (interactive)
-  (mastodon-toot--with-toot-item
-   (mastodon-profile--make-author-buffer
-    (alist-get 'account (mastodon-profile--item-json))
-    nil nil nil nil max-id)))
+  (mastodon-tl--do-if-item
+   (let ((json (mastodon-tl--toot-or-base
+                (mastodon-profile--item-json))))
+     (mastodon-profile--make-author-buffer
+      (alist-get 'account json)
+      nil nil nil nil max-id))))
 
 (defun mastodon-profile--image-from-account (account img-type)
   "Return a avatar image from ACCOUNT.
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 4a46cc27f8..763569bbb0 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -2985,7 +2985,7 @@ Aims to respect any pagination in effect."
           ((eq type 'thread)
            (let ((id (mastodon-tl--buffer-property
                       'thread-item-id (current-buffer) :no-error)))
-             (mastodon-tl--thread id))))
+             (mastodon-tl--thread-do id))))
     ;; TODO: sends point to where point was in buffer. This is very rough; we
     ;; may have removed an item , so the buffer will be smaller, point will
     ;; end up past where we were, etc.
@@ -3374,11 +3374,9 @@ VIEW-NAME is a string, to be used as a heading for the 
view.
 BINDING-STR is a string explaining any bindins in the view.
 ENDPOINT-VERSION is a string, format Vx, e.g. V2."
   ;; Used by `mastodon-notifications-get' and in views.el
-  (let* ((exclude-types (when note-type
-                          (mastodon-notifications--filter-types-list 
note-type)))
-         (notes-params (when note-type
+  (let* ((notes-params (when note-type
                          (mastodon-http--build-array-params-alist
-                          "exclude_types[]" exclude-types)))
+                          "types[]" (list note-type))))
          (params (append notes-params params))
          (url (mastodon-http--api endpoint endpoint-version))
          (buffer (concat "*mastodon-" buffer-name "*"))
@@ -3399,10 +3397,10 @@ ENDPOINT-VERSION is a string, format Vx, e.g. V2."
        link-header params nil
        ;; awful hack to fix multiple reloads:
        (alist-get "max_id" params nil nil #'string=))
-      (mastodon-tl--do-init json update-function)
+      (mastodon-tl--do-init json update-function nil nil note-type)
       buffer)))
 
-(defun mastodon-tl--do-init (json update-fun &optional domain no-byline)
+(defun mastodon-tl--do-init (json update-fun &optional domain no-byline type)
   "Utility function for `mastodon-tl--init*' and `mastodon-tl--init-sync'.
 JSON is the data to call UPDATE-FUN on.
 When DOMAIN, force inclusion of user's domain in their handle.
@@ -3410,6 +3408,7 @@ NO-BYLINE means just insert toot body, used for 
announcements."
   (remove-overlays) ; video overlays
   (cond (domain ;; maybe our update-fun doesn't always have 3 args...:
          (funcall update-fun json nil domain))
+        (type (funcall update-fun json type)) ;; notif types
         (no-byline (funcall update-fun json nil nil no-byline))
         (t (funcall update-fun json)))
   (setq
@@ -3438,7 +3437,8 @@ NO-BYLINE means just insert toot body, used for 
announcements."
 RECORD is the bookmark record."
   (let ((id (bookmark-prop-get record 'id)))
     ;; we need to handle thread and single toot for starters
-    (pop-to-buffer (mastodon-tl--thread id))))
+    (pop-to-buffer
+     (mastodon-tl--thread-do id))))
 
 (defun mastodon-tl--bookmark-make-record ()
   "Return a bookmark record for the current mastodon buffer."
diff --git a/lisp/mastodon-widget.el b/lisp/mastodon-widget.el
index a5766722cb..e9376d8a2e 100644
--- a/lisp/mastodon-widget.el
+++ b/lisp/mastodon-widget.el
@@ -54,16 +54,18 @@ Note that such modes will need to require wid-edit.")
            collect `(choice-item :value ,x :format "%[%v%] "
                                  :keymap ,mastodon-widget-keymap)))
 
-(defun mastodon-widget--format (str &optional padding)
+(defun mastodon-widget--format (str &optional padding newline)
   "Return a widget format string for STR, its name.
 PADDING is an integer, for how much right-side padding to add."
   (concat "%[" (propertize str
                            'face 'mastodon-widget-face
                            'mastodon-tab-stop t)
           "%]: %v"
-          (make-string padding ? )))
+          (make-string padding ? )
+          (if newline "\n" "")))
 
-(defun mastodon-widget--create (kind type value notify-fun)
+(defun mastodon-widget--create (kind type value notify-fun
+                                     &optional newline)
   "Return a widget of KIND, with TYPE elements, and default VALUE.
 KIND is a string, either Listing, Sort, Items, or Inbox, and will
 be used for the widget's tag.
@@ -89,7 +91,7 @@ NOTIFY-FUN is the widget's notify function."
        :value value
        :args (mastodon-widget--return-item-widgets type-list)
        :help-echo (format "Select a %s kind" kind)
-       :format (mastodon-widget--format kind padding)
+       :format (mastodon-widget--format kind padding newline)
        :notify notify-fun
        ;; eg format of notify-fun:
        ;; (lambda (widget &rest ignore)
diff --git a/lisp/mastodon.el b/lisp/mastodon.el
index b1147dc9ce..c0bbd5c310 100644
--- a/lisp/mastodon.el
+++ b/lisp/mastodon.el
@@ -6,7 +6,7 @@
 ;; Author: Johnson Denen <johnson.denen@gmail.com>
 ;;         Marty Hiatt <mousebot@disroot.org>
 ;; Maintainer: Marty Hiatt <mousebot@disroot.org>
-;; Version: 1.1.5
+;; Version: 1.1.7
 ;; Package-Requires: ((emacs "28.1") (request "0.3.0") (persist "0.4") (tp 
"0.6"))
 ;; Homepage: https://codeberg.org/martianh/mastodon.el
 
@@ -194,85 +194,85 @@ and X others...\"."
 (defvar mastodon-mode-map
   (let ((map (make-sparse-keymap)))
     ;; navigation inside a timeline
-    (define-key map (kbd "n") #'mastodon-tl--goto-next-item)
-    (define-key map (kbd "p") #'mastodon-tl--goto-prev-item)
-    (define-key map (kbd "M-n") #'mastodon-tl--next-tab-item)
-    (define-key map (kbd "M-p") #'mastodon-tl--previous-tab-item)
-    (define-key map [?\t] #'mastodon-tl--next-tab-item)
-    (define-key map [backtab] #'mastodon-tl--previous-tab-item)
-    (define-key map [?\S-\t] #'mastodon-tl--previous-tab-item)
-    (define-key map [?\M-\t] #'mastodon-tl--previous-tab-item)
-    (define-key map (kbd "l") #'recenter-top-bottom)
+    (define-key map (kbd "n")      #'mastodon-tl--goto-next-item)
+    (define-key map (kbd "p")      #'mastodon-tl--goto-prev-item)
+    (define-key map (kbd "M-n")    #'mastodon-tl--next-tab-item)
+    (define-key map (kbd "M-p")    #'mastodon-tl--previous-tab-item)
+    (define-key map [?\t]          #'mastodon-tl--next-tab-item)
+    (define-key map [backtab]      #'mastodon-tl--previous-tab-item)
+    (define-key map [?\S-\t]       #'mastodon-tl--previous-tab-item)
+    (define-key map [?\M-\t]       #'mastodon-tl--previous-tab-item)
+    (define-key map (kbd "l")      #'recenter-top-bottom)
     ;; navigation between timelines
-    (define-key map (kbd "#") #'mastodon-tl--get-tag-timeline)
-    (define-key map (kbd "\"") #'mastodon-tl--list-followed-tags)
-    (define-key map (kbd "'") #'mastodon-tl--followed-tags-timeline)
-    (define-key map (kbd "A") #'mastodon-profile--get-toot-author)
-    (define-key map (kbd "F") #'mastodon-tl--get-federated-timeline)
-    (define-key map (kbd "H") #'mastodon-tl--get-home-timeline)
-    (define-key map (kbd "L") #'mastodon-tl--get-local-timeline)
-    (define-key map (kbd "N") #'mastodon-notifications-get)
-    (define-key map (kbd "@") #'mastodon-notifications--get-mentions)
-    (define-key map (kbd "P") #'mastodon-profile--show-user)
-    (define-key map (kbd "s") #'mastodon-search--query)
-    (define-key map (kbd "/") #'mastodon-switch-to-buffer)
-    (define-key map (kbd "\\") #'mastodon-tl--get-remote-local-timeline)
+    (define-key map (kbd "#")      #'mastodon-tl--get-tag-timeline)
+    (define-key map (kbd "\"")     #'mastodon-tl--list-followed-tags)
+    (define-key map (kbd "'")      #'mastodon-tl--followed-tags-timeline)
+    (define-key map (kbd "A")      #'mastodon-profile--get-toot-author)
+    (define-key map (kbd "F")      #'mastodon-tl--get-federated-timeline)
+    (define-key map (kbd "H")      #'mastodon-tl--get-home-timeline)
+    (define-key map (kbd "L")      #'mastodon-tl--get-local-timeline)
+    (define-key map (kbd "N")      #'mastodon-notifications-get)
+    (define-key map (kbd "@")      #'mastodon-notifications--get-mentions)
+    (define-key map (kbd "P")      #'mastodon-profile--show-user)
+    (define-key map (kbd "s")      #'mastodon-search--query)
+    (define-key map (kbd "/")      #'mastodon-switch-to-buffer)
+    (define-key map (kbd "\\")     #'mastodon-tl--get-remote-local-timeline)
     ;; quitting mastodon
-    (define-key map (kbd "q") #'kill-current-buffer)
-    (define-key map (kbd "Q") #'mastodon-kill-window)
-    (define-key map (kbd "M-C-q") #'mastodon-kill-all-buffers)
+    (define-key map (kbd "q")      #'kill-current-buffer)
+    (define-key map (kbd "Q")      #'mastodon-kill-window)
+    (define-key map (kbd "M-C-q")  #'mastodon-kill-all-buffers)
     ;; toot actions
-    (define-key map (kbd "c") #'mastodon-tl--toggle-spoiler-text-in-toot)
-    (define-key map (kbd "b") #'mastodon-toot--toggle-boost)
-    (define-key map (kbd "f") #'mastodon-toot--toggle-favourite)
-    (define-key map (kbd "k") #'mastodon-toot--toggle-bookmark)
-    (define-key map (kbd "r") #'mastodon-toot--reply)
-    (define-key map (kbd "C") #'mastodon-toot--copy-toot-url)
-    (define-key map (kbd "o") #'mastodon-toot--open-toot-url)
-    (define-key map (kbd "v") #'mastodon-tl--poll-vote)
-    (define-key map (kbd "E") #'mastodon-toot--view-toot-edits)
-    (define-key map (kbd "T") #'mastodon-tl--thread)
-    (define-key map (kbd "RET") #'mastodon-tl--thread)
-    (define-key map (kbd "m") #'mastodon-tl--dm-user)
+    (define-key map (kbd "c")      #'mastodon-tl--toggle-spoiler-text-in-toot)
+    (define-key map (kbd "b")      #'mastodon-toot--toggle-boost)
+    (define-key map (kbd "f")      #'mastodon-toot--toggle-favourite)
+    (define-key map (kbd "k")      #'mastodon-toot--toggle-bookmark)
+    (define-key map (kbd "r")      #'mastodon-toot--reply)
+    (define-key map (kbd "C")      #'mastodon-toot--copy-toot-url)
+    (define-key map (kbd "o")      #'mastodon-toot--open-toot-url)
+    (define-key map (kbd "v")      #'mastodon-tl--poll-vote)
+    (define-key map (kbd "E")      #'mastodon-toot--view-toot-edits)
+    (define-key map (kbd "T")      #'mastodon-tl--thread)
+    (define-key map (kbd "RET")    #'mastodon-tl--thread)
+    (define-key map (kbd "m")      #'mastodon-tl--dm-user)
     (when (require 'lingva nil :no-error)
-      (define-key map (kbd "a") #'mastodon-toot--translate-toot-text))
-    (define-key map (kbd ",") #'mastodon-toot--list-favouriters)
-    (define-key map (kbd ".") #'mastodon-toot--list-boosters)
-    (define-key map (kbd ";") #'mastodon-views--view-instance-description)
+      (define-key map (kbd "a")    #'mastodon-toot--translate-toot-text))
+    (define-key map (kbd ",")      #'mastodon-toot--list-favouriters)
+    (define-key map (kbd ".")      #'mastodon-toot--list-boosters)
+    (define-key map (kbd ";")      #'mastodon-views--view-instance-description)
     ;; override special mode binding
-    (define-key map (kbd "g") #'undefined)
-    (define-key map (kbd "g") #'mastodon-tl--update)
+    (define-key map (kbd "g")      #'undefined)
+    (define-key map (kbd "g")      #'mastodon-tl--update)
     ;; this is now duplicated by 'g', cd remove/use for else:
-    (define-key map (kbd "u") #'mastodon-tl--update)
+    (define-key map (kbd "u")      #'mastodon-tl--update)
     ;; own toot actions:
-    (define-key map (kbd "t") #'mastodon-toot)
-    (define-key map (kbd "d") #'mastodon-toot--delete-toot)
-    (define-key map (kbd "D") #'mastodon-toot--delete-and-redraft-toot)
-    (define-key map (kbd "i") #'mastodon-toot--pin-toot-toggle)
-    (define-key map (kbd "e") #'mastodon-toot--edit-toot-at-point)
+    (define-key map (kbd "t")      #'mastodon-toot)
+    (define-key map (kbd "d")      #'mastodon-toot--delete-toot)
+    (define-key map (kbd "D")      #'mastodon-toot--delete-and-redraft-toot)
+    (define-key map (kbd "i")      #'mastodon-toot--pin-toot-toggle)
+    (define-key map (kbd "e")      #'mastodon-toot--edit-toot-at-point)
     ;; user actions
-    (define-key map (kbd "W") #'mastodon-tl--follow-user)
-    (define-key map (kbd "C-S-W") #'mastodon-tl--unfollow-user)
-    (define-key map (kbd "B") #'mastodon-tl--block-user)
-    (define-key map (kbd "C-S-B") #'mastodon-tl--unblock-user)
-    (define-key map (kbd "M") #'mastodon-tl--mute-user)
-    (define-key map (kbd "C-S-M") #'mastodon-tl--unmute-user)
-    (define-key map (kbd "Z") #'mastodon-tl--report-to-mods)
+    (define-key map (kbd "W")      #'mastodon-tl--follow-user)
+    (define-key map (kbd "C-S-W")  #'mastodon-tl--unfollow-user)
+    (define-key map (kbd "B")      #'mastodon-tl--block-user)
+    (define-key map (kbd "C-S-B")  #'mastodon-tl--unblock-user)
+    (define-key map (kbd "M")      #'mastodon-tl--mute-user)
+    (define-key map (kbd "C-S-M")  #'mastodon-tl--unmute-user)
+    (define-key map (kbd "Z")      #'mastodon-tl--report-to-mods)
     ;; own profile
-    (define-key map (kbd "O") #'mastodon-profile--my-profile)
-    (define-key map (kbd "U") #'mastodon-profile--update-user-profile-note)
-    (define-key map (kbd "V") #'mastodon-profile--view-favourites)
-    (define-key map (kbd "K") #'mastodon-profile--view-bookmarks)
-    (define-key map (kbd ":") #'mastodon-user-settings)
+    (define-key map (kbd "O")      #'mastodon-profile--my-profile)
+    (define-key map (kbd "U")      
#'mastodon-profile--update-user-profile-note)
+    (define-key map (kbd "V")      #'mastodon-profile--view-favourites)
+    (define-key map (kbd "K")      #'mastodon-profile--view-bookmarks)
+    (define-key map (kbd ":")      #'mastodon-user-settings)
     ;; minor views
-    (define-key map (kbd "R") #'mastodon-views--view-follow-requests)
-    (define-key map (kbd "S") #'mastodon-views--view-scheduled-toots)
-    (define-key map (kbd "I") #'mastodon-views--view-filters)
-    (define-key map (kbd "G") #'mastodon-views--view-follow-suggestions)
-    (define-key map (kbd "X") #'mastodon-views--view-lists)
-    (define-key map (kbd "SPC") #'mastodon-tl--scroll-up-command)
-    (define-key map (kbd "!") #'mastodon-tl--fold-post-toggle)
-    (define-key map (kbd "z") #'bury-buffer)
+    (define-key map (kbd "R")      #'mastodon-views--view-follow-requests)
+    (define-key map (kbd "S")      #'mastodon-views--view-scheduled-toots)
+    (define-key map (kbd "I")      #'mastodon-views--view-filters)
+    (define-key map (kbd "G")      #'mastodon-views--view-follow-suggestions)
+    (define-key map (kbd "X")      #'mastodon-views--view-lists)
+    (define-key map (kbd "SPC")    #'mastodon-tl--scroll-up-command)
+    (define-key map (kbd "!")      #'mastodon-tl--fold-post-toggle)
+    (define-key map (kbd "z")      #'bury-buffer)
     map)
   "Keymap for `mastodon-mode'.")
 
diff --git a/mastodon-index.org b/mastodon-index.org
index 7e5d2a7986..3289816c1f 100644
--- a/mastodon-index.org
+++ b/mastodon-index.org
@@ -57,14 +57,19 @@
 |                  | mastodon-mode                                     | Major 
mode for fediverse services using the Mastodon API.                      |
 |                  | mastodon-notifications--clear-all                 | Clear 
all notifications.                                                       |
 | C-k              | mastodon-notifications--clear-current             | 
Dismiss the notification at point.                                             |
+|                  | mastodon-notifications--cycle-type                | Cycle 
the current notifications view.                                          |
 |                  | mastodon-notifications--follow-request-accept     | 
Accept a follow request.                                                       |
 | j                | mastodon-notifications--follow-request-reject     | 
Reject a follow request.                                                       |
 |                  | mastodon-notifications--get-boosts                | 
Display boost notifications in buffer.                                         |
+|                  | mastodon-notifications--get-edits                 | 
Display edited post notifications in buffer.                                   |
 |                  | mastodon-notifications--get-favourites            | 
Display favourite notifications in buffer.                                     |
+|                  | mastodon-notifications--get-follow-requests       | 
Display follow request notifications in buffer.                                |
+|                  | mastodon-notifications--get-follows               | 
Display follow notifications in buffer.                                        |
 | @                | mastodon-notifications--get-mentions              | 
Display mention notifications in buffer.                                       |
 |                  | mastodon-notifications--get-polls                 | 
Display poll notifications in buffer.                                          |
 |                  | mastodon-notifications--get-single-notif          | 
Return a single notification JSON for v2 notifs.                               |
 |                  | mastodon-notifications--get-statuses              | 
Display status notifications in buffer.                                        |
+|                  | mastodon-notifications--get-type                  | Read 
a notification type and load its timeline.                                |
 | N                | mastodon-notifications-get                        | 
Display NOTIFICATIONS in buffer.                                               |
 |                  | mastodon-profile--account-bot-toggle              | 
Toggle the bot status of your account.                                         |
 |                  | mastodon-profile--account-discoverable-toggle     | 
Toggle the discoverable status of your account.                                |



reply via email to

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