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-toot.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/mastodon-toot.el') 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))) -- 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-toot.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 From 5640de5f2ee5875313e239c0f4237454e027913c Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 27 Aug 2023 22:52:11 -0400 Subject: Misc minor cosmetic changes Prefer # to quote function names. Remove some redundant `:group` arguments. Properly newline-terminate text files. Fix some ' warnings in docstrings. --- .gitignore | 2 +- lisp/mastodon-tl.el | 8 ++++---- lisp/mastodon-toot.el | 8 ++++---- lisp/mastodon.el | 4 +--- 4 files changed, 10 insertions(+), 12 deletions(-) (limited to 'lisp/mastodon-toot.el') diff --git a/.gitignore b/.gitignore index ad98902..be78d26 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,4 @@ dist/ /lisp/mastodon-autoloads.el # ELSA files -/lisp/.elsa/ \ No newline at end of file +/lisp/.elsa/ diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 9e86327..7a02a03 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -203,8 +203,8 @@ If nil `(point-min)' is used instead.") (defvar mastodon-tl--link-keymap (let ((map (make-sparse-keymap))) - (define-key map [return] 'mastodon-tl--do-link-action-at-point) - (define-key map [mouse-2] 'mastodon-tl--do-link-action) + (define-key map [return] #'mastodon-tl--do-link-action-at-point) + (define-key map [mouse-2] #'mastodon-tl--do-link-action) (define-key map [follow-link] 'mouse-face) map) "The keymap for link-like things in buffer (except for shr.el generate links). @@ -1594,7 +1594,7 @@ This includes the update profile note buffer, but not the preferences one." (string-prefix-p "accounts" (mastodon-tl--endpoint nil :no-error))) (defun mastodon-tl--timeline-proper-p () - "Return non-nil if the current buffer is a 'proper' timeline. + "Return non-nil if the current buffer is a \"proper\" timeline. A proper timeline excludes notifications, threads, profiles, and other toot buffers that aren't strictly mastodon timelines." (let ((timeline-buffers @@ -2284,7 +2284,7 @@ when showing followers or accounts followed." (defun mastodon-tl--get-link-header-from-response (headers) "Get http Link header from list of http HEADERS." ;; pleroma uses "link", so case-insensitive match required: - (when-let ((link-headers (alist-get "Link" headers nil nil 'cl-equalp))) + (when-let ((link-headers (alist-get "Link" headers nil nil #'cl-equalp))) (split-string link-headers ", "))) (defun mastodon-tl--more () diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 8170110..d974e04 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -222,7 +222,7 @@ Takes its form from `window-configuration-to-register'.") (persist-defvar mastodon-toot-draft-toots-list nil "A list of toots that have been saved as drafts. 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 +to also capture toots that are \"sent\" but that don't successfully send.") @@ -687,7 +687,7 @@ TEXT-ONLY means don't check for attachments or polls." ;;; EMOJIS (defalias 'mastodon-toot--insert-emoji - 'emojify-insert-emoji + #'emojify-insert-emoji "Prompt to insert an emoji.") (defun mastodon-toot--emoji-dir () @@ -1623,7 +1623,7 @@ Added to `after-change-functions' in new toot buffers." mastodon-toot-draft-toots-list nil t))) (setq mastodon-toot-draft-toots-list - (cl-delete draft mastodon-toot-draft-toots-list :test 'equal)) + (cl-delete draft mastodon-toot-draft-toots-list :test #'equal)) (message "Draft deleted!")) (message "No drafts to delete."))) @@ -1773,7 +1773,7 @@ Only text that is not one of these faces will be spell-checked." (add-hook 'mastodon-toot-mode-hook (lambda () (setq flyspell-generic-check-word-predicate - 'mastodon-toot-mode-flyspell-verify))) + #'mastodon-toot-mode-flyspell-verify))) ;;;###autoload (add-hook 'mastodon-toot-mode-hook diff --git a/lisp/mastodon.el b/lisp/mastodon.el index 1c5e0d5..af16579 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -224,8 +224,7 @@ Use. e.g. \"%c\" for your locale's date and time format." (defcustom mastodon-mode-hook nil "Hook run when entering Mastodon mode." :type 'hook - :options '(provide-discover-context-menu) - :group 'mastodon) + :options '(provide-discover-context-menu)) (defface mastodon-handle-face '((t :inherit default)) @@ -427,7 +426,6 @@ Calls `mastodon-tl--get-buffer-type', which see." (define-derived-mode mastodon-mode special-mode "Mastodon" "Major mode for Mastodon, the federated microblogging network." - :group 'mastodon (read-only-mode 1)) (provide 'mastodon) -- cgit v1.2.3