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(-) 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(-) 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 96829d0d1d61650bd5ee05d06dcb94ff764c2ca6 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 21 Nov 2022 10:27:13 +0100 Subject: fix toot del/pin tests --- test/mastodon-toot-tests.el | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/test/mastodon-toot-tests.el b/test/mastodon-toot-tests.el index 9741964..b88510c 100644 --- a/test/mastodon-toot-tests.el +++ b/test/mastodon-toot-tests.el @@ -120,11 +120,12 @@ mention string." "Should refuse to delete toot." (let ((toot mastodon-toot-test-base-toot)) (with-mock - (mock (mastodon-auth--user-acct) => "joebogus") - ;; (mock (mastodon-toot--own-toot-p toot) => nil) - (mock (mastodon-tl--property 'toot-json) => mastodon-toot-test-base-toot) - (should (equal (mastodon-toot--delete-toot) - "You can only delete (and redraft) your own toots."))))) + (mock (mastodon-auth--user-acct) => "joebogus") + ;; (mock (mastodon-toot--own-toot-p toot) => nil) + (mock (mastodon-tl--property 'toot-json) => mastodon-toot-test-base-toot) + (mock (mastodon-tl--property 'base-toot) => toot) + (should (equal (mastodon-toot--delete-toot) + "You can only delete (and redraft) your own toots."))))) (ert-deftest mastodon-toot--delete-toot () "Should return correct triaged response to a legitimate DELETE request." @@ -133,16 +134,17 @@ mention string." (let ((delete-response (current-buffer)) (toot mastodon-toot-test-base-toot)) (with-mock - (mock (mastodon-tl--property 'toot-json) => toot) - ;; (mock (mastodon-toot--own-toot-p toot) => t) - (mock (mastodon-auth--user-acct) => "acct42@example.space") - (mock (mastodon-http--api (format "statuses/61208")) - => "https://example.space/statuses/61208") - (mock (y-or-n-p "Delete this toot? ") => t) - (mock (mastodon-http--delete "https://example.space/statuses/61208") - => delete-response) - (should (equal (mastodon-toot--delete-toot) - "Toot deleted!")))))) + (mock (mastodon-tl--property 'toot-json) => toot) + (mock (mastodon-tl--property 'base-toot) => toot) + ;; (mock (mastodon-toot--own-toot-p toot) => t) + (mock (mastodon-auth--user-acct) => "acct42@example.space") + (mock (mastodon-http--api (format "statuses/61208")) + => "https://example.space/statuses/61208") + (mock (y-or-n-p "Delete this toot? ") => t) + (mock (mastodon-http--delete "https://example.space/statuses/61208") + => delete-response) + (should (equal (mastodon-toot--delete-toot) + "Toot deleted!")))))) (ert-deftest mastodon-toot-action-pin () "Should return callback provided by `mastodon-toot--pin-toot-toggle'." @@ -167,7 +169,8 @@ mention string." (let ((pin-response (current-buffer)) (toot mastodon-toot-test-base-toot)) (with-mock - (mock (mastodon-tl--property 'toot-json) => toot) - (mock (mastodon-auth--user-acct) => "joebogus@example.space") - (should (equal (mastodon-toot--pin-toot-toggle) - "You can only pin your own toots.")))))) + (mock (mastodon-tl--property 'toot-json) => toot) + (mock (mastodon-tl--property 'base-toot) => toot) + (mock (mastodon-auth--user-acct) => "joebogus@example.space") + (should (equal (mastodon-toot--pin-toot-toggle) + "You can only pin your own toots.")))))) -- 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(-) 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(-) 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(-) 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(-) 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 cd2931dfd43d6e709779fb762cc951a540154a72 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 24 Nov 2022 13:34:08 +0100 Subject: readme read compatability --- README.org | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 92a2049..06f2970 100644 --- a/README.org +++ b/README.org @@ -6,7 +6,7 @@ * README -=mastodon.el= is an Emacs client for the Mastodon and Pleroma social networks. For info see https://joinmastodon.org/. +=mastodon.el= is an Emacs client for the AcitivityPub social networks that implement the Mastodon API. For info see https://joinmastodon.org/. ** Installation @@ -310,6 +310,12 @@ Optional dependencies: - =mpv= and =mpv.el= for viewing videos and gifs - =lingva.el= for translating toots +** Network compatibility. + +=mastodon.el= should work with ActivityPub servers that implement the Mastodon API. + +Apart from Mastodon itself, it is currently known to work with Pleroma and Gotosocial. If you attempt to use =mastodon.el= with another server that implements the Mastodon API and run into problems, feel free to open an issue. + ** Contributing PRs, issues, feature requests, and general feedback are very welcome! -- cgit v1.2.3 From 92f59ff56bf9264b3b1981d3d32cf9172a490ef0 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 26 Nov 2022 10:09:39 +0100 Subject: readme fill paras --- README.org | 60 +++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/README.org b/README.org index 06f2970..61d8246 100644 --- a/README.org +++ b/README.org @@ -6,7 +6,8 @@ * README -=mastodon.el= is an Emacs client for the AcitivityPub social networks that implement the Mastodon API. For info see https://joinmastodon.org/. +=mastodon.el= is an Emacs client for the AcitivityPub social networks that +implement the Mastodon API. For info see https://joinmastodon.org/. ** Installation @@ -25,7 +26,8 @@ Or, with =use-package=: :ensure t) #+END_SRC -The minimum Emacs version is now 27.1. But if you are running an older version it shouldn't be very hard to get it working. +The minimum Emacs version is now 27.1. But if you are running an older version +it shouldn't be very hard to get it working. *** MELPA @@ -100,10 +102,10 @@ restart Emacs and follow the steps again. =M-x mastodon= -Opens a =*mastodon-home*= buffer in the major mode and displays toots. If your credentials are not yet saved, you -will be prompted for email and password. The app registration process will -take place if your =mastodon-token-file= does not contain =:client_id= and -=:client_secret=. +Opens a =*mastodon-home*= buffer in the major mode and displays toots. If your +credentials are not yet saved, you will be prompted for email and password. +The app registration process will take place if your =mastodon-token-file= does +not contain =:client_id= and =:client_secret=. **** Keybindings @@ -222,12 +224,16 @@ You can download and use your instance's custom emoji *** Other commands and account settings: -- =mastodon-url-lookup=: Attempt to load URL in =mastodon.el=. URL may be the one at point or provided in the minibuffer. Should also work if =mastodon.el= is not yet loaded. +- =mastodon-url-lookup=: Attempt to load URL in =mastodon.el=. URL may be the one + at point or provided in the minibuffer. Should also work if =mastodon.el= is + not yet loaded. -- =mastodon-tl--view-instance-description=: View information about the instance that the author of the toot at point is on. +- =mastodon-tl--view-instance-description=: View information about the instance + that the author of the toot at point is on. - =mastodon-tl--view-own-instance=: View information about your own instance. -- =mastodon-search--trending-tags=: View a list of trending hashtags on your instance. +- =mastodon-search--trending-tags=: View a list of trending hashtags on your + instance. - =mastodon-tl--follow-tag=: Follow a tag (works like following a user) @@ -235,14 +241,21 @@ You can download and use your instance's custom emoji - =mastodon-tl--list-followed-tags=: View a list of tags you're following. -- =mastodon-profile--update-display-name=: Update the display name for your account. +- =mastodon-profile--update-display-name=: Update the display name for your + account. - =mastodon-profile--update-user-profile-note=: Update your bio note. - =mastodon-profile--update-meta-fields=: Update your metadata fields. -- =mastodon-profile--set-default-toot-visibility=: Set the default visibility for your toots. -- =mastodon-profile--account-locked-toggle=: Toggle the locked status of your account. Locked accounts have to manually approve follow requests. -- =mastodon-profile--account-discoverable-toggle=: Toggle the discoverable status of your account. Non-discoverable accounts are not listed in the profile directory. -- =mastodon-profile--account-bot-toggle=: Toggle whether your account is flagged as a bot. -- =mastodon-profile--account-sensitive-toggle=: Toggle whether your posts are marked as sensitive (nsfw) by default. +- =mastodon-profile--set-default-toot-visibility=: Set the default visibility + for your toots. +- =mastodon-profile--account-locked-toggle=: Toggle the locked status of your + account. Locked accounts have to manually approve follow requests. +- =mastodon-profile--account-discoverable-toggle=: Toggle the discoverable + status of your account. Non-discoverable accounts are not listed in the + profile directory. +- =mastodon-profile--account-bot-toggle=: Toggle whether your account is flagged + as a bot. +- =mastodon-profile--account-sensitive-toggle=: Toggle whether your posts are + marked as sensitive (nsfw) by default. *** Customization @@ -314,7 +327,9 @@ Optional dependencies: =mastodon.el= should work with ActivityPub servers that implement the Mastodon API. -Apart from Mastodon itself, it is currently known to work with Pleroma and Gotosocial. If you attempt to use =mastodon.el= with another server that implements the Mastodon API and run into problems, feel free to open an issue. +Apart from Mastodon itself, it is currently known to work with Pleroma and +Gotosocial. If you attempt to use =mastodon.el= with another server that +implements the Mastodon API and run into problems, feel free to open an issue. ** Contributing @@ -324,8 +339,12 @@ PRs, issues, feature requests, and general feedback are very welcome! 1. =mastodon.el= has bugs, as well as lots of room for improvement. 2. I receive very little feedback, so if I don't run into the bug it often doesn't get fixed. -3. If you run into something that seems broken, first try running =mastodon.el= in emacs with no init file (i.e. =emacs -q= (instructions and code for doing this are [[https://codeberg.org/martianh/mastodon.el/issues/300][here]]) to see if it also happens independently of your own config (it probably does). -4. Enable debug on error (=toggle-debug-on-error=), make the bug happen again, and copy the backtrace that appears. +3. If you run into something that seems broken, first try running =mastodon.el= + in emacs with no init file (i.e. =emacs -q= (instructions and code for doing + this are [[https://codeberg.org/martianh/mastodon.el/issues/300][here]]) to see if it also happens independently of your own config + (it probably does). +4. Enable debug on error (=toggle-debug-on-error=), make the bug happen again, + and copy the backtrace that appears. 5. Open an issue here and explain what is going on. *** Fixes and features @@ -337,7 +356,10 @@ PRs, issues, feature requests, and general feedback are very welcome! ** Supporting mastodon.el -If you'd like to support continued development of =mastodon.el=, I accept donations via paypal at martianhiatus [ at ] riseup [ dot ] net. If you would prefer a different payment method, write to me at that address and I can provide IBAN or other details. +If you'd like to support continued development of =mastodon.el=, I accept +donations via paypal at martianhiatus [ at ] riseup [ dot ] net. If you would +prefer a different payment method, write to me at that address and I can +provide IBAN or other details. I don't have a tech worker's income, so even a small tip would help out. -- cgit v1.2.3 From 52e8bf5ae56d20c9a8ed478284b4c591ba8d6932 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 26 Nov 2022 16:43:21 +0100 Subject: fix search.el test --- test/mastodon-search-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mastodon-search-tests.el b/test/mastodon-search-tests.el index e6d4cdb..8dc597a 100644 --- a/test/mastodon-search-tests.el +++ b/test/mastodon-search-tests.el @@ -119,7 +119,7 @@ (should (equal (mastodon-search--get-user-info-@ mastodon-search--single-account-query) - '(": ( ) { : | : & } ; :" "@mousebot" "https://todon.nl/@mousebot")))) + '("@mousebot" "https://todon.nl/@mousebot" ": ( ) { : | : & } ; :")))) (ert-deftest mastodon-search--get-user-info () "Should build a list from a single account for company completion." -- 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(-) 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(-) 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(-) 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(-) 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(-) 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 6c5d9b39abc9ec5b1d8d5fd93bf13b079c523e18 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 13 Jan 2023 09:46:17 +0100 Subject: readme --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.org b/README.org index 85ff179..c9245d7 100644 --- a/README.org +++ b/README.org @@ -350,7 +350,7 @@ PRs, issues, feature requests, and general feedback are very welcome! (it probably does). 4. Enable debug on error (=toggle-debug-on-error=), make the bug happen again, and copy the backtrace that appears. -5. Open an issue here and explain what is going on. +5. Open an issue here and explain what is going on. Provide your emacs version and what kind of server your account is on. *** Fixes and features -- cgit v1.2.3 From e232e078bd1e26cb770519d7ce9c00c547fded7e Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 13 Jan 2023 12:17:59 +0100 Subject: readme: coding style pointers --- README.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.org b/README.org index c9245d7..2cbc066 100644 --- a/README.org +++ b/README.org @@ -359,6 +359,13 @@ PRs, issues, feature requests, and general feedback are very welcome! 3. Run the tests and ensure that your code doesn't break any of them. 4. Create a pull request referencing the issue created in step 1. +*** coding style + +- This library uses an unconvential double dash (=--=) between file namespaces and function names, which contradicts normal Elisp style. This needs to be respected until the whole library is changed. +- Use =aggressive-indent-mode= or similar to keep your code indented. +- Single spaces end sentences in docstrings. +- There's no need for a blank line after the first docstring line (one is added automatically when documentation is displayed). + ** Supporting mastodon.el If you'd like to support continued development of =mastodon.el=, I accept -- cgit v1.2.3 From 7d4d8bc059c9253b66fb694593e7c9bc8bafbc41 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 13 Jan 2023 12:51:11 +0100 Subject: readme: paypalme --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.org b/README.org index 2cbc066..b180051 100644 --- a/README.org +++ b/README.org @@ -369,7 +369,7 @@ PRs, issues, feature requests, and general feedback are very welcome! ** Supporting mastodon.el If you'd like to support continued development of =mastodon.el=, I accept -donations via paypal at martianhiatus [ at ] riseup [ dot ] net. If you would +donations via paypal: https://paypal.me/martianh. If you would prefer a different payment method, write to me at that address and I can provide IBAN or other details. -- cgit v1.2.3 From 01e4bc440f9d89e2ac5ef06cfd160ddea743b3f1 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 28 Feb 2023 22:38:56 +0100 Subject: update readme bindings --- README.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index f13a538..f460b0e 100644 --- a/README.org +++ b/README.org @@ -167,12 +167,13 @@ not contain =:client_id= and =:client_secret=. |----------------+---------------------------------------------------------------------------| | | *Notifications view* | | =a=, =j= | accept/reject follow request | -| =c= | clear notification at point | +| =C-k= | clear notification at point | | | see =mastodon-notifications--get-*= functions for filtered views | |----------------+---------------------------------------------------------------------------| | | *Quitting* | | =q= | Quit mastodon buffer, leave window open | | =Q= | Quit mastodon buffer and kill window | +| =C-M-q= | Quit and kill all mastodon buffers | |----------------+---------------------------------------------------------------------------| **** Toot byline legend -- 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(-) 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(-) 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(-) 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(-) 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 a57c8c031a79c0d5dda1b3364e2cf2d5844c13e7 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 23 Mar 2023 11:44:40 +0100 Subject: update info from readme --- mastodon.info | 50 ++++++++++++++++++++++++++------------------------ mastodon.texi | 16 ++++++++++------ 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/mastodon.info b/mastodon.info index 3744169..b1b679c 100644 --- a/mastodon.info +++ b/mastodon.info @@ -215,8 +215,8 @@ your ‘mastodon-token-file’ does not contain ‘:client_id’ and *Help* ‘?’ Show discover menu of all bindings, if ‘discover’ is available *Timeline actions* - ‘n’ Go to next item (toot, notification) - ‘p’ Go to previous item (toot, notification) + ‘n’ Go to next item (toot, notification, user) + ‘p’ Go to previous item (toot, notification, user) ‘M-n=/=’ Go to the next interesting thing that has an action ‘M-p=/=’ Go to the previous interesting thing that has an action ‘F’ Open federated timeline @@ -232,17 +232,19 @@ your ‘mastodon-token-file’ does not contain ‘:client_id’ and ‘O’ View own profile ‘U’ update your profile bio note ‘;’ view instance description for toot at point + ‘:’ view followed tags and load a tag timeline ‘,’ view favouriters of toot at point ‘.’ view boosters of toot at point + ‘/’ switch between mastodon buffers *Other views* - ‘S’ search (posts, users, tags) (NB: only posts you have interacted with) + ‘s’ search (posts, users, tags) (NB: only posts you have interacted with) ‘I’, ‘c’, ‘d’ view, create, and delete filters ‘R’, ‘a’, ‘j’ view/accept/reject follow requests ‘G’ view follow suggestions ‘V’ view your favourited toots ‘K’ view bookmarked toots ‘X’ view/edit/create/delete lists - ‘s’ view your scheduled toots + ‘S’ view your scheduled toots *Toot actions* ‘t’ Compose a new toot ‘c’ Toggle content warning content @@ -260,7 +262,7 @@ your ‘mastodon-token-file’ does not contain ‘:client_id’ and ‘D’ delete and redraft toot at point, preserving reply/CW/visibility (‘S-C-’) ‘W’, ‘M’, ‘B’ (un)follow, (un)mute, (un)block author of toot at point *Profile view* - ‘C-c C-c’ cycle between statuses, followers, following, and statuses without boosts + ‘C-c C-c’ cycle between statuses, statuses without boosts, followers, and following ‘mastodon-profile--account-account-to-list’ (see lists view) *Notifications view* ‘a’, ‘j’ accept/reject follow request @@ -597,7 +599,7 @@ File: mastodon.info, Node: Supporting mastodonel, Next: Contributors, Prev: C ============================ If you’d like to support continued development of ‘mastodon.el’, I -accept donations via paypal: paypal.me/martianh +accept donations via paypal: https://paypal.me/martianh (https://paypal.me/martianh). If you would prefer a different payment method, write to me at that address and I can provide IBAN or other details. @@ -634,24 +636,24 @@ Node: Usage3098 Node: Logging in to your instance3508 Node: Timelines4505 Ref: Keybindings4980 -Ref: Toot byline legend9098 -Node: Composing toots9370 -Ref: Keybindings (1)10947 -Ref: Draft toots11465 -Node: Other commands and account settings11936 -Node: Customization14759 -Node: Alternative timeline layout15545 -Node: Live-updating timelines mastodon-async-mode15922 -Node: Translating toots16758 -Node: bookmarks and mastodonel17930 -Node: Dependencies18400 -Node: Network compatibility18992 -Node: Contributing19478 -Node: Bug reports19767 -Node: Fixes and features20673 -Node: Coding style21156 -Node: Supporting mastodonel21780 -Node: Contributors22302 +Ref: Toot byline legend9253 +Node: Composing toots9525 +Ref: Keybindings (1)11102 +Ref: Draft toots11620 +Node: Other commands and account settings12091 +Node: Customization14914 +Node: Alternative timeline layout15700 +Node: Live-updating timelines mastodon-async-mode16077 +Node: Translating toots16913 +Node: bookmarks and mastodonel18085 +Node: Dependencies18555 +Node: Network compatibility19147 +Node: Contributing19633 +Node: Bug reports19922 +Node: Fixes and features20828 +Node: Coding style21311 +Node: Supporting mastodonel21935 +Node: Contributors22465  End Tag Table diff --git a/mastodon.texi b/mastodon.texi index 0ede329..577f133 100644 --- a/mastodon.texi +++ b/mastodon.texi @@ -224,9 +224,9 @@ not contain @samp{:client_id} and @samp{:client_secret}. @item @tab @strong{Timeline actions} @item @samp{n} -@tab Go to next item (toot, notification) +@tab Go to next item (toot, notification, user) @item @samp{p} -@tab Go to previous item (toot, notification) +@tab Go to previous item (toot, notification, user) @item @samp{M-n=/=} @tab Go to the next interesting thing that has an action @item @samp{M-p=/=} @@ -257,13 +257,17 @@ not contain @samp{:client_id} and @samp{:client_secret}. @tab update your profile bio note @item @samp{;} @tab view instance description for toot at point +@item @samp{:} +@tab view followed tags and load a tag timeline @item @samp{,} @tab view favouriters of toot at point @item @samp{.} @tab view boosters of toot at point +@item @samp{/} +@tab switch between mastodon buffers @item @tab @strong{Other views} -@item @samp{S} +@item @samp{s} @tab search (posts, users, tags) (NB: only posts you have interacted with) @item @samp{I}, @samp{c}, @samp{d} @tab view, create, and delete filters @@ -277,7 +281,7 @@ not contain @samp{:client_id} and @samp{:client_secret}. @tab view bookmarked toots @item @samp{X} @tab view/edit/create/delete lists -@item @samp{s} +@item @samp{S} @tab view your scheduled toots @item @tab @strong{Toot actions} @@ -314,7 +318,7 @@ not contain @samp{:client_id} and @samp{:client_secret}. @item @tab @strong{Profile view} @item @samp{C-c C-c} -@tab cycle between statuses, followers, following, and statuses without boosts +@tab cycle between statuses, statuses without boosts, followers, and following @item @tab @samp{mastodon-profile--account-account-to-list} (see lists view) @item @@ -712,7 +716,7 @@ There's no need for a blank line after the first docstring line (one is added au @section Supporting @samp{mastodon.el} If you'd like to support continued development of @samp{mastodon.el}, I accept -donations via paypal: @uref{https://paypal.me/martianh, paypal.me/martianh}. If you would +donations via paypal: @uref{https://paypal.me/martianh, https://paypal.me/martianh}. If you would prefer a different payment method, write to me at that address and I can provide IBAN or other details. -- 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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(-) 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 3834d8f29bd1d293d41febe965daaf39887b088a Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 29 Mar 2023 17:03:10 +0200 Subject: readme: trending statuses --- README.org | 1 + 1 file changed, 1 insertion(+) diff --git a/README.org b/README.org index 66ec6d7..ca443d4 100644 --- a/README.org +++ b/README.org @@ -260,6 +260,7 @@ work without first loading =mastodon.el=: - =mastodon-tl--view-own-instance=: View information about your own instance. - =mastodon-search--trending-tags=: View a list of trending hashtags on your instance. +- =mastodon-search--trending-statuses=: View a list of trending statuses on your instance. - =mastodon-tl--add-toot-account-at-point-to-list=: Add the account of the toot at point to a list. -- 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(-) 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(-) 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(-) 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 aa6f86f99c778cb1bfb3b96ee7e8e79c0bb6751d Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 1 Apr 2023 18:44:43 +0200 Subject: ert-helper: search before mastodon.el --- test/ert-helper.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ert-helper.el b/test/ert-helper.el index 984a8ae..9c85dfb 100644 --- a/test/ert-helper.el +++ b/test/ert-helper.el @@ -1,6 +1,7 @@ (load-file "lisp/mastodon-http.el") (load-file "lisp/mastodon-iso.el") (load-file "lisp/mastodon-toot.el") +(load-file "lisp/mastodon-search.el") (load-file "lisp/mastodon.el") (load-file "lisp/mastodon-search.el") (load-file "lisp/mastodon-client.el") @@ -10,7 +11,6 @@ (load-file "lisp/mastodon-media.el") (load-file "lisp/mastodon-notifications.el") (load-file "lisp/mastodon-profile.el") -(load-file "lisp/mastodon-search.el") (load-file "lisp/mastodon-tl.el") (load-file "lisp/mastodon-async.el") -- 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(-) 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(-) 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(-) 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(-) 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