aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-08-22 11:06:07 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-08-22 11:06:07 +0200
commitbeeb8f3b2ebe25e8e3fb92e6f030cec39b818cec (patch)
treecd927217791cec57d88d98decbd57109d89105c6
parent377c2ecb0a423ff676f7f2a3695bcb7a7883df57 (diff)
eq for symbols, string= for strings
-rw-r--r--lisp/mastodon-async.el16
-rw-r--r--lisp/mastodon-auth.el4
-rw-r--r--lisp/mastodon-client.el2
-rw-r--r--lisp/mastodon-http.el2
-rw-r--r--lisp/mastodon-media.el4
-rw-r--r--lisp/mastodon-notifications.el40
-rw-r--r--lisp/mastodon-profile.el8
-rw-r--r--lisp/mastodon-search.el28
-rw-r--r--lisp/mastodon-tl.el50
-rw-r--r--lisp/mastodon-toot.el34
-rw-r--r--lisp/mastodon-views.el8
11 files changed, 98 insertions, 98 deletions
diff --git a/lisp/mastodon-async.el b/lisp/mastodon-async.el
index 0c70560..317be93 100644
--- a/lisp/mastodon-async.el
+++ b/lisp/mastodon-async.el
@@ -88,7 +88,7 @@
(delete-process (get-buffer-process mastodon-async--http-buffer))
(kill-buffer mastodon-async--http-buffer)
(setq mastodon-async--http-buffer "")
- (when (not (equal "" mastodon-async--queue)) ; error handle on kill async buffer
+ (when (not (string= "" mastodon-async--queue)) ; error handle on kill async buffer
(kill-buffer mastodon-async--queue))))
(defun mastodon-async--stream-notifications ()
@@ -207,8 +207,8 @@ ENDPOINT is the endpoint for the stream and timeline."
;; if user stream, we need "timelines/home" not "timelines/user"
;; if notifs, we need "notifications" not "timelines/notifications"
(endpoint (cond
- ((equal name "notifications") "notifications")
- ((equal name "home") "timelines/home")
+ ((string= name "notifications") "notifications")
+ ((string= name "home") "timelines/home")
(t (format "timelines/%s" endpoint)))))
(mastodon-async--set-local-variables buffer-name http-buffer
buffer-name queue-name)
@@ -218,7 +218,7 @@ ENDPOINT is the endpoint for the stream and timeline."
(make-local-variable 'mastodon-tl--enable-relative-timestamps)
(make-local-variable 'mastodon-tl--display-media-p)
(message (mastodon-http--api endpoint))
- (if (equal name "notifications")
+ (if (string= name "notifications")
(mastodon-notifications--timeline
(mastodon-http--get-json
(mastodon-http--api "notifications")))
@@ -227,7 +227,7 @@ ENDPOINT is the endpoint for the stream and timeline."
(mastodon-mode)
(mastodon-tl--set-buffer-spec buffer-name
endpoint
- (if (equal name "notifications")
+ (if (string= name "notifications")
'mastodon-notifications--timeline
'mastodon-tl--timeline))
(setq-local mastodon-tl--enable-relative-timestamps nil)
@@ -275,7 +275,7 @@ NAME is used for the queue and display buffer."
(car split-strings)))
(data (replace-regexp-in-string
"^data: " "" (cadr split-strings))))
- (when (equal "update" event-type)
+ (when (string= "update" event-type)
;; in some casses the data is not fully formed
;; for now return nil if malformed using `ignore-errors'
(ignore-errors (json-read-from-string data)))))))
@@ -289,7 +289,7 @@ NAME is used for the queue and display buffer."
(car split-strings)))
(data (replace-regexp-in-string
"^data: " "" (cadr split-strings))))
- (when (equal "notification" event-type)
+ (when (string= "notification" event-type)
;; in some casses the data is not fully formed
;; for now return nil if malformed using `ignore-errors'
(ignore-errors (json-read-from-string data)))))
@@ -324,7 +324,7 @@ NAME is used for the queue and display buffer."
mastodon-instance-url "*"))
(mastodon-notifications--timeline (list toot))
(mastodon-tl--timeline (list toot)))
- (if (equal previous 1)
+ (if (eq previous 1)
(goto-char 1)
(goto-char (+ previous (- (point-max) old-max)))))))))
diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el
index 404dd57..3796b7e 100644
--- a/lisp/mastodon-auth.el
+++ b/lisp/mastodon-auth.el
@@ -173,13 +173,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 nil nil #'string=))
((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 nil nil #'string=))
((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-client.el b/lisp/mastodon-client.el
index 493f9df..6e55829 100644
--- a/lisp/mastodon-client.el
+++ b/lisp/mastodon-client.el
@@ -174,7 +174,7 @@ Otherwise return nil."
(let ((username (mastodon-client--form-user-from-vars))
(user-details (mastodon-client--general-read "active-user")))
(when (and user-details
- (equal (plist-get user-details :username) username))
+ (string= (plist-get user-details :username) username))
user-details)))
(defun mastodon-client--active-user ()
diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el
index 39c1036..fbae8a7 100644
--- a/lisp/mastodon-http.el
+++ b/lisp/mastodon-http.el
@@ -365,7 +365,7 @@ item uploaded, and `mastodon-toot--update-status-fields' is run."
;; this is how the mangane akkoma web client does it
;; and it seems easier than the other options!
(when (and caption
- (not (equal caption (alist-get 'description data))))
+ (not (string= caption (alist-get 'description data))))
(let ((url (mastodon-http--api (format "media/%s" id))))
;; (message "PUTting image description")
(mastodon-http--put url desc)))
diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el
index 620aa51..2ec498e 100644
--- a/lisp/mastodon-media.el
+++ b/lisp/mastodon-media.el
@@ -449,8 +449,8 @@ Replace them with the referenced image."
(put-text-property start end 'media-state 'loading)
(mastodon-media--load-image-from-url
image-url media-type start (- end start))
- (when (or (equal type "gifv")
- (equal type "video"))
+ (when (or (string= type "gifv")
+ (string= type "video"))
(mastodon-media--moving-image-overlay start end))))))))
;; (defvar-local mastodon-media--overlays nil
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el
index 1b93f1b..1c2aad7 100644
--- a/lisp/mastodon-notifications.el
+++ b/lisp/mastodon-notifications.el
@@ -204,7 +204,7 @@ Status notifications are given when
;; FIXME: apply/refactor filtering as per/with `mastodon-tl--toot'
(let* ((id (alist-get 'id note))
(profile-note
- (when (equal 'follow-request type)
+ (when (eq 'follow-request type)
(let ((str (mastodon-tl--field
'note
(mastodon-tl--field 'account note))))
@@ -221,15 +221,15 @@ Status notifications are given when
nil
(mastodon-tl--insert-status
;; toot
- (cond ((or (equal type 'follow)
- (equal type 'follow-request))
+ (cond ((or (eq type 'follow)
+ (eq type 'follow-request))
;; Using reblog with an empty id will mark this as something
;; non-boostable/non-favable.
(cons '(reblog (id . nil)) note))
;; reblogs/faves use 'note' to process their own json
;; not the toot's. this ensures following etc. work on such notifs
- ((or (equal type 'favourite)
- (equal type 'boost))
+ ((or (eq type 'favourite)
+ (eq type 'boost))
note)
(t
status))
@@ -239,12 +239,12 @@ Status notifications are given when
(mastodon-tl--clean-tabs-and-nl
(if (mastodon-tl--has-spoiler status)
(mastodon-tl--spoiler status)
- (if (equal 'follow-request type)
+ (if (eq 'follow-request type)
(mastodon-tl--render-text profile-note)
(mastodon-tl--content status)))))))
(cond ((or (eq type 'follow)
(eq type 'follow-request))
- (if (equal type 'follow)
+ (if (eq type 'follow)
(propertize "Congratulations, you have a new follower!"
'face 'default)
(concat
@@ -261,35 +261,35 @@ Status notifications are given when
(mastodon-notifications--comment-note-text body))
(t body)))
;; author-byline
- (if (or (equal type 'follow)
- (equal type 'follow-request)
- (equal type 'mention))
+ (if (or (eq type 'follow)
+ (eq type 'follow-request)
+ (eq type 'mention))
'mastodon-tl--byline-author
(lambda (_status &rest _args) ; unbreak stuff
(mastodon-tl--byline-author note)))
;; action-byline
(lambda (_status)
(mastodon-notifications--byline-concat
- (cond ((equal type 'boost)
+ (cond ((eq type 'boost)
"Boosted")
- ((equal type 'favourite)
+ ((eq type 'favourite)
"Favourited")
- ((equal type 'follow-request)
+ ((eq type 'follow-request)
"Requested to follow")
- ((equal type 'follow)
+ ((eq type 'follow)
"Followed")
- ((equal type 'mention)
+ ((eq type 'mention)
"Mentioned")
- ((equal type 'status)
+ ((eq type 'status)
"Posted")
- ((equal type 'poll)
+ ((eq type 'poll)
"Posted a poll")
- ((equal type 'edit)
+ ((eq type 'edit)
"Edited"))))
id
;; base toot
- (when (or (equal type 'favourite)
- (equal type 'boost))
+ (when (or (eq type 'favourite)
+ (eq type 'boost))
status)))))
(defun mastodon-notifications--by-type (note)
diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el
index 5f33ce2..6410591 100644
--- a/lisp/mastodon-profile.el
+++ b/lisp/mastodon-profile.el
@@ -592,7 +592,7 @@ FIELDS means provide a fields vector fetched by other means."
"T if you have any relationship with the accounts in LIST."
(let (result)
(dolist (x list result)
- (when (not (equal :json-false x))
+ (when (not (eq :json-false x))
(setq result x)))))
(defun mastodon-profile--render-roles (roles)
@@ -735,7 +735,7 @@ MAX-ID is a flag to include the max_id pagination parameter."
(setq mastodon-tl--update-point (point))
(mastodon-media--inline-images (point-min) (point))
;; insert pinned toots first
- (when (and pinned (equal endpoint-type "statuses"))
+ (when (and pinned (string= endpoint-type "statuses"))
(mastodon-profile--insert-statuses-pinned pinned)
(setq mastodon-tl--update-point (point))) ; updates after pinned toots
(funcall update-function json))
@@ -767,7 +767,7 @@ MAX-ID is a flag to include the max_id pagination parameter."
"Return a avatar image from ACCOUNT.
IMG-TYPE is the JSON key from the account data."
(let ((img (alist-get img-type account)))
- (unless (equal img "/avatars/original/missing.png")
+ (unless (string= img "/avatars/original/missing.png")
(mastodon-media--get-media-link-rendering img))))
(defun mastodon-profile--show-user (user-handle)
@@ -784,7 +784,7 @@ IMG-TYPE is the JSON key from the account data."
nil ; predicate
'confirm)))))
(if (not (or ; own profile has no need for item-json test:
- (equal user-handle (mastodon-auth--get-account-name))
+ (string= user-handle (mastodon-auth--get-account-name))
(mastodon-tl--profile-buffer-p)
(mastodon-tl--property 'item-json :no-move)))
(user-error "Looks like there's no toot or user at point?")
diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el
index f51247b..7fc4de3 100644
--- a/lisp/mastodon-search.el
+++ b/lisp/mastodon-search.el
@@ -66,7 +66,7 @@ Returns a nested list containing user handle, display name, and URL."
(mastodon-http--get-json
url
`(("q" . ,query) ;; NB: nil can break params (but works for me)
- ,(when (equal "following"
+ ,(when (string= "following"
mastodon-toot--completion-style-for-mentions)
'("following" . "true")))
:silent)))
@@ -103,7 +103,7 @@ 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)))
;; max for statuses = 40, for others = 20
- (limit (if (equal type "statuses")
+ (limit (if (string= type "statuses")
'("limit" . "40")
'("limit" . "20")))
(offset '(("offset" . "0")))
@@ -116,7 +116,7 @@ PRINT-FUN is the function used to print the data from the response."
print-fun nil params)
(mastodon-search--insert-heading "trending" type)
(funcall print-fun data)
- (unless (equal type "statuses")
+ (unless (string= type "statuses")
(goto-char (point-min))))))
;; functions for mastodon search
@@ -153,10 +153,10 @@ is used for pagination."
;; TODO: handle no results
(interactive "sSearch mastodon for: ")
(let* ((url (mastodon-http--api-v2 "search"))
- (following (when (or following (equal current-prefix-arg '(4)))
+ (following (when (or following (eq current-prefix-arg '(4)))
"true"))
(type (or type
- (if (equal current-prefix-arg '(4))
+ (if (eq current-prefix-arg '(4))
"accounts" ; if FOLLOWING, must be "accounts"
(completing-read "Search type: "
mastodon-search-types nil :match))))
@@ -175,15 +175,15 @@ is used for pagination."
(with-mastodon-buffer buffer #'mastodon-mode nil
(mastodon-search-mode)
(mastodon-search--insert-heading type)
- (cond ((equal type "accounts")
+ (cond ((string= type "accounts")
(mastodon-search--render-response items type buffer params
'mastodon-views--insert-users-propertized-note
'mastodon-views--insert-users-propertized-note))
- ((equal type "hashtags")
+ ((string= type "hashtags")
(mastodon-search--render-response items type buffer params
'mastodon-search--print-tags
'mastodon-search--print-tags))
- ((equal type "statuses")
+ ((string= type "statuses")
(mastodon-search--render-response items type buffer params
#'mastodon-tl--timeline
#'mastodon-tl--timeline)))
@@ -213,19 +213,19 @@ BUFFER, PARAMS, and UPDATE-FUN are for `mastodon-tl--buffer-spec'."
"Return search buffer type, a member of `mastodon-search-types'."
;; called in `mastodon-tl--get-buffer-type'
(let* ((spec (mastodon-tl--buffer-property 'update-params)))
- (alist-get "type" spec nil nil #'equal)))
+ (alist-get "type" spec nil nil #'string=)))
(defun mastodon-search--query-cycle ()
"Cycle through search types: accounts, hashtags, and statuses."
(interactive)
(let* ((spec (mastodon-tl--buffer-property 'update-params))
- (type (alist-get "type" spec nil nil #'equal))
- (query (alist-get "q" spec nil nil #'equal)))
- (cond ((equal type "hashtags")
+ (type (alist-get "type" spec nil nil #'string=))
+ (query (alist-get "q" spec nil nil #'string=)))
+ (cond ((string= type "hashtags")
(mastodon-search--query query "accounts"))
- ((equal type "accounts")
+ ((string= type "accounts")
(mastodon-search--query query "statuses"))
- ((equal type "statuses")
+ ((string= type "statuses")
(mastodon-search--query query "hashtags")))))
(defun mastodon-search--query-accounts-followed (query)
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 2c1ef43..f400cc1 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -574,7 +574,7 @@ Do so if type of status at poins is not follow_request/follow."
(let ((type (alist-get 'type
(mastodon-tl--property 'item-json :no-move)))
(echo (mastodon-tl--property 'help-echo :no-move)))
- (when (not (equal "" echo)) ; not for followers/following in profile
+ (when (not (string= "" echo)) ; not for followers/following in profile
(unless (or (string= type "follow_request")
(string= type "follow")) ; no counts for these
(message "%s" echo)))))
@@ -682,11 +682,11 @@ The result is added as an attachments property to author-byline."
(defun mastodon-tl--format-faved-or-boosted-byline (letter)
"Format the byline marker for a boosted or favourited status.
LETTER is a string, F for favourited, B for boosted, or K for bookmarked."
- (let ((help-string (cond ((equal letter "F")
+ (let ((help-string (cond ((string= letter "F")
"favourited")
- ((equal letter "B")
+ ((string= letter "B")
"boosted")
- ((equal letter (or "🔖" "K"))
+ ((string= letter (or "🔖" "K"))
"bookmarked"))))
(format "(%s) "
(propertize letter 'face 'mastodon-boost-fave-face
@@ -761,10 +761,10 @@ BASE-TOOT is JSON for the base toot, if any."
;; in `mastodon-tl--byline-author'
(funcall author-byline toot nil domain)
;; visibility:
- (cond ((equal visibility "direct")
+ (cond ((string= visibility "direct")
(propertize (concat " " (mastodon-tl--symbol 'direct))
'help-echo visibility))
- ((equal visibility "private")
+ ((string= visibility "private")
(propertize (concat " " (mastodon-tl--symbol 'private))
'help-echo visibility)))
;;action byline:
@@ -1097,11 +1097,11 @@ content should be hidden."
(user-error "Not in a thread")
(save-excursion
(goto-char (point-min))
- (while (not (equal "No more items" ; improve this hack test!
+ (while (not (string= "No more items" ; improve this hack test!
(mastodon-tl--goto-next-item :no-refresh)))
(let* ((json (mastodon-tl--property 'item-json :no-move))
(cw (alist-get 'spoiler_text json)))
- (when (not (equal "" cw))
+ (when (not (string= "" cw))
(mastodon-tl--toggle-spoiler-text-in-toot))))))))
(defun mastodon-tl--spoiler (toot &optional filter)
@@ -1439,8 +1439,8 @@ EVENT is a mouse-click arg."
"T if mastodon-media-type prop is \"gifv\" or \"video\".
TYPE is a mastodon media type."
(let ((type (or type (mastodon-tl--property 'mastodon-media-type :no-move))))
- (or (equal type "gifv")
- (equal type "video"))))
+ (or (string= type "gifv")
+ (string= type "video"))))
(defun mastodon-tl--mpv-play-video-at-point (&optional url type)
"Play the video or gif at point with an mpv process.
@@ -1767,13 +1767,13 @@ To disable showing the stats, customize
(replies (format "%s %s" .replies_count (mastodon-tl--symbol 'reply)))
(stats (concat
(propertize faves
- 'favourited-p (eq 't .favourited)
+ '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)
(propertize boosts
- 'boosted-p (eq 't .reblogged)
+ 'boosted-p (eq t .reblogged)
'boosts-field t
'help-echo (format "%s boosts" .reblogs_count)
'face 'font-lock-comment-face)
@@ -1929,11 +1929,11 @@ call this function after it is set or use something else."
'preferences)
;; search
((mastodon-tl--search-buffer-p)
- (cond ((equal "accounts" (mastodon-search--buf-type))
+ (cond ((string= "accounts" (mastodon-search--buf-type))
'search-accounts)
- ((equal "hashtags" (mastodon-search--buf-type))
+ ((string= "hashtags" (mastodon-search--buf-type))
'search-hashtags)
- ((equal "statuses" (mastodon-search--buf-type))
+ ((string= "statuses" (mastodon-search--buf-type))
'search-statuses)))
;; trends
((mastodon-tl--endpoint-str-= "trends/statuses")
@@ -1993,7 +1993,7 @@ We hide replies if user explictly set the
timeline."
(and (mastodon-tl--timeline-proper-p) ; Only if we are in a proper timeline
(or mastodon-tl--hide-replies ; User configured to hide replies
- (equal '(4) prefix)))) ; Timeline called with C-u prefix
+ (eq '(4) prefix)))) ; Timeline called with C-u prefix
;;; UTILITIES
@@ -2107,7 +2107,7 @@ ID is that of the toot to view."
(let* ((buffer (format "*mastodon-toot-%s*" id))
(toot (mastodon-http--get-json
(mastodon-http--api (concat "statuses/" id)))))
- (if (equal (caar toot) 'error)
+ (if (eq (caar toot) 'error)
(user-error "Error: %s" (cdar toot))
(with-mastodon-buffer buffer #'mastodon-mode nil
(mastodon-tl--set-buffer-spec buffer (format "statuses/%s" id)
@@ -2152,7 +2152,7 @@ view all branches of a thread."
(mastodon-http--api (concat "statuses/" id))
nil :silent))
(context (mastodon-http--get-json url nil :silent)))
- (if (equal (caar toot) 'error)
+ (if (eq (caar toot) 'error)
(user-error "Error: %s" (cdar toot))
(when (member (alist-get 'type toot) '("reblog" "favourite"))
(setq toot (alist-get 'status toot)))
@@ -2291,7 +2291,7 @@ desired language if they are not marked as such (or as anything)."
(interactive (list (mastodon-tl--user-handles-get "filter by language")))
(let ((langs (mastodon-tl--read-filter-langs)))
(mastodon-tl--do-if-item
- (if (equal "" (cdar langs))
+ (if (string= "" (cdar langs))
(mastodon-tl--unfilter-user-languages user-handle)
(mastodon-tl--follow-user user-handle nil langs)))))
@@ -2465,7 +2465,7 @@ ARGS is an alist of any parameters to send with the request."
(mastodon-http--process-json))))
;; TODO: when > if, with failure msg
(cond ((string= notify "true")
- (when (eq 't (alist-get 'notifying json))
+ (when (eq t (alist-get 'notifying json))
(message "Receiving notifications for user %s (@%s)!"
name user-handle)))
((string= notify "false")
@@ -2473,7 +2473,7 @@ ARGS is an alist of any parameters to send with the request."
(message "Not receiving notifications for user %s (@%s)!"
name user-handle)))
((string= reblogs "true")
- (when (eq 't (alist-get 'showing_reblogs json))
+ (when (eq t (alist-get 'showing_reblogs json))
(message "Receiving boosts by user %s (@%s)!"
name user-handle)))
((string= reblogs "false")
@@ -2483,14 +2483,14 @@ ARGS is an alist of any parameters to send with the request."
((or (string= action "mute")
(string= action "unmute"))
(message "User %s (@%s) %sd!" name user-handle action))
- ((equal args "languages[]")
+ ((string= args "languages[]")
(message "User %s language filters removed!" name))
- ((assoc "languages[]" args #'equal)
+ ((assoc "languages[]" args #'string=)
(message "User %s filtered by language(s): %s" name
(mapconcat #'cdr args " ")))
((and (eq notify nil)
(eq reblogs nil))
- (if (and (equal action "follow")
+ (if (and (string= action "follow")
(eq t (alist-get 'requested json)))
(message "Follow requested for user %s (@%s)!" name user-handle)
(message "User %s (@%s) %sed!" name user-handle action)))))))))
@@ -3092,7 +3092,7 @@ JSON and http headers, without it just the JSON."
;; so as a fallback, load trending statuses:
;; FIXME: this could possibly be a fallback for all timelines not
;; just home?
- (when (equal endpoint "timelines/home")
+ (when (string= endpoint "timelines/home")
(mastodon-search--trending-statuses)))
((eq (caar json) 'error)
(user-error "Looks like the server bugged out: \"%s\"" (cdar json)))
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 5f4116f..762c313 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -284,7 +284,7 @@ data about the item boosted or favourited."
Includes boosts, and notifications that display toots.
This macro makes the local variable ID available."
(declare (debug t))
- `(if (not (equal 'toot (mastodon-tl--property 'item-type :no-move)))
+ `(if (not (eq 'toot (mastodon-tl--property 'item-type :no-move)))
(user-error "Looks like there's no toot at point?")
(mastodon-tl--with-toot-helper
(lambda (id)
@@ -409,12 +409,12 @@ ACTION is a symbol, either `favourite' or `boost.'"
;; there's nothing wrong with faving/boosting own toots
;; & nothing wrong with faving/boosting own toots from notifs,
;; it boosts/faves the base toot, not the notif status
- ((or (equal n-type "follow")
- (equal n-type "follow_request"))
+ ((or (string= n-type "follow")
+ (string= n-type "follow_request"))
(user-error "Can't %s %s notifications" action n-type))
((and boost-p
- (or (equal vis "direct")
- (equal vis "private")))
+ (or (string= vis "direct")
+ (string= vis "private")))
(user-error "Can't boost posts with visibility: %s" vis))
(t
(let* ((boosted (when byline-region
@@ -491,8 +491,8 @@ SUBTRACT means we are un-favouriting or unboosting, so we decrement."
(bookmarked-p (when byline-region
(get-text-property (car byline-region) 'bookmarked-p)))
(action (if bookmarked-p "unbookmark" "bookmark")))
- (cond ((or (equal n-type "follow")
- (equal n-type "follow_request"))
+ (cond ((or (string= n-type "follow")
+ (string= n-type "follow_request"))
(user-error "Can't bookmark %s notifications" n-type))
((not byline-region)
(user-error "Nothing to %s here?!?" action))
@@ -595,8 +595,8 @@ Uses `lingva.el'."
;; this check needs to allow acting on own toots displayed as boosts, so we
;; call `mastodon-tl--toot-or-base'.
(let ((json (mastodon-tl--toot-or-base toot)))
- (equal (alist-get 'acct (alist-get 'account json))
- (mastodon-auth--user-acct))))
+ (string= (alist-get 'acct (alist-get 'account json))
+ (mastodon-auth--user-acct))))
(defun mastodon-toot--pin-toot-toggle ()
"Pin or unpin user's toot at point."
@@ -717,7 +717,7 @@ CANCEL means the toot was not sent, so we save the toot text as a draft."
(unless (eq mastodon-toot-current-toot-text nil)
(when cancel
(cl-pushnew mastodon-toot-current-toot-text
- mastodon-toot-draft-toots-list :test 'equal)))
+ mastodon-toot-draft-toots-list :test #'string=)))
;; prevent some weird bug when cancelling a non-empty toot:
(delete #'mastodon-toot--save-toot-text after-change-functions)
(quit-window 'kill)
@@ -931,7 +931,7 @@ instance to edit a toot."
;; (we don't reload in every case as it can be slow and we may
;; lose our place in a timeline.)
(when (or edit-id
- (equal 'thread (mastodon-tl--get-buffer-type)))
+ (eq 'thread (mastodon-tl--get-buffer-type)))
(let ((pos (marker-position (cadr prev-window-config))))
(mastodon-tl--reload-timeline-or-profile pos))))))))))
@@ -1175,7 +1175,7 @@ prefixed by >."
(alist-get 'account toot))))
(mentions
(cond ((and booster ;; different booster, user and mentions:
- (and (not (equal user booster))
+ (and (not (string= user booster))
(not (member booster mentions))))
(mastodon-toot--mentions-to-string
(append (list user booster) mentions nil)))
@@ -1228,7 +1228,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 nil nil #'string=))
(message "Language set to %s" choice)
(mastodon-toot--update-status-fields)))
@@ -1419,7 +1419,7 @@ Return a cons of a human readable string, and a seconds-from-now string."
(let* ((options (mastodon-toot--poll-expiry-options-alist))
(response (completing-read "poll ends in [or enter seconds]: "
options nil 'confirm)))
- (or (assoc response options #'equal)
+ (or (assoc response options #'string=)
(if (< (string-to-number response) 600)
(car options))))) ;; min 5 mins
@@ -1718,7 +1718,7 @@ REPLY-REGION is a string to be injected into the buffer."
(mastodon-toot--render-reply-region-str reply-region)
"\n"))
(setq mastodon-toot--reply-to-id reply-to-id)
- (unless (equal mastodon-toot--visibility reply-visibility)
+ (unless (string= mastodon-toot--visibility reply-visibility)
(setq mastodon-toot--visibility reply-visibility))
(mastodon-toot--set-cw reply-cw))))
@@ -1752,7 +1752,7 @@ REPLY-REGION is a string to be injected into the buffer."
(mastodon-toot--apply-fields-props
vis-region
(format "%s"
- (if (equal "private" mastodon-toot--visibility)
+ (if (string= "private" mastodon-toot--visibility)
"followers-only"
mastodon-toot--visibility)))
;; WHEN clauses don't work here, we need "" as display arg:
@@ -1783,7 +1783,7 @@ REPLY-REGION is a string to be injected into the buffer."
(mastodon-toot--apply-fields-props
cw-region
(if (and mastodon-toot--content-warning
- (not (equal "" mastodon-toot--content-warning)))
+ (not (string= "" mastodon-toot--content-warning)))
(format "CW: %s" mastodon-toot--content-warning)
" ") ;; hold the blank space
'mastodon-cw-face))))
diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el
index ef91bd0..989a614 100644
--- a/lisp/mastodon-views.el
+++ b/lisp/mastodon-views.el
@@ -766,7 +766,7 @@ When t, whole words means only match whole words."
"false"))
(params `(("keyword" . ,updated)
("whole_word" . ,whole-word)))
- (id (cdr (assoc choice alist #'equal)))
+ (id (cdr (assoc choice alist #'string=)))
(url (mastodon-http--api-v2 (format "filters/keywords/%s" id)))
(resp (mastodon-http--put url params)))
(mastodon-views--filters-triage resp
@@ -807,7 +807,7 @@ When t, whole words means only match whole words."
(mastodon-tl--property 'item-json :no-move)))
(alist (mastodon-tl--map-alist-vals-to-alist 'keyword 'id kws))
(choice (completing-read "Remove keyword: " alist))
- (id (cdr (assoc choice alist #'equal)))
+ (id (cdr (assoc choice alist #'string=)))
(url (mastodon-http--api-v2 (format "filters/keywords/%s" id)))
(resp (mastodon-http--delete url)))
(mastodon-views--filters-triage resp (format "Keyword %s removed!" choice)))))
@@ -1022,9 +1022,9 @@ IND is the optional indentation level to print at."
(mastodon-views--print-json-keys
(cdr el) (if ind (+ ind 4) 4)))
(t ; basic handling of raw booleans:
- (let ((val (cond ((equal (cdr el) :json-false)
+ (let ((val (cond ((eq (cdr el) :json-false)
"no")
- ((equal (cdr el) 't)
+ ((eq (cdr el) t)
"yes")
(t
(cdr el)))))