From 126e2d8642669d3bc3f16d8a163dc9f0e0325a07 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 27 Aug 2023 22:33:13 -0400 Subject: Fix "empty body" warnings * lisp/mastodon-media.el (mastodon-media--process-image-response): Remove unused `unwind-protect`. * lisp/mastodon-views.el (mastodon-views--delete-filter): Fix paren error which made a `y-or-n-p` ineffective. --- lisp/mastodon-views.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lisp/mastodon-views.el') diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el index 9809365..a40603d 100644 --- a/lisp/mastodon-views.el +++ b/lisp/mastodon-views.el @@ -645,12 +645,12 @@ Prompt for a context, must be a list containting at least one of \"home\", (url (mastodon-http--api (format "filters/%s" filter-id)))) (if (null phrase) (error "No filter at point?") - (when (y-or-n-p (format "Delete filter %s? " phrase))) - (let ((response (mastodon-http--delete url))) - (mastodon-http--triage - response (lambda () - (mastodon-views--view-filters) - (message "Filter for \"%s\" deleted!" phrase))))))) + (when (y-or-n-p (format "Delete filter %s? " phrase)) + (let ((response (mastodon-http--delete url))) + (mastodon-http--triage + response (lambda () + (mastodon-views--view-filters) + (message "Filter for \"%s\" deleted!" phrase)))))))) ;;; FOLLOW SUGGESTIONS -- cgit v1.2.3 From 123c7cf0a5ad4ab3f6eb86fd18daefa37e29d253 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 27 Aug 2023 22:39:45 -0400 Subject: Simplify calls to `alist-get` * lisp/mastodon-toot.el (mastodon-toot--set-toot-language): * lisp/mastodon-tl.el (mastodon-tl--read-rules-ids): * lisp/mastodon-profile.el (mastodon-profile--remove-from-followers-list): * lisp/mastodon-auth.el (mastodon-auth--access-token): * lisp/mastodon-views.el (mastodon-views--add-account-to-list) (mastodon-views--remove-account-from-list): Remove redundant optional arg to `alist-get` (`equal` is already the default). --- lisp/mastodon-auth.el | 6 ++---- lisp/mastodon-profile.el | 2 +- lisp/mastodon-tl.el | 2 +- lisp/mastodon-toot.el | 2 +- lisp/mastodon-views.el | 4 ++-- 5 files changed, 7 insertions(+), 9 deletions(-) (limited to 'lisp/mastodon-views.el') diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index eb57368..5069271 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -172,15 +172,13 @@ When ASK is absent return nil." Generate/save token if none known yet." (cond (mastodon-auth--token-alist ;; user variables are known and initialised. - (alist-get mastodon-instance-url mastodon-auth--token-alist - nil nil 'equal)) + (alist-get mastodon-instance-url mastodon-auth--token-alist)) ((plist-get (mastodon-client--active-user) :access_token) ;; user variables need to be read from plstore. (push (cons mastodon-instance-url (plist-get (mastodon-client--active-user) :access_token)) mastodon-auth--token-alist) - (alist-get mastodon-instance-url mastodon-auth--token-alist - nil nil 'equal)) + (alist-get mastodon-instance-url mastodon-auth--token-alist)) ((null mastodon-active-user) ;; user not aware of 2FA-related changes and has not set ;; `mastodon-active-user'. Make user aware and error out. diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index a5abe5a..658c371 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -827,7 +827,7 @@ Currently limited to 100 handles. If not found, try (response (mastodon-http--get-json url `(("limit" . "100")))) (handles (mastodon-tl--map-alist-vals-to-alist 'acct 'id response)) (choice (completing-read "Remove from followers: " handles)) - (id (alist-get choice handles nil nil 'equal))) + (id (alist-get choice handles))) (mastodon-profile--remove-user-from-followers id))) (defun mastodon-profile--add-private-note-to-account () diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 8db889c..dadc7a8 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -2201,7 +2201,7 @@ report the account for spam." "rules [TAB for options, | to separate]: " alist nil t))) (mapcar (lambda (x) - (alist-get x alist nil nil 'equal)) + (alist-get x alist)) choices))) diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 14b9d68..f14aec3 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -1130,7 +1130,7 @@ Return its two letter ISO 639 1 code." (let* ((choice (completing-read "Language for this toot: " mastodon-iso-639-1))) (setq mastodon-toot--language - (alist-get choice mastodon-iso-639-1 nil nil 'equal)) + (alist-get choice mastodon-iso-639-1)) (message "Language set to %s" choice) (mastodon-toot--update-status-fields))) diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el index a40603d..00b9467 100644 --- a/lisp/mastodon-views.el +++ b/lisp/mastodon-views.el @@ -391,7 +391,7 @@ If ACCOUNT-ID and HANDLE are provided use them rather than prompting." (handles (mastodon-tl--map-alist-vals-to-alist 'acct 'id followings)) (account (or handle (completing-read "Account to add: " handles nil t))) - (account-id (or account-id (alist-get account handles nil nil 'equal))) + (account-id (or account-id (alist-get account handles))) (url (mastodon-http--api (format "lists/%s/accounts" list-id))) (response (mastodon-http--post url `(("account_ids[]" . ,account-id))))) (mastodon-views--list-action-triage @@ -425,7 +425,7 @@ If ID is provided, use that list." (handles (mastodon-tl--map-alist-vals-to-alist 'acct 'id accounts)) (account (completing-read "Account to remove: " handles nil t)) - (account-id (alist-get account handles nil nil 'equal)) + (account-id (alist-get account handles)) (url (mastodon-http--api (format "lists/%s/accounts" list-id))) (args (mastodon-http--build-array-params-alist "account_ids[]" `(,account-id))) (response (mastodon-http--delete url args))) -- cgit v1.2.3 From f646c2d5128db8f64c580c9d1133c7e445840800 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 27 Aug 2023 22:46:33 -0400 Subject: Don't refer to obsolete font-lock face variables * lisp/mastodon-profile.el (mastodon-profile--update-user-profile-note): * lisp/mastodon-tl.el (mastodon-tl--byline, mastodon-tl--toot-stats): * lisp/mastodon-toot.el (mastodon-toot--view-toot-edits): * lisp/mastodon-views.el (mastodon-views--minor-view): Quote face names. --- lisp/mastodon-profile.el | 4 ++-- lisp/mastodon-tl.el | 12 ++++++------ lisp/mastodon-toot.el | 4 ++-- lisp/mastodon-views.el | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'lisp/mastodon-views.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 658c371..0a3a236 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -250,14 +250,14 @@ NO-REBLOGS means do not display boosts in statuses." (mastodon-tl--set-buffer-spec (buffer-name buffer) "accounts/verify_credentials" nil) (setq-local header-line-format (propertize msg-str - 'face font-lock-comment-face)) + 'face 'font-lock-comment-face)) (mastodon-profile-update-mode t) (insert (propertize (concat (propertize "0" 'note-counter t 'display nil) "/500 characters") 'read-only t - 'face font-lock-comment-face + 'face 'font-lock-comment-face 'note-header t) "\n") (make-local-variable 'after-change-functions) diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index dadc7a8..9e86327 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -677,7 +677,7 @@ this just means displaying toot client." (propertize (format-time-string mastodon-toot-timestamp-format edited-parsed) - 'face font-lock-comment-face + 'face 'font-lock-comment-face 'timestamp edited-parsed 'display (if mastodon-tl--enable-relative-timestamps (mastodon-tl--relative-time-description edited-parsed) @@ -1371,19 +1371,19 @@ To disable showing the stats, customize 'favourited-p (eq 't .favourited) 'favourites-field t 'help-echo (format "%s favourites" .favourites_count) - 'face font-lock-comment-face) - (propertize " | " 'face font-lock-comment-face) + 'face 'font-lock-comment-face) + (propertize " | " 'face 'font-lock-comment-face) (propertize boosts 'boosted-p (eq 't .reblogged) 'boosts-field t 'help-echo (format "%s boosts" .reblogs_count) - 'face font-lock-comment-face) - (propertize " | " 'face font-lock-comment-face) + 'face 'font-lock-comment-face) + (propertize " | " 'face 'font-lock-comment-face) (propertize replies 'replies-field t 'replies-count .replies_count 'help-echo (format "%s replies" .replies_count) - 'face font-lock-comment-face))) + 'face 'font-lock-comment-face))) (status (concat (propertize " " diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index f14aec3..8170110 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -905,7 +905,7 @@ instance to edit a toot." (insert (propertize (if (= count 1) (format "%s [original]:\n" count) (format "%s:\n" count)) - 'face font-lock-comment-face) + 'face 'font-lock-comment-face) (mastodon-toot--insert-toot-iter x) "\n") (cl-incf count)) @@ -915,7 +915,7 @@ instance to edit a toot." (format "Edits to toot by %s:" (alist-get 'username (alist-get 'account (car history)))) - 'face font-lock-comment-face)) + 'face 'font-lock-comment-face)) (mastodon-tl--set-buffer-spec (buffer-name (current-buffer)) (format "statuses/%s/history" id) nil)))) diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el index 00b9467..ad36664 100644 --- a/lisp/mastodon-views.el +++ b/lisp/mastodon-views.el @@ -177,7 +177,7 @@ provides the JSON data." (if (seq-empty-p data) (insert (propertize (format "Looks like you have no %s for now." view-name) - 'face font-lock-comment-face + 'face 'font-lock-comment-face 'byline t 'toot-id "0")) ; so point can move here when no item (funcall insert-fun data) -- cgit v1.2.3