From ff859ba22c23c01bdc9f4390e41eedc3254b9334 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sun, 20 Nov 2022 12:30:11 +0100 Subject: mastodon-handle-regex: use for company + propertizing --- lisp/mastodon-toot.el | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 125eeea..572d575 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -186,6 +186,14 @@ For the moment we just put all composed toots in here, as we want to also capture toots that are 'sent' but that don't successfully send.") +(defvar mastodon-handle-regex + (concat + ;; preceding space or bol [boundary doesn't work with @] + "\\([\n\t ]\\|^\\)" + "\\(?2:@[1-9a-zA-Z._-]+" ; a handle + "\\(@[^ \n\t]*\\)?\\)" ; with poss domain, * = allow only @ + "\\b")) + (defvar mastodon-toot-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "C-c C-c") #'mastodon-toot--send) @@ -770,17 +778,24 @@ for matches, CANDIDATES-FUN, ANNOT-FUN, and META-FUN are functions called on ARG to generate formatted candidates, annotation, and meta fields respectively." (interactive (list 'interactive)) - (cl-case command - (interactive (company-begin-backend (quote backend-name))) - (prefix (when (and (bound-and-true-p mastodon-toot-mode) ; if masto toot minor mode - (save-excursion - (forward-whitespace -1) - (forward-whitespace 1) - (looking-at str-prefix))) - (concat str-prefix (company-grab-symbol)))) - (candidates (funcall candidates-fun arg)) - (annotation (funcall annot-fun arg)) - (meta (funcall meta-fun arg)))) + (let ((handle-before + (save-match-data + (save-excursion + (re-search-backward mastodon-handle-regex nil :no-error) + (if (match-string-no-properties 2) + (buffer-substring-no-properties (match-beginning 2) (match-end 2)) + ""))))) + (cl-case command + (interactive (company-begin-backend (quote backend-name))) + (prefix (when (and (bound-and-true-p mastodon-toot-mode) ; if masto toot minor mode + (save-excursion + (forward-whitespace -1) + (forward-whitespace 1) + (looking-at str-prefix))) + (concat str-prefix (substring-no-properties handle-before 1)))) + (candidates (funcall candidates-fun arg)) + (annotation (funcall annot-fun arg)) + (meta (funcall meta-fun arg))))) (defun mastodon-toot-mentions (command &optional arg &rest ignored) "A company completion backend for toot mentions. @@ -1266,10 +1281,7 @@ Added to `after-change-functions'." 'success (cdr header-region)) (mastodon-toot--propertize-item - (concat "\\([\n\t ]\\|^\\)" ; preceding space or bol - "\\(?2:@[1-9a-zA-Z._-]+" ; a handle - "\\(@[1-9a-zA-Z._-]+\\)?\\)" ; with poss domain - "\\b") ; boundary + mastodon-handle-regex 'mastodon-display-name-face (cdr header-region))))) -- cgit v1.2.3 From 583dad59590bd6423138053b67961cf39fe81d02 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 19 Nov 2022 16:54:07 +0100 Subject: toot count: URLs = 23 chars, handes = no domain --- lisp/mastodon-toot.el | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 572d575..138602a 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -1182,21 +1182,23 @@ REPLY-JSON is the full JSON of the toot being replied to." (defun mastodon-toot--update-status-fields (&rest _args) "Update the status fields in the header based on the current state." (ignore-errors ;; called from after-change-functions so let's not leak errors - (let ((inhibit-read-only t) - (header-region (mastodon-tl--find-property-range 'toot-post-header + (let* ((inhibit-read-only t) + (header-region (mastodon-tl--find-property-range 'toot-post-header + (point-min))) + (count-region (mastodon-tl--find-property-range 'toot-post-counter (point-min))) - (count-region (mastodon-tl--find-property-range 'toot-post-counter + (visibility-region (mastodon-tl--find-property-range + 'toot-post-visibility (point-min))) + (nsfw-region (mastodon-tl--find-property-range 'toot-post-nsfw-flag (point-min))) - (visibility-region (mastodon-tl--find-property-range - 'toot-post-visibility (point-min))) - (nsfw-region (mastodon-tl--find-property-range 'toot-post-nsfw-flag - (point-min))) - (cw-region (mastodon-tl--find-property-range 'toot-post-cw-flag - (point-min)))) + (cw-region (mastodon-tl--find-property-range 'toot-post-cw-flag + (point-min))) + (toot-string (buffer-substring-no-properties (cdr header-region) + (point-max)))) (add-text-properties (car count-region) (cdr count-region) (list 'display (format "%s/%s characters" - (- (point-max) (cdr header-region)) + (mastodon-toot--count-toot-chars toot-string) (number-to-string mastodon-toot--max-toot-chars)))) (add-text-properties (car visibility-region) (cdr visibility-region) (list 'display @@ -1216,6 +1218,27 @@ REPLY-JSON is the full JSON of the toot being replied to." (list 'invisible (not mastodon-toot--content-warning) 'face 'mastodon-cw-face))))) +(defun mastodon-toot--count-toot-chars (toot-string) + "Count the characters in the current toot. +URLs always = 23, and domain names of handles are not counted. +This is how mastodon does it." + (with-temp-buffer + (switch-to-buffer (current-buffer)) + (insert toot-string) + (goto-char (point-min)) + ;; handle URLs + (while (search-forward-regexp "\\w+://[^ \n]*" nil t) ; URL + (replace-match "xxxxxxxxxxxxxxxxxxxxxxx")) ; 23 x's + ;; handle @handles + (goto-char (point-min)) + (while (search-forward-regexp (concat "\\(?2:@[^ @\n]+\\)" ; a handle only + "\\(@[^ \n]+\\)?" ; with poss domain + "\\b") + nil t) + (replace-match (match-string 2))) ; replace with handle only + (length (buffer-substring (point-min) (point-max))))) + + (defun mastodon-toot--save-toot-text (&rest _args) "Save the current toot text in `mastodon-toot-current-toot-text'. Added to `after-change-functions' in new toot buffers." -- cgit v1.2.3 From 3cbfab81c2619d37ec04ea3e92bf562d8415314a Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 21 Nov 2022 11:06:56 +0100 Subject: http don't switch-to-buffer on response error --- lisp/mastodon-http.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 6e7bfb3..a556c2f 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -88,7 +88,7 @@ Message status and JSON error from RESPONSE if unsuccessful." (mastodon-http--status)))) (if (string-prefix-p "2" status) (funcall success) - (switch-to-buffer response) + ;; (switch-to-buffer response) ;; 404 returns http response not JSON: (if (string-prefix-p "404" status) (message "Error %s: page not found" status) -- cgit v1.2.3 From b6d473b1fbd0e9d42ed25c792519ddb27936c2dc Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 21 Nov 2022 11:27:51 +0100 Subject: Revert "http don't switch-to-buffer on response error" This reverts commit 3cbfab81c2619d37ec04ea3e92bf562d8415314a. --- lisp/mastodon-http.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index a556c2f..6e7bfb3 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -88,7 +88,7 @@ Message status and JSON error from RESPONSE if unsuccessful." (mastodon-http--status)))) (if (string-prefix-p "2" status) (funcall success) - ;; (switch-to-buffer response) + (switch-to-buffer response) ;; 404 returns http response not JSON: (if (string-prefix-p "404" status) (message "Error %s: page not found" status) -- cgit v1.2.3 From 90df6d50aa5b1557e7bd69a49ec2925b6f4da7ab Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 21 Nov 2022 16:19:40 +0100 Subject: mastodon-url-lookup --- lisp/mastodon.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index e6dcd3c..15718db 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -272,7 +272,7 @@ If REPLY-JSON is the json of the toot being replied to." ;;;###autoload (defun mastodon-url-lookup (&optional query-url) - "If QUERY-URL resembles a mastodon link, try to load in `mastodon.el'. + "If a URL resembles a mastodon link, try to load in `mastodon.el'. Does a WebFinger lookup. URL can be arg QUERY-URL, or URL at point, or provided by the user. If a status or account is found, load it in `mastodon.el', if -- cgit v1.2.3 From 59e2137660da97e38393f1dff928b90aa1de121e Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 22 Nov 2022 10:08:46 +0100 Subject: fix list-name grabbing in list add/delete/edit --- lisp/mastodon-tl.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 34048e7..47947d2 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1493,7 +1493,7 @@ If ID is provided, use that list." (interactive) (let* ((list-names (unless id (mastodon-tl--get-lists-names))) (name-old (if id - (get-text-property (point) 'list-id) + (get-text-property (point) 'list-name) (completing-read "Edit list: " list-names))) (id (or id (mastodon-tl--get-list-id name-old))) @@ -1637,7 +1637,7 @@ a: add account to this list, r: remove account from this list" If ID is provided, use that list." (interactive) (let* ((list-name (if id - (get-text-property (point) 'list-id) + (get-text-property (point) 'list-name) (completing-read "Add account to list: " (mastodon-tl--get-lists-names) nil t))) (list-id (or id (mastodon-tl--get-list-id list-name))) @@ -1667,7 +1667,7 @@ If ID is provided, use that list." If ID is provided, use that list." (interactive) (let* ((list-name (if id - (get-text-property (point) 'list-id) + (get-text-property (point) 'list-name) (completing-read "Remove account from list: " (mastodon-tl--get-lists-names) nil t))) (list-id (or id (mastodon-tl--get-list-id list-name))) -- cgit v1.2.3 From e1d53239cd633e7d8b3d1638284963a2e6e7dba3 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 26 Nov 2022 18:20:01 +0100 Subject: nil the update-fun in buffer-spec for --thread views --- lisp/mastodon-tl.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 7d23b69..a5b5ed7 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1491,10 +1491,9 @@ ID is that of the toot to view." (with-output-to-temp-buffer buffer (switch-to-buffer buffer) (mastodon-mode) - (mastodon-tl--set-buffer-spec - buffer - (format "statuses/%s/context" id) - 'mastodon-tl--thread) + (mastodon-tl--set-buffer-spec buffer + (format "statuses/%s/context" id) + nil) (let ((inhibit-read-only t)) (mastodon-tl--timeline (alist-get 'ancestors context)) (goto-char (point-max)) -- cgit v1.2.3 From 1ae42ccc7771ee8584d5aad0675b62f7ba851939 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 28 Nov 2022 22:54:57 +0100 Subject: update package commentary --- lisp/mastodon.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 3e0d4e8..20b420e 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -29,8 +29,8 @@ ;;; Commentary: -;; mastodon.el is an Emacs client for Mastodon , -;; the federated microblogging social network. It also works with Pleroma instances. +;; mastodon.el is an Emacs client for Mastodon , +;; the federated microblogging social network. It also works with Pleroma instances and other services that implement the Mastodon API. ;; See the readme file at https://codeberg.org/martianh/mastodon.el for set up and usage details. ;;; Code: -- cgit v1.2.3 From 23413553a65a9749dcf8dfe9090722262b8755df Mon Sep 17 00:00:00 2001 From: Bas Alberts Date: Thu, 22 Dec 2022 11:01:24 -0500 Subject: fix for custom emoji path traversal --- lisp/mastodon-toot.el | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 8d8bfc2..66e6e91 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -610,13 +610,19 @@ To use the downloaded emoji, run `mastodon-toot--enable-custom-emoji'." (unless (file-directory-p mastodon-custom-emoji-dir) (make-directory mastodon-custom-emoji-dir nil)) ; no add parent (mapc (lambda (x) - (url-copy-file (alist-get 'url x) - (concat - mastodon-custom-emoji-dir - (alist-get 'shortcode x) - "." - (file-name-extension (alist-get 'url x))) - t)) + (let ((url (alist-get 'url x)) + (shortcode (alist-get 'shortcode x))) + ;; skip anything that contains unexpected characters + (when (and url shortcode + (string-match-p "^[a-zA-Z0-9-_]*$" shortcode) + (string-match-p "^[a-zA-Z]*$" (file-name-extension url))) + (url-copy-file url + (concat + mastodon-custom-emoji-dir + shortcode + "." + (file-name-extension url)) + t)))) custom-emoji) (message "Custom emoji for %s downloaded to %s" mastodon-instance-url -- cgit v1.2.3 From c8044cfdeaac2a43f4a7c25cbb8e6e2c32307a5c Mon Sep 17 00:00:00 2001 From: Bas Alberts Date: Thu, 22 Dec 2022 22:43:23 -0500 Subject: further harden custom emoji regex filtering Prevent empty string shortcodes from creating dotfiles inside the custom emoji download dir to prevent e.g. ".envrc" and other such contextual dotfiles from being created in the legitimate download location. --- lisp/mastodon-toot.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 66e6e91..7ca9fce 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -614,8 +614,8 @@ To use the downloaded emoji, run `mastodon-toot--enable-custom-emoji'." (shortcode (alist-get 'shortcode x))) ;; skip anything that contains unexpected characters (when (and url shortcode - (string-match-p "^[a-zA-Z0-9-_]*$" shortcode) - (string-match-p "^[a-zA-Z]*$" (file-name-extension url))) + (string-match-p "^[a-zA-Z0-9-_]+$" shortcode) + (string-match-p "^[a-zA-Z]+$" (file-name-extension url))) (url-copy-file url (concat mastodon-custom-emoji-dir -- cgit v1.2.3 From e69aaeeae62b2b2dd0b9ec25c6be02c0d456a4e9 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 13 Jan 2023 09:31:43 +0100 Subject: case-insensitive match for --get-link-header-from-response pleroma uses "link", not "Link". FIXES #352 --- lisp/mastodon-tl.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index b3427fc..1d1ca97 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -2821,7 +2821,8 @@ from the start if it is nil." (defun mastodon-tl--get-link-header-from-response (headers) "Get http Link header from list of http HEADERS." (when headers - (split-string (alist-get "Link" headers nil nil 'equal) ", "))) + ;; pleroma uses "link", so case-insensitive match required: + (split-string (alist-get "Link" headers nil nil 'cl-equalp) ", "))) (defun mastodon-tl--init (buffer-name endpoint update-function &optional headers params) "Initialize BUFFER-NAME with timeline targeted by ENDPOINT asynchronously. -- cgit v1.2.3 From 2a70e937c26a26be75a611e6a8b9d37385ea650f Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 1 Mar 2023 22:33:38 +0100 Subject: FIX #398 -- bad if from bad brackets in --more --- lisp/mastodon-tl.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index ba6b1df..8197315 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -2789,12 +2789,12 @@ when showing followers or accounts followed." ;;(prev (cadr (mastodon-tl--link-header))) (url (mastodon-tl--build-link-header-url next))) (mastodon-http--get-response-async url nil 'mastodon-tl--more* (current-buffer) - (point) :headers)) - (mastodon-tl--more-json-async - (mastodon-tl--get-endpoint) - (mastodon-tl--oldest-id) - (mastodon-tl--update-params) - 'mastodon-tl--more* (current-buffer) (point)))))) + (point) :headers)))) + (mastodon-tl--more-json-async + (mastodon-tl--get-endpoint) + (mastodon-tl--oldest-id) + (mastodon-tl--update-params) + 'mastodon-tl--more* (current-buffer) (point)))) (defun mastodon-tl--more* (response buffer point-before &optional headers) "Append older toots to timeline, asynchronously. -- cgit v1.2.3 From 98838de25451a0cf1cf0b37eee2df62222b364ed Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 10 Mar 2023 15:12:21 +0100 Subject: notifs-get: force set kmap in buffer --- lisp/mastodon.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index cd4cf13..c7c674a 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -294,7 +294,8 @@ BUFFER-NAME is added to \"*mastodon-\" to create the buffer name." "notifications" 'mastodon-notifications--timeline type) - (use-local-map mastodon-notifications--map)))) + (with-current-buffer buffer + (use-local-map mastodon-notifications--map))))) ;; URL lookup: should be available even if `mastodon.el' not loaded: -- cgit v1.2.3 From 4145c06d2f45756f7b48cd25b0c6672cc71f2cff Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 10 Mar 2023 15:12:43 +0100 Subject: notifs-get: fix buffer name setting --- lisp/mastodon.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index c7c674a..3f57552 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -283,8 +283,9 @@ If REPLY-JSON is the json of the toot being replied to." Optionally only print notifications of type TYPE, a string. BUFFER-NAME is added to \"*mastodon-\" to create the buffer name." (interactive) - (let ((buffer (or (concat "*mastodon-" buffer-name "*") - "*mastodon-notifications*"))) + (let ((buffer (if buffer-name + (concat "*mastodon-" buffer-name "*") + "*mastodon-notifications*"))) (if (get-buffer buffer) (progn (switch-to-buffer buffer) (mastodon-tl--update)) -- cgit v1.2.3 From 08ed1ae30888086256f343be978cf7eb65cec9eb Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 10 Mar 2023 22:43:17 +0100 Subject: fix broken instance-response-fun --- lisp/mastodon-tl.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 0309d20..9c12f84 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -2339,15 +2339,15 @@ INSTANCE is an instance domain name." nil ; params nil ; silent :vector))) - (mastodon-tl--instance-response-fun response brief))))) + (mastodon-tl--instance-response-fun response brief instance))))) (defun mastodon-tl--instance-response-fun (response brief instance) "Display instance description RESPONSE in a new buffer. BRIEF means to show fewer details." (when response - (let ((domain (url-file-nondirectory instance)) - (buf (get-buffer-create - (format "*mastodon-instance-%s*" domain)))) + (let* ((domain (url-file-nondirectory instance)) + (buf (get-buffer-create + (format "*mastodon-instance-%s*" domain)))) (with-current-buffer buf (switch-to-buffer-other-window buf) (let ((inhibit-read-only t)) -- cgit v1.2.3 From 51ebf711241333195756865034c15391bf54f401 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 23 Mar 2023 15:11:58 +0100 Subject: make list-follow-tags idiot proof --- lisp/mastodon-tl.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 644a3d4..f557282 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -2037,8 +2037,10 @@ If TAG is provided, unfollow it." (interactive) (let* ((followed-tags-json (mastodon-tl--followed-tags)) (tags (mastodon-tl--map-alist 'name followed-tags-json)) - (tag (completing-read "Tag: " tags))) - (mastodon-tl--get-tag-timeline tag))) + (tag (completing-read "Tag: " tags nil))) + (if (null tag) + (message "You have to follow some tags first.") + (mastodon-tl--get-tag-timeline tag)))) ;;; UPDATING, etc. -- cgit v1.2.3 From 002720dd88037c25f1a40c32d30cc5cb44db645d Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 27 Mar 2023 12:22:11 +0200 Subject: remove all ;; Package-Requires: declarations save for main file main file is set in .dir-locals.el now --- lisp/mastodon-auth.el | 1 - lisp/mastodon-client.el | 1 - lisp/mastodon-discover.el | 1 - lisp/mastodon-http.el | 1 - lisp/mastodon-media.el | 1 - lisp/mastodon-notifications.el | 1 - lisp/mastodon-search.el | 1 - lisp/mastodon-tl.el | 1 - lisp/mastodon-toot.el | 1 - lisp/mastodon-views.el | 1 - 10 files changed, 10 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index ec56a05..0db8a19 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -5,7 +5,6 @@ ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt ;; Version: 1.0.0 -;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-client.el b/lisp/mastodon-client.el index 5981a26..b358ed7 100644 --- a/lisp/mastodon-client.el +++ b/lisp/mastodon-client.el @@ -5,7 +5,6 @@ ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt ;; Version: 1.0.0 -;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-discover.el b/lisp/mastodon-discover.el index 958df92..c06de1f 100644 --- a/lisp/mastodon-discover.el +++ b/lisp/mastodon-discover.el @@ -6,7 +6,6 @@ ;; Marty Hiatt ;; Maintainer: Marty Hiatt ;; Version: 1.0.0 -;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 3632a11..49ffbf8 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -6,7 +6,6 @@ ;; Marty Hiatt ;; Maintainer: Marty Hiatt ;; Version: 1.0.0 -;; Package-Requires: ((emacs "27.1") (request "0.3.0")) ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index 63860bd..4d36f47 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -6,7 +6,6 @@ ;; Marty Hiatt ;; Maintainer: Marty Hiatt ;; Version: 1.0.0 -;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index 22228f2..fd48a65 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -6,7 +6,6 @@ ;; Marty Hiatt ;; Maintainer: Marty Hiatt ;; Version: 1.0.0 -;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 3555238..e8ab093 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -4,7 +4,6 @@ ;; Author: Marty Hiatt ;; Maintainer: Marty Hiatt ;; Version: 1.0.0 -;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index fbee377..c929502 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -6,7 +6,6 @@ ;; Marty Hiatt ;; Maintainer: Marty Hiatt ;; Version: 1.0.0 -;; Package-Requires: ((emacs "27.1") (ts "0.3")) ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 65fc357..dfc02ee 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -6,7 +6,6 @@ ;; Marty Hiatt ;; Maintainer: Marty Hiatt ;; Version: 1.0.0 -;; Package-Requires: ((emacs "27.1") (persist "0.4")) ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el index affd899..9a25276 100644 --- a/lisp/mastodon-views.el +++ b/lisp/mastodon-views.el @@ -4,7 +4,6 @@ ;; Author: Marty Hiatt ;; Maintainer: Marty Hiatt ;; Version: 1.0.0 -;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. -- cgit v1.2.3 From 97bd086e4c2269bf6cfe453675bbf7f1210b5355 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 29 Mar 2023 13:37:48 +0200 Subject: user-handles-get: return immediately if only one candidate FIX #420. --- lisp/mastodon-tl.el | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index c929502..60ebc80 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1920,13 +1920,16 @@ LANGS is the accumulated array param alist if we re-run recursively." (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) - (format "Handle of user to %s: " action)) - user-handles - nil ; predicate - 'confirm)))) + ;; return immediately if only 1 handle: + (if (eq 1 (length user-handles)) + (car user-handles) + (completing-read (if (or (equal action "disable") + (equal action "enable")) + (format "%s notifications when user posts: " action) + (format "Handle of user to %s: " action)) + user-handles + nil ; predicate + 'confirm))))) (defun mastodon-tl--interactive-blocks-or-mutes-list-get (action) "Fetch the list of accounts for ACTION from the server. -- cgit v1.2.3 From 4b66cea2086e477e529d805b6cf0633e31acfe3c Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 29 Mar 2023 16:50:22 +0200 Subject: remove duplicate autoload --- lisp/mastodon.el | 1 - 1 file changed, 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 0ac24f7..69d5e2f 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -63,7 +63,6 @@ (autoload 'mastodon-profile--view-favourites "mastodon-profile") (autoload 'mastodon-search--search-query "mastodon-search") (autoload 'mastodon-search--trending-tags "mastodon-search") -(autoload 'mastodon-search--trending-tags "mastodon-search") (autoload 'mastodon-tl--block-user "mastodon-tl") (autoload 'mastodon-tl--follow-user "mastodon-tl") (autoload 'mastodon-tl--get-buffer-type "mastodon-tl") -- cgit v1.2.3 From ded80d1dff2d80c3be659f569f067a7ec4633c97 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 29 Mar 2023 16:51:21 +0200 Subject: refactor trending-tags to view-trending, add trending-statuses --- lisp/mastodon-search.el | 52 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 13 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index e8ab093..bc51d22 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -40,10 +40,13 @@ (autoload 'mastodon-tl--render-text "mastodon-tl") (autoload 'mastodon-tl--set-buffer-spec "mastodon-tl") (autoload 'mastodon-tl--set-face "mastodon-tl") +(autoload 'mastodon-tl--timeline "mastodon-tl") +(autoload 'mastodon-tl--toot "mastodon-tl") (defvar mastodon-toot--completion-style-for-mentions) (defvar mastodon-instance-url) (defvar mastodon-tl--link-keymap) +(defvar mastodon-tl--horiz-bar) ;; functions for completion of mentions in mastodon-toot @@ -81,26 +84,53 @@ QUERY is the string to search." (defun mastodon-search--trending-tags () "Display a list of tags trending on your instance." (interactive) - (let* ((url (mastodon-http--api "trends")) + (mastodon-search--view-trending "tags" + #'mastodon-search--print-tags-list)) + +(defun mastodon-search--trending-statuses () + "Display a list of statuses trending on your instance." + (interactive) + (mastodon-search--view-trending "statuses" + #'mastodon-tl--timeline)) + +(defun mastodon-search--get-full-statuses-data (response) + "For statuses list in RESPONSE, fetch and return full status JSON." + (let ((status-ids-list + (mapcar #'mastodon-search--get-id-from-status response))) + (mapcar #'mastodon-search--fetch-full-status-from-id + status-ids-list))) + +(defun mastodon-search--view-trending (type print-fun) + "Display a list of tags trending on your instance. +TYPE is a string, either tags, statuses, or links. +PRINT-FUN is the function used to print the data from the response." + (let* ((url (mastodon-http--api + (format "trends/%s" type))) (response (mastodon-http--get-json url)) - (tags (mapcar #'mastodon-search--get-hashtag-info - response)) - (buffer (get-buffer-create "*mastodon-trending*"))) + (data (cond ((equal type "tags") + (mapcar #'mastodon-search--get-hashtag-info + response)) + ((equal type "statuses") + (mastodon-search--get-full-statuses-data response)) + ((equal type "links") + (message "todo")))) + (buffer (get-buffer-create + (format "*mastodon-trending-%s*" type)))) (with-current-buffer buffer (switch-to-buffer (current-buffer)) (mastodon-mode) (let ((inhibit-read-only t)) (erase-buffer) (mastodon-tl--set-buffer-spec (buffer-name buffer) - "api/v1/trends" + (format "api/v1/trends/%s" type) nil) ;; hashtag results: (insert (mastodon-tl--set-face (concat "\n " mastodon-tl--horiz-bar "\n" - " TRENDING HASHTAGS\n" + (upcase (format " TRENDING %s\n" type)) " " mastodon-tl--horiz-bar "\n\n") 'success)) - (mastodon-search--print-tags-list tags))))) + (funcall print-fun data))))) ;; functions for mastodon search @@ -118,12 +148,8 @@ QUERY is the string to search." ;; accts)) ; returns a list of three-item lists (tags-list (mapcar #'mastodon-search--get-hashtag-info tags)) - ;; (status-list (mapcar #'mastodon-search--get-status-info - ;; statuses)) - (status-ids-list (mapcar #'mastodon-search--get-id-from-status - statuses)) - (toots-list-json (mapcar #'mastodon-search--fetch-full-status-from-id - status-ids-list))) + (toots-list-json + (mastodon-search--get-full-statuses-data statuses))) (with-current-buffer (get-buffer-create buffer) (switch-to-buffer buffer) (mastodon-mode) -- cgit v1.2.3 From ef07e69cf6d55a33cfe665a4d7db5d58271d1d91 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 29 Mar 2023 16:59:40 +0200 Subject: remove stray interactive calls for search-accounts/tags-query --- lisp/mastodon-search.el | 2 -- 1 file changed, 2 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index bc51d22..4b4684f 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -59,7 +59,6 @@ (defun mastodon-search--search-accounts-query (query) "Prompt for a search QUERY and return accounts synchronously. Returns a nested list containing user handle, display name, and URL." - (interactive "sSearch mastodon for: ") (let* ((url (mastodon-http--api "accounts/search")) (response (if (equal mastodon-toot--completion-style-for-mentions "following") (mastodon-http--get-json url `(("q" . ,query) ("following" . "true")) :silent) @@ -71,7 +70,6 @@ Returns a nested list containing user handle, display name, and URL." (defun mastodon-search--search-tags-query (query) "Return an alist containing tag strings plus their URLs. QUERY is the string to search." - (interactive "sSearch for hashtag: ") (let* ((url (format "%s/api/v2/search" mastodon-instance-url)) (params `(("q" . ,query) ("type" . "hashtags"))) -- cgit v1.2.3 From b068448e9adcf83db0ed7110b975ea0810bd11c3 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 29 Mar 2023 16:59:56 +0200 Subject: require search --- lisp/mastodon.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 69d5e2f..be96733 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -38,6 +38,7 @@ (eval-when-compile (require 'subr-x)) (require 'mastodon-http) (require 'mastodon-toot) +(require 'mastodon-search) (require 'url) (require 'thingatpt) (require 'shr) @@ -61,8 +62,6 @@ (autoload 'mastodon-profile--update-user-profile-note "mastodon-profile") (autoload 'mastodon-profile--view-bookmarks "mastodon-profile") (autoload 'mastodon-profile--view-favourites "mastodon-profile") -(autoload 'mastodon-search--search-query "mastodon-search") -(autoload 'mastodon-search--trending-tags "mastodon-search") (autoload 'mastodon-tl--block-user "mastodon-tl") (autoload 'mastodon-tl--follow-user "mastodon-tl") (autoload 'mastodon-tl--get-buffer-type "mastodon-tl") -- cgit v1.2.3 From 386178c3d2b1427c5f2c50034e865f44efa4d081 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 29 Mar 2023 17:03:03 +0200 Subject: cull stray hashtags comment --- lisp/mastodon-search.el | 1 - 1 file changed, 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 4b4684f..3794c4e 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -122,7 +122,6 @@ PRINT-FUN is the function used to print the data from the response." (mastodon-tl--set-buffer-spec (buffer-name buffer) (format "api/v1/trends/%s" type) nil) - ;; hashtag results: (insert (mastodon-tl--set-face (concat "\n " mastodon-tl--horiz-bar "\n" (upcase (format " TRENDING %s\n" type)) -- cgit v1.2.3 From 2a0ed3e4e8f9a9f6067385e241e3eaf65d6e48e4 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 30 Mar 2023 09:34:29 +0200 Subject: view-trending: add limit params, and go to point min --- lisp/mastodon-search.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 3794c4e..abb7995 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -104,7 +104,11 @@ TYPE is a string, either tags, statuses, or links. PRINT-FUN is the function used to print the data from the response." (let* ((url (mastodon-http--api (format "trends/%s" type))) - (response (mastodon-http--get-json url)) + ;; max for statuses = 40, for others = 20 + (params (if (equal type "statuses") + `(("limit" . "40")) + `(("limit" . "20")) )) + (response (mastodon-http--get-json url params)) (data (cond ((equal type "tags") (mapcar #'mastodon-search--get-hashtag-info response)) @@ -127,7 +131,9 @@ PRINT-FUN is the function used to print the data from the response." (upcase (format " TRENDING %s\n" type)) " " mastodon-tl--horiz-bar "\n\n") 'success)) - (funcall print-fun data))))) + (funcall print-fun data) + (unless (equal type "statuses") + (goto-char (point-min)))))) ;; functions for mastodon search -- cgit v1.2.3 From 609e3243d3a772c2a9cbf2982a5871aadcd6dca9 Mon Sep 17 00:00:00 2001 From: Bruce Durling Date: Fri, 31 Mar 2023 18:07:55 +0100 Subject: Fix missing close paren --- lisp/mastodon-search.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index abb7995..9b3641b 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -133,7 +133,7 @@ PRINT-FUN is the function used to print the data from the response." 'success)) (funcall print-fun data) (unless (equal type "statuses") - (goto-char (point-min)))))) + (goto-char (point-min))))))) ;; functions for mastodon search -- cgit v1.2.3 From d2cf869d4917d0a12c9aa866522632b72aceca7f Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 1 Apr 2023 09:53:24 +0200 Subject: add trending types to -get-buffer-type. FIX #427. --- lisp/mastodon-tl.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 60ebc80..3c66176 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1489,8 +1489,13 @@ call this function after it is set or use something else." ;; search ((string-suffix-p "search" endpoint-fun) 'search) - ((string-suffix-p "trends" endpoint-fun) + ;; trends + ((equal "api/v1/trends/statuses" endpoint-fun) + 'trending-statuses) + ((equal "api/v1/trends/tags" endpoint-fun) 'trending-tags) + ((equal "api/v1/trends/links" endpoint-fun) + 'trending-links) ;; User's views: ((string= "filters" endpoint-fun) 'filters) -- cgit v1.2.3 From 0da470e43ebbd84750c3f307399383ff3e1d79d3 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 5 Apr 2023 09:58:02 +0200 Subject: rejig polls for pleroma compat --- lisp/mastodon-toot.el | 47 ++++++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 21 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index dfc02ee..3cab565 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -1170,22 +1170,25 @@ which is used to attach it to a toot when posting." mastodon-toot--media-attachments)) (list "None"))) -(defun mastodon-toot--fetch-max-poll-options () - "Return the maximum number of poll options." - (mastodon-toot--fetch-poll-field 'max_options)) - -(defun mastodon-toot--fetch-max-poll-option-chars () - "Return the maximum number of characters a poll option may have." - (or (mastodon-toot--fetch-poll-field 'max_characters_per_option) - 50)) ; masto default - -(defun mastodon-toot--fetch-poll-field (field) - "Return FIELD from the poll settings from the user's instance." - (let* ((instance (mastodon-http--get-json (mastodon-http--api "instance")))) - (alist-get field - (alist-get 'polls - (alist-get 'configuration instance) - instance)))) +(defun mastodon-toot--fetch-max-poll-options (instance) + "Return the maximum number of poll options from INSTANCE, which is json." + (mastodon-toot--fetch-poll-field 'max_options instance)) + +(defun mastodon-toot--fetch-max-poll-option-chars (instance) + "Return the maximum number of characters a poll option may have. +INSTANCE is JSON." + (if (alist-get 'pleroma instance) + (mastodon-toot--fetch-poll-field 'max_option_chars instance) + (or (mastodon-toot--fetch-poll-field 'max_characters_per_option instance) + 50))) ; masto default + +(defun mastodon-toot--fetch-poll-field (field instance) + "Return FIELD from the poll settings from INSTANCE, which is json." + (let* ((polls (if (alist-get 'pleroma instance) + (alist-get 'poll_limits instance) + (alist-get 'polls + (alist-get 'configuration instance))))) + (alist-get field polls))) (defun mastodon-toot--read-poll-options-count (max) "Read the user's choice of the number of options the poll should have. @@ -1200,15 +1203,17 @@ MAX is the maximum number set by their instance." "Prompt for new poll options and return as a list." (interactive) ;; re length, API docs show a poll 9 options. - (let* ((max-options (mastodon-toot--fetch-max-poll-options)) + (let* ((instance (mastodon-http--get-json (mastodon-http--api "instance"))) + (max-options (mastodon-toot--fetch-max-poll-options instance)) (count (mastodon-toot--read-poll-options-count max-options)) - (length (mastodon-toot--fetch-max-poll-option-chars)) + (length (mastodon-toot--fetch-max-poll-option-chars instance)) (multiple-p (y-or-n-p "Multiple choice? ")) (options (mastodon-toot--read-poll-options count length)) (hide-totals (y-or-n-p "Hide votes until poll ends? ")) - (expiry (mastodon-toot--get-poll-expiry))) + (expiry (mastodon-toot--read-poll-expiry))) (setq mastodon-toot-poll - `(:options ,options :length ,length :multi ,multiple-p :hide ,hide-totals :expiry ,expiry)) + `(:options ,options :length ,length :multi ,multiple-p + :hide ,hide-totals :expiry ,expiry)) (message "poll created!"))) (defun mastodon-toot--read-poll-options (count length) @@ -1217,7 +1222,7 @@ LENGTH is the maximum character length allowed for a poll option." (cl-loop for x from 1 to count collect (read-string (format "Poll option [%s/%s] [max %s chars]: " x count length)))) -(defun mastodon-toot--get-poll-expiry () +(defun mastodon-toot--read-poll-expiry () "Prompt for a poll expiry time." ;; API requires this in seconds (let* ((options (mastodon-toot--poll-expiry-options-alist)) -- cgit v1.2.3 From 9cd79997e072787ea2eb21a25dc2868b42ee3da2 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 5 Apr 2023 10:04:52 +0200 Subject: change package description --- lisp/mastodon.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index be96733..fa822a0 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -1,4 +1,4 @@ -;;; mastodon.el --- Client for Mastodon, a federated social network -*- lexical-binding: t -*- +;;; mastodon.el --- Client for Mastodon and compatible fediverse services -*- lexical-binding: t -*- ;; Copyright (C) 2017-2019 Johnson Denen ;; Copyright (C) 2020-2022 Marty Hiatt -- cgit v1.2.3 From f53847ef151bf841a2cbdaad556b334f3bba2986 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 5 Apr 2023 11:31:11 +0200 Subject: view instance: only look for property-json in profile buf. prevents the loading of older toots if called on last toot in buffer. --- lisp/mastodon-views.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el index 9a25276..5576b14 100644 --- a/lisp/mastodon-views.el +++ b/lisp/mastodon-views.el @@ -747,10 +747,14 @@ INSTANCE is an instance domain name." ;; be looking at toots/boosts/users in a profile buffer. ;; profile-json works as a defacto test for if point is on the ;; profile details at the top of a profile buffer. - (url (if (mastodon-tl--property 'profile-json) + (url (if (and (mastodon-tl--profile-buffer-p) + ;; only call this in profile buffers: + (mastodon-tl--property 'profile-json)) (alist-get 'url toot) ; profile description (alist-get 'url account))) - (username (if (mastodon-tl--property 'profile-json) + (username (if (and (mastodon-tl--profile-buffer-p) + ;; only call this in profile buffers: + (mastodon-tl--property 'profile-json)) (alist-get 'username toot) ;; profile (alist-get 'username account))) (instance (cond (instance -- cgit v1.2.3 From dc2349589945e7926a1fca9e17493a5fde7ee958 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 5 Apr 2023 13:10:40 +0200 Subject: remove stray multi-accounts code --- lisp/mastodon-views.el | 1 - 1 file changed, 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el index 38344b3..de498f3 100644 --- a/lisp/mastodon-views.el +++ b/lisp/mastodon-views.el @@ -817,7 +817,6 @@ INSTANCE is the instance were are working with." (mastodon-views--print-json-keys response) ;; (mastodon-mode) ; breaks our 'q' binding that avoids leaving ;; split window - (setq mastodon-account--data account) (mastodon-tl--set-buffer-spec (buffer-name buf) "instance" nil) -- cgit v1.2.3