From 0b01efc1187ca5d40839c8eed2d9ae7ddef144f7 Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 15 Feb 2022 14:03:22 +0100 Subject: make accept/reject foll reqs cmds avail in foll reqs view! --- lisp/mastodon-profile.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 5811a4a..d632e5e 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -57,6 +57,8 @@ (autoload 'mastodon-tl--init "mastodon-tl.el") (autoload 'mastodon-http--patch "mastodon-http") (autoload 'mastodon-http--patch-json "mastodon-http") +(autoload 'mastodon-notifications--follow-request-reject "mastodon-notifications") +(autoload 'mastodon-notifications--follow-request-accept "mastodon-notifications") (defvar mastodon-instance-url) (defvar mastodon-tl--buffer-spec) @@ -72,6 +74,17 @@ map) "Keymap for `mastodon-profile-mode'.") +(defvar mastodon-profile--view-follow-requests-keymap + (let ((map (make-sparse-keymap))) + (define-key map (kbd "r") #'mastodon-notifications--follow-request-reject) + (define-key map (kbd "a") #'mastodon-notifications--follow-request-accept) + ;; (define-key map (kbd "g") 'mastodon-notifications--view-follow-requests + ;; (define-key map (kbd "t") #'mastodon-toot) + (define-key map (kbd "q") #'kill-current-buffer) + (define-key map (kbd "Q") #'kill-buffer-and-window) + map) + "Keymap for viewing follow requests.") + (define-minor-mode mastodon-profile-mode "Toggle mastodon profile minor mode. -- cgit v1.2.3 From 787f18dcff2ee7a4c5a5cbf331f4e2d26997e1cc Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 15 Feb 2022 15:30:58 +0100 Subject: replace all calls to mastodon-search--insert-users-propertized with calls to mastodon-profile--add-author-bylines. --- lisp/mastodon-profile.el | 3 +-- lisp/mastodon-search.el | 24 ++---------------------- lisp/mastodon-tl.el | 3 ++- 3 files changed, 5 insertions(+), 25 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index d632e5e..8ac0b67 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -398,8 +398,7 @@ FIELD is used to identify regions under 'account" (defun mastodon-profile--add-author-bylines (tootv) "Convert TOOTV into a author-bylines and insert." (let ((inhibit-read-only t)) - (if (equal tootv '[]) - (message "Looks like you have no follow requests for the moment.") + (when (not (equal tootv '[])) (mapc (lambda (toot) (let ((start-pos (point))) (insert "\n" diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index d17b054..2f8054a 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -98,7 +98,8 @@ Returns a nested list containing user handle, display name, and URL." " USERS\n" " ------------\n\n") 'success)) - (mastodon-search--insert-users-propertized user-ids :note) + (mastodon-profile--add-author-bylines accts) + ;; (mastodon-search--insert-users-propertized user-ids :note) ;; hashtag results: (insert (mastodon-tl--set-face (concat "\n ------------\n" @@ -124,27 +125,6 @@ Returns a nested list containing user handle, display name, and URL." (mapc 'mastodon-tl--toot toots-list-json) (goto-char (point-min)))))) -(defun mastodon-search--insert-users-propertized (users &optional note) - "Insert USERS list into the buffer. -If NOTE is non-nil, include user's profile note. -This is also called by `mastodon-tl--get-follow-suggestions'." - (mapc (lambda (el) - (insert (propertize (car el) 'face 'mastodon-display-name-face) - " : \n : " - (propertize (concat "@" (car (cdr el))) - 'face 'mastodon-handle-face - 'mouse-face 'highlight - 'mastodon-tab-stop 'user-handle - 'keymap mastodon-tl--link-keymap - 'mastodon-handle (concat "@" (car (cdr el))) - 'help-echo (concat "Browse user profile of @" (car (cdr el)))) - " : \n" - (if note - (mastodon-tl--render-text (cadddr el) nil) - "") - "\n")) - users)) - (defun mastodon-search--get-user-info (account) "Get user handle, display name, account URL and profile note from ACCOUNT." (list (alist-get 'display_name account) diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index efccc21..26364a6 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1107,7 +1107,8 @@ webapp" " SUGGESTED ACCOUNTS\n" " ------------\n\n") 'success)) - (mastodon-search--insert-users-propertized users :note))))) + (mastodon-profile--add-author-bylines response))))) + ;; (mastodon-search--insert-users-propertized users :note))))) (defun mastodon-tl--follow-user (user-handle &optional notify) "Query for USER-HANDLE from current status and follow that user. -- cgit v1.2.3 From f10b33b7a6a9975a4627a4e4e9adc118c0a49a92 Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 15 Feb 2022 15:31:55 +0100 Subject: factor out a decent insert-follow-requests fun --- lisp/mastodon-profile.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 8ac0b67..f779648 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -161,7 +161,21 @@ extra keybindings." (interactive) (mastodon-tl--init "follow-requests" "follow_requests" - 'mastodon-profile--add-author-bylines)) + 'mastodon-profile--insert-follow-requests)) + +(defun mastodon-profile--insert-follow-requests (json) + "Insert the user's current follow requests. +JSON is the data returned by the server." + (insert (mastodon-tl--set-face + (concat "\n ------------\n" + " FOLLOW REQUESTS\n" + " ------------\n\n") + 'success)) + (if (equal json '[]) + (insert (propertize + "Looks like you have no follow requests for now." + 'face font-lock-comment-face)) + (mastodon-profile--add-author-bylines json))) (defun mastodon-profile--update-user-profile-note () "Fetch user's profile note and display for editing." -- cgit v1.2.3 From b2302027969ec305969c4024296b05f50e4f1846 Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 15 Feb 2022 17:04:35 +0100 Subject: make profile--extract-user-handles compat with foll req view this allows following users directly from foll req views made extract-users-handles work with follwers/following in profile view --- lisp/mastodon-profile.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index f779648..857c349 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -454,7 +454,12 @@ If the handle does not match a search return then retun NIL." These include the author, author of reblogged entries and any user mentioned." (when status - (let ((this-account (alist-get 'account status)) + (let ((this-account + ;; follow suggestions view compat: + (if (or (equal (buffer-name) "*mastodon-follow-suggestions*") + (string-prefix-p "accounts" (mastodon-tl--get-endpoint))) + (mastodon-tl--property 'toot-json) + (alist-get 'account status))) (mentions (alist-get 'mentions status)) (reblog (alist-get 'reblog status))) (seq-filter -- cgit v1.2.3 From 7058db5848987df4c089bd0c0e34813f830d372c Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 15 Feb 2022 17:06:03 +0100 Subject: add generic goto-next/prev-item funs for filters/foll reqs fix remnant call to goto-next-filter --- lisp/mastodon-profile.el | 6 ++++-- lisp/mastodon-tl.el | 14 +++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 857c349..c7f8963 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -78,8 +78,10 @@ (let ((map (make-sparse-keymap))) (define-key map (kbd "r") #'mastodon-notifications--follow-request-reject) (define-key map (kbd "a") #'mastodon-notifications--follow-request-accept) - ;; (define-key map (kbd "g") 'mastodon-notifications--view-follow-requests - ;; (define-key map (kbd "t") #'mastodon-toot) + (define-key map (kbd "n") #'mastodon-tl--goto-next-item) + (define-key map (kbd "p") #'mastodon-tl--goto-prev-item) + (define-key map (kbd "g") 'mastodon-notifications--view-follow-requests) + (define-key map (kbd "t") #'mastodon-toot) (define-key map (kbd "q") #'kill-current-buffer) (define-key map (kbd "Q") #'kill-buffer-and-window) map) diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index deaa196..34b2881 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -174,8 +174,8 @@ types of mastodon links and not just shr.el-generated ones.") (let ((map (make-sparse-keymap))) (define-key map (kbd "d") 'mastodon-tl--delete-filter) (define-key map (kbd "c") 'mastodon-tl--create-filter) - (define-key map (kbd "n") 'mastodon-tl--goto-next-filter) - (define-key map (kbd "p") 'mastodon-tl--goto-prev-filter) + (define-key map (kbd "n") 'mastodon-tl--goto-next-item) + (define-key map (kbd "p") 'mastodon-tl--goto-prev-item) (define-key map (kbd "TAB") 'mastodon-tl--goto-next-filter) (define-key map (kbd "g") 'mastodon-tl--view-filters) (define-key map (kbd "t") 'mastodon-toot) @@ -1155,7 +1155,7 @@ Prompt for a context, must be a list containting at least one of \"home\", "filters" 'mastodon-tl--insert-filters) (use-local-map mastodon-tl--view-filters-keymap) - (mastodon-tl--goto-next-filter)) + (mastodon-tl--goto-next-item)) (defun mastodon-tl--insert-filters (json) "Insert the user's current filters. @@ -1210,14 +1210,14 @@ JSON is what is returned by by the server." (mastodon-tl--view-filters) (message "Filter for \"%s\" deleted!" phrase))))))) -(defun mastodon-tl--goto-next-filter () - "Jump to next filter." +(defun mastodon-tl--goto-next-item () + "Jump to next item, e.g. filter or follow request." (interactive) (mastodon-tl--goto-toot-pos 'next-single-property-change 'next-line)) -(defun mastodon-tl--goto-prev-filter () - "Jump to previous filter." +(defun mastodon-tl--goto-prev-item () + "Jump to previous item, e.g. filter or follow request." (interactive) (mastodon-tl--goto-toot-pos 'previous-single-property-change 'previous-line)) -- cgit v1.2.3 From a6a9c5201e51b07af2be5e4e581c364e28108947 Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 15 Feb 2022 17:07:26 +0100 Subject: add mini docs for foll reqs view reload foll reqs view on accept/reject --- lisp/mastodon-notifications.el | 3 ++- lisp/mastodon-profile.el | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 5e3305a..40f9c04 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -109,7 +109,8 @@ follow-requests view." nil nil))) (mastodon-http--triage response (lambda () - (unless f-reqs-view-p + (if f-reqs-view-p + (mastodon-profile--view-follow-requests) (mastodon-notifications--get)) (message "Follow request of %s (@%s) %s!" name handle (if reject diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index c7f8963..e15a891 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -172,7 +172,10 @@ JSON is the data returned by the server." (concat "\n ------------\n" " FOLLOW REQUESTS\n" " ------------\n\n") - 'success)) + 'success) + (mastodon-tl--set-face + "[a/r - accept/reject request at point\n n/p - go to next/prev request]\n\n" + 'font-lock-comment-face)) (if (equal json '[]) (insert (propertize "Looks like you have no follow requests for now." -- cgit v1.2.3 From 48a89e518d0a84d4b81c223c9e8cf151df619b1f Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 15 Feb 2022 19:13:23 +0100 Subject: move faves count help-echo propertize into tl--byline this means that we only do the propertizing when we are actually doing an author byline, docstring for add-author-bylines it also needs renaming --- lisp/mastodon-profile.el | 6 ++++- lisp/mastodon-tl.el | 63 ++++++++++++++++++++++++------------------------ 2 files changed, 37 insertions(+), 32 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index e15a891..8388d05 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -415,7 +415,11 @@ FIELD is used to identify regions under 'account" (cdr (assoc field account))) (defun mastodon-profile--add-author-bylines (tootv) - "Convert TOOTV into a author-bylines and insert." + "Convert TOOTV into a author-bylines and insert. +Also insert their profile note. +Used to view a user's followers and those they're following, as +well as the list of suggested followers and for search results." + ;;FIXME change the name of this fun now that we've edited what it does! (let ((inhibit-read-only t)) (when (not (equal tootv '[])) (mapc (lambda (toot) diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index e8634dd..327b682 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -333,11 +333,10 @@ Used on initializing a timeline or thread." 'face 'mastodon-display-name-face ;; enable playing of videos when point is on byline: 'attachments (mastodon-tl--get-attachments-for-byline toot) - 'keymap mastodon-tl--byline-link-keymap - ;; echo faves count when point on post author name: - ;; which is where --goto-next-toot puts point. - 'help-echo - (mastodon-tl--format-faves-count toot)) + 'keymap mastodon-tl--byline-link-keymap) + ;; help-echo propertized moved to `mastodon-tl--byline + ;; 'help-echo + ;; (mastodon-tl--format-faves-count toot)) " (" (propertize (concat "@" handle) 'face 'mastodon-handle-face @@ -505,32 +504,34 @@ By default it is `mastodon-tl--byline-boosted'" (when faved (mastodon-tl--format-faved-or-boosted-byline "F"))) (propertize - (concat - ;; we propertize help-echo format faves for author name - ;; in `mastodon-tl--byline-author' - (funcall author-byline toot) - (cond ((equal visibility "direct") - (if (fontp (char-displayable-p #10r128274)) - " ✉" - " [direct]")) - ((equal visibility "private") - (if (fontp (char-displayable-p #10r9993)) - " 🔒" - " [followers]"))) - (funcall action-byline toot) - " " - ;; TODO: Once we have a view for toot (responses etc.) make - ;; this a tab stop and attach an action. - (propertize - (format-time-string mastodon-toot-timestamp-format parsed-time) - 'timestamp parsed-time - 'display (if mastodon-tl--enable-relative-timestamps - (mastodon-tl--relative-time-description parsed-time) - parsed-time)) - (propertize "\n ------------\n" 'face 'default)) - 'favourited-p faved - 'boosted-p boosted - 'byline t)))) + ;; echo faves count when point on + ;; author byline, which is where --goto-next-toot puts + ;; point. + (concat (propertize + (funcall author-byline toot) + 'help-echo (mastodon-tl--format-faves-count toot)) + (cond ((equal visibility "direct") + (if (fontp (char-displayable-p #10r128274)) + " ✉" + " [direct]")) + ((equal visibility "private") + (if (fontp (char-displayable-p #10r9993)) + " 🔒" + " [followers]"))) + (funcall action-byline toot) + " " + ;; TODO: Once we have a view for toot (responses etc.) make + ;; this a tab stop and attach an action. + (propertize + (format-time-string mastodon-toot-timestamp-format parsed-time) + 'timestamp parsed-time + 'display (if mastodon-tl--enable-relative-timestamps + (mastodon-tl--relative-time-description parsed-time) + parsed-time)) + (propertize "\n ------------\n" 'face 'default)) + 'favourited-p faved + 'boosted-p boosted + 'byline t)))) (defun mastodon-tl--format-faved-or-boosted-byline (letter) "Format the byline marker for a boosted or favorited status. -- cgit v1.2.3 From 1c0328ced821b152e3da911592a6acd12d8598dd Mon Sep 17 00:00:00 2001 From: mousebot Date: Tue, 15 Feb 2022 21:55:10 +0100 Subject: re-factor follow-user functions for various views - revert profile--extract-users-handles - rewrite search--insert-users-propertized to handle raw account JSON, and to call search--get-user-info itself, so we can add full acct JSON to each user displayed and use it for follow-user etc. - and to choose how we want to follow users, we edit tl--interactive-user-handles-get to work differently depending on context: - poss contexts are "follow suggestions" view, search results, and profiles displaying a user's followers/followed users. --- lisp/mastodon-profile.el | 11 +++-------- lisp/mastodon-search.el | 48 ++++++++++++++++++++++++++++-------------------- lisp/mastodon-tl.el | 15 ++++++++++++--- 3 files changed, 43 insertions(+), 31 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 8388d05..5504065 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -463,14 +463,9 @@ If the handle does not match a search return then retun NIL." These include the author, author of reblogged entries and any user mentioned." (when status - (let ((this-account - ;; follow suggestions view compat: - (if (or (equal (buffer-name) "*mastodon-follow-suggestions*") - (string-prefix-p "accounts" (mastodon-tl--get-endpoint))) - (mastodon-tl--property 'toot-json) - (alist-get 'account status))) - (mentions (alist-get 'mentions status)) - (reblog (alist-get 'reblog status))) + (let ((this-account (alist-get 'account status)) + (mentions (alist-get 'mentions status)) + (reblog (alist-get 'reblog status))) (seq-filter 'stringp (seq-uniq diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index d17b054..726b76e 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -89,16 +89,16 @@ Returns a nested list containing user handle, display name, and URL." status-ids-list))) (with-current-buffer (get-buffer-create buffer) (switch-to-buffer buffer) - (erase-buffer) (mastodon-mode) (let ((inhibit-read-only t)) + (erase-buffer) ;; user results: (insert (mastodon-tl--set-face (concat "\n ------------\n" " USERS\n" " ------------\n\n") 'success)) - (mastodon-search--insert-users-propertized user-ids :note) + (mastodon-search--insert-users-propertized accts :note) ;; hashtag results: (insert (mastodon-tl--set-face (concat "\n ------------\n" @@ -124,26 +124,34 @@ Returns a nested list containing user handle, display name, and URL." (mapc 'mastodon-tl--toot toots-list-json) (goto-char (point-min)))))) -(defun mastodon-search--insert-users-propertized (users &optional note) - "Insert USERS list into the buffer. +(defun mastodon-search--insert-users-propertized (json &optional note) + "Insert users list into the buffer. +JSON is the data from the server.. If NOTE is non-nil, include user's profile note. This is also called by `mastodon-tl--get-follow-suggestions'." - (mapc (lambda (el) - (insert (propertize (car el) 'face 'mastodon-display-name-face) - " : \n : " - (propertize (concat "@" (car (cdr el))) - 'face 'mastodon-handle-face - 'mouse-face 'highlight - 'mastodon-tab-stop 'user-handle - 'keymap mastodon-tl--link-keymap - 'mastodon-handle (concat "@" (car (cdr el))) - 'help-echo (concat "Browse user profile of @" (car (cdr el)))) - " : \n" - (if note - (mastodon-tl--render-text (cadddr el) nil) - "") - "\n")) - users)) + (mapc (lambda (acct) + (let ((user (mastodon-search--get-user-info acct))) + (insert + (propertize + (concat (propertize (car user) + 'face 'mastodon-display-name-face + 'byline t + 'toot-id "0") + " : \n : " + (propertize (concat "@" (cadr user)) + 'face 'mastodon-handle-face + 'mouse-face 'highlight + 'mastodon-tab-stop 'user-handle + 'keymap mastodon-tl--link-keymap + 'mastodon-handle (concat "@" (cadr user)) + 'help-echo (concat "Browse user profile of @" (cadr user))) + " : \n" + (if note + (mastodon-tl--render-text (cadddr user) nil) + "") + "\n") + 'user-json acct)))) + json)) (defun mastodon-search--get-user-info (account) "Get user handle, display name, account URL and profile note from ACCOUNT." diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index ec9c033..6bb5656 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1253,7 +1253,7 @@ RESPONSE is the JSON returned by the server." " SUGGESTED ACCOUNTS\n" " ------------\n\n") 'success)) - (mastodon-search--insert-users-propertized users :note) + (mastodon-search--insert-users-propertized response :note) (goto-char (point-min)))) (defun mastodon-tl--follow-user (user-handle &optional notify) @@ -1321,8 +1321,17 @@ Can be called to toggle NOTIFY on users already being followed." (defun mastodon-tl--interactive-user-handles-get (action) "Get the list of user-handles for ACTION from the current toot." - (let ((user-handles (mastodon-profile--extract-users-handles - (mastodon-profile--toot-json)))) + (let ((user-handles + ;; follow suggests / search compat: + (cond ((or (equal (buffer-name) "*mastodon-follow-suggestions*") + (string-prefix-p "*mastodon-search" (buffer-name))) + (list (alist-get 'acct (mastodon-tl--property 'user-json)))) + ;; profile view follows/followers compat: + ((string-prefix-p "accounts" (mastodon-tl--get-endpoint)) + (list (alist-get 'acct (mastodon-tl--property 'toot-json)))) + (t + (mastodon-profile--extract-users-handles + (mastodon-profile--toot-json)))))) (completing-read (if (or (equal action "disable") (equal action "enable")) (format "%s notifications when user posts: " action) -- cgit v1.2.3 From bc164b9eb3df4e4050d0c4a05fea7c9b5b368178 Mon Sep 17 00:00:00 2001 From: mousebot Date: Wed, 16 Feb 2022 10:30:56 +0100 Subject: fix up follow requests view: own inheriting keymap uses init-sync now also --- lisp/mastodon-profile.el | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 5504065..b5e1489 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -55,14 +55,20 @@ (autoload 'mastodon-tl--toot-id "mastodon-tl") (autoload 'mastodon-tl--toot "mastodon-tl") (autoload 'mastodon-tl--init "mastodon-tl.el") +(autoload 'mastodon-tl--init-sync "mastodon-tl") (autoload 'mastodon-http--patch "mastodon-http") (autoload 'mastodon-http--patch-json "mastodon-http") (autoload 'mastodon-notifications--follow-request-reject "mastodon-notifications") (autoload 'mastodon-notifications--follow-request-accept "mastodon-notifications") +(autoload 'mastodon-tl--goto-next-item "mastodon-tl") +(autoload 'mastodon-tl--goto-prev-item "mastodon-tl") +(autoload 'mastodon-tl--goto-first-item "mastodon-tl") +(autoload 'mastodon-toot "mastodon") (defvar mastodon-instance-url) (defvar mastodon-tl--buffer-spec) (defvar mastodon-tl--update-point) +(defvar mastodon-mode-map) (defvar-local mastodon-profile--account nil "The data for the account being described in the current profile buffer.") @@ -75,15 +81,16 @@ "Keymap for `mastodon-profile-mode'.") (defvar mastodon-profile--view-follow-requests-keymap - (let ((map (make-sparse-keymap))) + (let ((map ;(make-sparse-keymap))) + (copy-keymap mastodon-mode-map))) (define-key map (kbd "r") #'mastodon-notifications--follow-request-reject) (define-key map (kbd "a") #'mastodon-notifications--follow-request-accept) (define-key map (kbd "n") #'mastodon-tl--goto-next-item) (define-key map (kbd "p") #'mastodon-tl--goto-prev-item) - (define-key map (kbd "g") 'mastodon-notifications--view-follow-requests) - (define-key map (kbd "t") #'mastodon-toot) - (define-key map (kbd "q") #'kill-current-buffer) - (define-key map (kbd "Q") #'kill-buffer-and-window) + (define-key map (kbd "g") 'mastodon-profile--view-follow-requests) + ;; (define-key map (kbd "t") #'mastodon-toot) + ;; (define-key map (kbd "q") #'kill-current-buffer) + ;; (define-key map (kbd "Q") #'kill-buffer-and-window) map) "Keymap for viewing follow requests.") @@ -161,9 +168,11 @@ extra keybindings." (defun mastodon-profile--view-follow-requests () "Open a new buffer displaying the user's follow requests." (interactive) - (mastodon-tl--init "follow-requests" - "follow_requests" - 'mastodon-profile--insert-follow-requests)) + (mastodon-tl--init-sync "follow-requests" + "follow_requests" + 'mastodon-profile--insert-follow-requests) + (use-local-map mastodon-profile--view-follow-requests-keymap) + (mastodon-tl--goto-first-item)) (defun mastodon-profile--insert-follow-requests (json) "Insert the user's current follow requests. @@ -179,7 +188,9 @@ JSON is the data returned by the server." (if (equal json '[]) (insert (propertize "Looks like you have no follow requests for now." - 'face font-lock-comment-face)) + 'face font-lock-comment-face + 'byline t + 'toot-id "0")) (mastodon-profile--add-author-bylines json))) (defun mastodon-profile--update-user-profile-note () -- cgit v1.2.3 From 7d12bfac3c9adfae63529cc2a9d10ab006fc7b5f Mon Sep 17 00:00:00 2001 From: mousebot Date: Wed, 16 Feb 2022 10:37:23 +0100 Subject: cleanup indentation in tl.el cleanup indents --- lisp/mastodon-profile.el | 4 +- lisp/mastodon-search.el | 46 ++++++++++----------- lisp/mastodon-tl.el | 102 +++++++++++++++++++++++------------------------ 3 files changed, 76 insertions(+), 76 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index b5e1489..0119a36 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -475,8 +475,8 @@ If the handle does not match a search return then retun NIL." These include the author, author of reblogged entries and any user mentioned." (when status (let ((this-account (alist-get 'account status)) - (mentions (alist-get 'mentions status)) - (reblog (alist-get 'reblog status))) + (mentions (alist-get 'mentions status)) + (reblog (alist-get 'reblog status))) (seq-filter 'stringp (seq-uniq diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 1c7f00e..e1ca81a 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -130,29 +130,29 @@ Returns a nested list containing user handle, display name, and URL." JSON is the data from the server.. If NOTE is non-nil, include user's profile note. This is also called by `mastodon-tl--get-follow-suggestions'." - (mapc (lambda (acct) - (let ((user (mastodon-search--get-user-info acct))) - (insert - (propertize - (concat (propertize (car user) - 'face 'mastodon-display-name-face - 'byline t - 'toot-id "0") - " : \n : " - (propertize (concat "@" (cadr user)) - 'face 'mastodon-handle-face - 'mouse-face 'highlight - 'mastodon-tab-stop 'user-handle - 'keymap mastodon-tl--link-keymap - 'mastodon-handle (concat "@" (cadr user)) - 'help-echo (concat "Browse user profile of @" (cadr user))) - " : \n" - (if note - (mastodon-tl--render-text (cadddr user) nil) - "") - "\n") - 'user-json acct)))) - json)) + (mapc (lambda (acct) + (let ((user (mastodon-search--get-user-info acct))) + (insert + (propertize + (concat (propertize (car user) + 'face 'mastodon-display-name-face + 'byline t + 'toot-id "0") + " : \n : " + (propertize (concat "@" (cadr user)) + 'face 'mastodon-handle-face + 'mouse-face 'highlight + 'mastodon-tab-stop 'user-handle + 'keymap mastodon-tl--link-keymap + 'mastodon-handle (concat "@" (cadr user)) + 'help-echo (concat "Browse user profile of @" (cadr user))) + " : \n" + (if note + (mastodon-tl--render-text (cadddr user) nil) + "") + "\n") + 'user-json acct)))) + json)) (defun mastodon-search--get-user-info (account) "Get user handle, display name, account URL and profile note from ACCOUNT." diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index eaafd74..2c2c6ec 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -362,12 +362,12 @@ Used on initializing a timeline or thread." (propertize (concat "@" handle) 'face 'mastodon-handle-face 'mouse-face 'highlight - 'mastodon-tab-stop 'user-handle + 'mastodon-tab-stop 'user-handle 'account account - 'shr-url profile-url - 'keymap mastodon-tl--link-keymap + 'shr-url profile-url + 'keymap mastodon-tl--link-keymap 'mastodon-handle (concat "@" handle) - 'help-echo (concat "Browse user profile of @" handle)) + 'help-echo (concat "Browse user profile of @" handle)) ")"))) (defun mastodon-tl--format-faves-count (toot) @@ -520,34 +520,34 @@ By default it is `mastodon-tl--byline-boosted'" ;; this makes the behaviour of these markers consistent whether they are ;; displayed for an already boosted/favourited toot or as the result of ;; the toot having just been favourited/boosted. - (concat (when boosted - (mastodon-tl--format-faved-or-boosted-byline "B")) - (when faved - (mastodon-tl--format-faved-or-boosted-byline "F"))) - (propertize - (concat - ;; we propertize help-echo format faves for author name - ;; in `mastodon-tl--byline-author' - (funcall author-byline toot) - (cond ((equal visibility "direct") - (if (fontp (char-displayable-p #10r128274)) - " ✉" - " [direct]")) - ((equal visibility "private") - (if (fontp (char-displayable-p #10r9993)) - " 🔒" - " [followers]"))) - (funcall action-byline toot) - " " - ;; TODO: Once we have a view for toot (responses etc.) make - ;; this a tab stop and attach an action. - (propertize - (format-time-string mastodon-toot-timestamp-format parsed-time) - 'timestamp parsed-time - 'display (if mastodon-tl--enable-relative-timestamps - (mastodon-tl--relative-time-description parsed-time) - parsed-time)) - (propertize "\n ------------\n" 'face 'default)) + (concat (when boosted + (mastodon-tl--format-faved-or-boosted-byline "B")) + (when faved + (mastodon-tl--format-faved-or-boosted-byline "F"))) + (propertize + (concat + ;; we propertize help-echo format faves for author name + ;; in `mastodon-tl--byline-author' + (funcall author-byline toot) + (cond ((equal visibility "direct") + (if (fontp (char-displayable-p #10r128274)) + " ✉" + " [direct]")) + ((equal visibility "private") + (if (fontp (char-displayable-p #10r9993)) + " 🔒" + " [followers]"))) + (funcall action-byline toot) + " " + ;; TODO: Once we have a view for toot (responses etc.) make + ;; this a tab stop and attach an action. + (propertize + (format-time-string mastodon-toot-timestamp-format parsed-time) + 'timestamp parsed-time + 'display (if mastodon-tl--enable-relative-timestamps + (mastodon-tl--relative-time-description parsed-time) + parsed-time)) + (propertize "\n ------------\n" 'face 'default)) 'favourited-p faved 'boosted-p boosted 'byline t)))) @@ -947,11 +947,11 @@ a notification." (let ((attachments (mastodon-tl--property 'attachments)) vids) (mapc (lambda (x) - (let ((att-type (plist-get x :type))) - (when (or (string= "video" att-type) - (string= "gifv" att-type)) - (push x vids)))) - attachments) + (let ((att-type (plist-get x :type))) + (when (or (string= "video" att-type) + (string= "gifv" att-type)) + (push x vids)))) + attachments) (car vids))) (defun mastodon-tl--mpv-play-video-from-byline () @@ -975,7 +975,7 @@ in which case play first video or gif from current toot." (type (or ;; in byline: type ;; point in toot: - (mastodon-tl--property 'mastodon-media-type)))) + (mastodon-tl--property 'mastodon-media-type)))) (if url (if (or (equal type "gifv") (equal type "video")) @@ -1211,24 +1211,24 @@ JSON is what is returned by by the server." (propertize filter-string 'toot-id id ;for goto-next-filter compat 'phrase phrase - ;'help-echo "n/p to go to next/prev filter, c to create new filter, d to delete filter at point." - ;'keymap mastodon-tl--view-filters-keymap + ;;'help-echo "n/p to go to next/prev filter, c to create new filter, d to delete filter at point." + ;;'keymap mastodon-tl--view-filters-keymap 'byline t)))) ;for goto-next-filter compat (defun mastodon-tl--delete-filter () "Delete filter at point." (interactive) - (let* ((filter-id (get-text-property (point) 'toot-id)) - (phrase (get-text-property (point) 'phrase)) - (url (mastodon-http--api - (format "filters/%s" filter-id)))) - (if (equal nil filter-id) - (error "No filter at point?") - (when (y-or-n-p (format "Delete this filter? "))) - (let ((response (mastodon-http--delete url))) - (mastodon-http--triage response (lambda () - (mastodon-tl--view-filters) - (message "Filter for \"%s\" deleted!" phrase))))))) + (let* ((filter-id (get-text-property (point) 'toot-id)) + (phrase (get-text-property (point) 'phrase)) + (url (mastodon-http--api + (format "filters/%s" filter-id)))) + (if (equal nil filter-id) + (error "No filter at point?") + (when (y-or-n-p (format "Delete this filter? "))) + (let ((response (mastodon-http--delete url))) + (mastodon-http--triage response (lambda () + (mastodon-tl--view-filters) + (message "Filter for \"%s\" deleted!" phrase))))))) (defun mastodon-tl--get-follow-suggestions () "Display a buffer of suggested accounts to follow." -- cgit v1.2.3 From 121a09f5986dff508d713b772a54a4c8b4d446c4 Mon Sep 17 00:00:00 2001 From: mousebot Date: Wed, 16 Feb 2022 10:37:48 +0100 Subject: run goto-first-item in tl--init, unless profile view - remove call to goto-next-item from view filters and view foll suggests tweak init-sync goto-first-item behaviour remove call to goto-next-toot on profile load --- lisp/mastodon-profile.el | 1 - lisp/mastodon-tl.el | 31 +++++++++++++++---------------- 2 files changed, 15 insertions(+), 17 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 0119a36..7e78fd7 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -378,7 +378,6 @@ Returns a list of lists." (mastodon-profile--insert-statuses-pinned pinned) (setq mastodon-tl--update-point (point))) ;updates to follow pinned toots (funcall update-function json))) - ;;(mastodon-tl--goto-next-toot) (goto-char (point-min)))) (defun mastodon-profile--get-toot-author () diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 2c2c6ec..fef8a98 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1175,8 +1175,7 @@ Prompt for a context, must be a list containting at least one of \"home\", (mastodon-tl--init-sync "filters" "filters" 'mastodon-tl--insert-filters) - (use-local-map mastodon-tl--view-filters-keymap) - (mastodon-tl--goto-next-item)) + (use-local-map mastodon-tl--view-filters-keymap)) (defun mastodon-tl--insert-filters (json) "Insert the user's current filters. @@ -1236,8 +1235,7 @@ JSON is what is returned by by the server." (mastodon-tl--init-sync "follow-suggestions" "suggestions" 'mastodon-tl--insert-follow-suggestions) - (use-local-map mastodon-tl--follow-suggestions-map) - (mastodon-tl--goto-next-item)) + (use-local-map mastodon-tl--follow-suggestions-map)) (defun mastodon-tl--insert-follow-suggestions (response) "Insert follow suggestions into buffer. @@ -1624,11 +1622,14 @@ JSON is the data returned from the server." #'mastodon-tl--update-timestamps-callback (current-buffer) nil))) - (when (or (equal endpoint "notifications") - (string-prefix-p "timelines" endpoint) - (string-prefix-p "favourites" endpoint) - (string-prefix-p "statuses" endpoint)) - (mastodon-tl--goto-first-item)))) + (unless + ;; for everything save profiles: + (string-prefix-p "accounts" endpoint)) + ;;(or (equal endpoint "notifications") + ;; (string-prefix-p "timelines" endpoint) + ;; (string-prefix-p "favourites" endpoint) + ;; (string-prefix-p "statuses" endpoint)) + (mastodon-tl--goto-first-item))) (defun mastodon-tl--init-sync (buffer-name endpoint update-function) "Initialize BUFFER-NAME with timeline targeted by ENDPOINT. @@ -1661,13 +1662,11 @@ Runs synchronously." #'mastodon-tl--update-timestamps-callback (current-buffer) nil))) - (when (and (not (equal json '[])) - (or (equal endpoint "notifications") - (string-prefix-p "timelines" endpoint) - (string-prefix-p "favourites" endpoint) - (string-prefix-p "statuses" endpoint)) - (mastodon-tl--goto-first-item)))) - buffer)) + (when ;(and (not (equal json '[])) + ;; for everything save profiles: + (not (string-prefix-p "accounts" endpoint)) + (mastodon-tl--goto-first-item))) + buffer)) (provide 'mastodon-tl) ;;; mastodon-tl.el ends here -- cgit v1.2.3 From d9a31963c0b055f5ecf57f39b21575aa4bce3545 Mon Sep 17 00:00:00 2001 From: mousebot Date: Fri, 18 Feb 2022 15:22:51 +0100 Subject: use search-insert-users-propertized for foll reqs not prifile--add-author-bylines autoload insert-users-propr in -profile --- lisp/mastodon-profile.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 7e78fd7..7a68e26 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -64,6 +64,7 @@ (autoload 'mastodon-tl--goto-prev-item "mastodon-tl") (autoload 'mastodon-tl--goto-first-item "mastodon-tl") (autoload 'mastodon-toot "mastodon") +(autoload 'mastodon-search--insert-users-propertized "mastodon-search") (defvar mastodon-instance-url) (defvar mastodon-tl--buffer-spec) @@ -191,7 +192,8 @@ JSON is the data returned by the server." 'face font-lock-comment-face 'byline t 'toot-id "0")) - (mastodon-profile--add-author-bylines json))) + (mastodon-search--insert-users-propertized json :note))) + ;; (mastodon-profile--add-author-bylines json))) (defun mastodon-profile--update-user-profile-note () "Fetch user's profile note and display for editing." -- cgit v1.2.3 From ab24ffe0ecdf9c9958c2ec527a23d0043babbf2c Mon Sep 17 00:00:00 2001 From: mousebot Date: Fri, 18 Feb 2022 16:09:43 +0100 Subject: profile--add-author-bylines docstring --- lisp/mastodon-profile.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 7a68e26..57fa080 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -429,8 +429,7 @@ FIELD is used to identify regions under 'account" (defun mastodon-profile--add-author-bylines (tootv) "Convert TOOTV into a author-bylines and insert. Also insert their profile note. -Used to view a user's followers and those they're following, as -well as the list of suggested followers and for search results." +Used to view a user's followers and those they're following." ;;FIXME change the name of this fun now that we've edited what it does! (let ((inhibit-read-only t)) (when (not (equal tootv '[])) -- cgit v1.2.3 From 13e1ebff3b73ba3e6ad522d91103f432ce96ff92 Mon Sep 17 00:00:00 2001 From: mousebot Date: Sat, 19 Feb 2022 13:43:24 +0100 Subject: add checks to profile--show-user for when its called on nothing - also make profile--extract-ysers-handles work on user listings as well as toots --- lisp/mastodon-profile.el | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 57fa080..9c1cd88 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -400,19 +400,23 @@ If toot is a boost, opens the profile of the booster." "Query for USER-HANDLE from current status and show that user's profile." (interactive (list - (let ((user-handles (mastodon-profile--extract-users-handles - (mastodon-profile--toot-json)))) - (completing-read "View profile of user [choose or enter any handle]: " - user-handles - nil ; predicate - 'confirm)))) - (let ((account (mastodon-profile--lookup-account-in-status - user-handle (mastodon-profile--toot-json)))) - (if account - (progn - (message "Loading profile of user %s..." user-handle) - (mastodon-profile--make-author-buffer account)) - (message "Cannot find a user with handle %S" user-handle)))) + (if (not (get-text-property (point) 'toot-json)) + (message "Looks like there's no toot or user at point?") + (let ((user-handles (mastodon-profile--extract-users-handles + (mastodon-profile--toot-json)))) + (completing-read "View profile of user [choose or enter any handle]: " + user-handles + nil ; predicate + 'confirm))))) + (if (not (get-text-property (point) 'toot-json)) + (message "Looks like there's no toot or user at point?") + (let ((account (mastodon-profile--lookup-account-in-status + user-handle (mastodon-profile--toot-json)))) + (if account + (progn + (message "Loading profile of user %s..." user-handle) + (mastodon-profile--make-author-buffer account)) + (message "Cannot find a user with handle %S" user-handle))))) (defun mastodon-profile--my-profile () "Show the profile of the currently signed in user." @@ -474,9 +478,11 @@ If the handle does not match a search return then retun NIL." These include the author, author of reblogged entries and any user mentioned." (when status - (let ((this-account (alist-get 'account status)) - (mentions (alist-get 'mentions status)) - (reblog (alist-get 'reblog status))) + (let ((this-account + (or (alist-get 'account status) ; status is a toot + status)) ; status is a user listing + (mentions (alist-get 'mentions status)) + (reblog (alist-get 'reblog status))) (seq-filter 'stringp (seq-uniq -- cgit v1.2.3 From a5fffb209d7bb2644741fd917768786628ec94b3 Mon Sep 17 00:00:00 2001 From: mousebot Date: Sat, 19 Feb 2022 13:44:19 +0100 Subject: add toot-json property to profile followers/following note in profile--add-author-bylines, which now prints profile notes --- lisp/mastodon-profile.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 9c1cd88..cb449b6 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -448,7 +448,9 @@ Used to view a user's followers and those they're following." 'toot-json toot)) (mastodon-media--inline-images start-pos (point)) (insert "\n" - (mastodon-tl--render-text (alist-get 'note toot) nil) + (propertize + (mastodon-tl--render-text (alist-get 'note toot) nil) + 'toot-json toot) ' "\n"))) tootv)))) -- cgit v1.2.3 From b7c7bc608a0650842c3479564b85ff91031ae2d7 Mon Sep 17 00:00:00 2001 From: mousebot Date: Thu, 10 Mar 2022 18:30:24 +0100 Subject: make follow etc work on boost/fave notifs to achieve this, in notifications--format-note, we run notifications--insert-status on 'note' rather than 'status' handle mentions/reblogs when following from a notif --- lisp/mastodon-notifications.el | 18 ++++++++++++------ lisp/mastodon-profile.el | 6 ++++-- 2 files changed, 16 insertions(+), 8 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index df4f9c0..670105a 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -168,12 +168,18 @@ Status notifications are given when (status (mastodon-tl--field 'status note)) (follower (alist-get 'username (alist-get 'account note)))) (mastodon-notifications--insert-status - (if (or (equal type 'follow) - (equal type 'follow-request)) - ;; Using reblog with an empty id will mark this as something - ;; non-boostable/non-favable. - (cons '(reblog (id . nil)) note) - status) + (cond ((or (equal type 'follow) + (equal type 'follow-request)) + ;; Using reblog with an empty id will mark this as something + ;; non-boostable/non-favable. + (cons '(reblog (id . nil)) note)) + ;; reblogs/faves use 'note' to process their own json + ;; not the toot's. this ensures following etc. work on such notifs + ((or (equal type 'favourite) + (equal type 'boost)) + note) + (t + status)) (if (or (equal type 'follow) (equal type 'follow-request)) (propertize (if (equal type 'follow) diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index cb449b6..793d8f9 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -483,8 +483,10 @@ These include the author, author of reblogged entries and any user mentioned." (let ((this-account (or (alist-get 'account status) ; status is a toot status)) ; status is a user listing - (mentions (alist-get 'mentions status)) - (reblog (alist-get 'reblog status))) + (mentions (or (alist-get 'mentions (alist-get 'status status)) + (alist-get 'mentions status))) + (reblog (or (alist-get 'reblog (alist-get 'status status)) + (alist-get 'reblog status)))) (seq-filter 'stringp (seq-uniq -- cgit v1.2.3 From 9bd49d3bbab945c625c935b9025dcd20c8e1e58d Mon Sep 17 00:00:00 2001 From: mousebot Date: Fri, 11 Mar 2022 13:11:48 +0100 Subject: make profile--show-user also work on profile headers --- lisp/mastodon-profile.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 793d8f9..89dd02d 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -400,7 +400,8 @@ If toot is a boost, opens the profile of the booster." "Query for USER-HANDLE from current status and show that user's profile." (interactive (list - (if (not (get-text-property (point) 'toot-json)) + (if (and (not (string-prefix-p "accounts" (mastodon-tl--get-endpoint))) ;profile view + (not (get-text-property (point) 'toot-json))) (message "Looks like there's no toot or user at point?") (let ((user-handles (mastodon-profile--extract-users-handles (mastodon-profile--toot-json)))) -- cgit v1.2.3 From 262da506ae52c619ce76b83488920cf4ae4b8b1b Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 14 Mar 2022 12:50:23 +0100 Subject: add header line to update profile note buffer --- lisp/mastodon-profile.el | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 89dd02d..6065bdd 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -207,6 +207,10 @@ JSON is the data returned by the server." (buffer (get-buffer-create "*mastodon-update-profile*")) (inhibit-read-only t)) (switch-to-buffer-other-window buffer) + (setq-local header-line-format + (propertize + "Edit your profile note. C-c C-c to send, C-c C-k to cancel." + 'face font-lock-comment-face)) (mastodon-profile-update-mode t) (insert note) (goto-char (point-min)) -- cgit v1.2.3