From 6360c8b9d06cdbebaa8254abdbc8f70550c78507 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 27 Aug 2023 22:37:15 -0400 Subject: * lisp/mastodon.el: Remove `ts` from `Package-Requires:` This is/was the main hurdle to be able to include `mastodon.el` into (Non)GNU ELPA since `ts` is/was not in (Non)GNU ELPA. Also I think the replacement function is more flexible and gives better results :-) * lisp/mastodon-tl.el: Don't require `ts`. (mastodon-tl--time-units): New const. (mastodon-tl--format-poll-expiry): Rewrite. --- lisp/mastodon.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/mastodon.el') diff --git a/lisp/mastodon.el b/lisp/mastodon.el index a3b372d..1c5e0d5 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -7,7 +7,7 @@ ;; Marty Hiatt ;; Maintainer: Marty Hiatt ;; Version: 1.0.0 -;; Package-Requires: ((emacs "27.1") (request "0.3.0") (persist "0.4") (ts "0.3")) +;; Package-Requires: ((emacs "27.1") (request "0.3.0") (persist "0.4")) ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. -- 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.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