aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-08-29 16:05:54 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-08-29 16:05:54 +0200
commit7146bddc60712f3b6cff67514894d0057df31469 (patch)
tree3156cfa7198e6eec726d9ee36ffbf2c6e774458b
parentbe9c98bd789ae231a5b52d7e832273a9319147b9 (diff)
RET on byline to view profile.
- no more need to tab to handle
-rw-r--r--lisp/mastodon-profile.el10
-rw-r--r--lisp/mastodon-tl.el4
2 files changed, 12 insertions, 2 deletions
diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el
index 4b541fd..516059e 100644
--- a/lisp/mastodon-profile.el
+++ b/lisp/mastodon-profile.el
@@ -436,6 +436,14 @@ If toot is a boost, opens the profile of the booster."
(message "Loading your profile...")
(mastodon-profile--show-user (mastodon-auth--get-account-name)))
+(defun mastodon-profile--view-author-profile ()
+ "View the profile of author of present toot."
+ (interactive)
+ (let* ((toot-json (mastodon-tl--property 'toot-json))
+ (acct (alist-get 'account toot-json))
+ (handle (alist-get 'acct acct)))
+ (mastodon-profile--show-user handle)))
+
(defun mastodon-profile--account-field (account field)
"Return FIELD from the ACCOUNT.
@@ -494,7 +502,7 @@ These include the author, author of reblogged entries and any user mentioned."
(when status
(let ((this-account
(or (alist-get 'account status) ; status is a toot
- status)) ; status is a user listing
+ status)) ; status is a user listing
(mentions (or (alist-get 'mentions (alist-get 'status status))
(alist-get 'mentions status)))
(reblog (or (alist-get 'reblog (alist-get 'status status))
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 45e7282..079af22 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -65,6 +65,7 @@
(autoload 'mastodon-search--insert-users-propertized "mastodon-search")
(autoload 'mastodon-search--get-user-info "mastodon-search")
(autoload 'mastodon-http--delete "mastodon-http")
+(autoload 'mastodon-profile--view-author-profile "mastodon-profile")
(when (require 'mpv nil :no-error)
(declare-function mpv-start "mpv"))
@@ -196,9 +197,10 @@ types of mastodon links and not just shr.el-generated ones.")
(when (require 'mpv nil :no-error)
(let ((map (make-sparse-keymap)))
(define-key map (kbd "<C-return>") 'mastodon-tl--mpv-play-video-from-byline)
+ (define-key map (kbd "<return>") 'mastodon-profile--view-author-profile)
(keymap-canonicalize map)))
"The keymap to be set for the author byline.
-The idea is that you can play media without navigating to it.")
+It is active where point is placed by `mastodon-tl--goto-next-toot.'")
(defun mastodon-tl--next-tab-item ()
"Move to the next interesting item.