From a6e43f8b4956e970b72f52e3a137e9a5cd43f2ed Mon Sep 17 00:00:00 2001 From: mousebot Date: Wed, 12 Jan 2022 15:11:44 +0100 Subject: keep mastodon-toot--max-toot-chars a number not a string. we use it as a number various times so let's leave it a number, then convert to string for display in toot info. --- lisp/mastodon-toot.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 22699f1..746b7d4 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -170,8 +170,7 @@ Valid values are \"direct\", \"private\" (followers-only), (alist-get 'statuses (alist-get 'configuration json-response)))))) - (setq mastodon-toot--max-toot-chars - (number-to-string max-chars)) + (setq mastodon-toot--max-toot-chars max-chars) (with-current-buffer "*new toot*" (mastodon-toot--update-status-fields)))) @@ -501,7 +500,7 @@ If media items have been attached and uploaded with (length mastodon-toot--media-attachment-ids))))) (message "Something is wrong with your uploads. Wait for them to complete or try again.")) ((and mastodon-toot--max-toot-chars - (> (length toot) (string-to-number mastodon-toot--max-toot-chars))) + (> (length toot) mastodon-toot--max-toot-chars)) (message "Looks like your toot is longer than that maximum allowed length.")) (empty-toot-p (message "Empty toot. Cowardly refusing to post this.")) @@ -857,7 +856,7 @@ REPLY-JSON is the full JSON of the toot being replied to." (list 'display (format "%s/%s characters" (- (point-max) (cdr header-region)) - mastodon-toot--max-toot-chars))) + (number-to-string mastodon-toot--max-toot-chars)))) (add-text-properties (car visibility-region) (cdr visibility-region) (list 'display (format "Visibility: %s" -- cgit v1.2.3 From 471d540c01ee45464bfc8a3d3cdcfaf91738ce99 Mon Sep 17 00:00:00 2001 From: mousebot Date: Fri, 4 Feb 2022 13:00:02 +0100 Subject: update homepage and copyright boilerplate --- lisp/mastodon-async.el | 7 +++---- lisp/mastodon-auth.el | 2 +- lisp/mastodon-client.el | 2 +- lisp/mastodon-discover.el | 2 +- lisp/mastodon-http.el | 2 +- lisp/mastodon-inspect.el | 2 +- lisp/mastodon-media.el | 2 +- lisp/mastodon-notifications.el | 2 +- lisp/mastodon-profile.el | 2 +- lisp/mastodon-search.el | 7 +++---- lisp/mastodon-tl.el | 3 ++- lisp/mastodon-toot.el | 3 ++- lisp/mastodon.el | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-async.el b/lisp/mastodon-async.el index 6ff09e3..86547a1 100644 --- a/lisp/mastodon-async.el +++ b/lisp/mastodon-async.el @@ -1,12 +1,11 @@ ;;; mastodon-async.el --- Client for Mastodon -*- lexical-binding: t -*- -;; Copyright (C) 2017 Johnson Denen -;; Author: Johnson Denen -;; Alex J. Griffith +;; Copyright (C) 2017 Alex J. Griffith +;; Author: Alex J. Griffith ;; Maintainer: Marty Hiatt ;; Version: 0.10.0 ;; Package-Requires: ((emacs "27.1")) -;; Homepage: https://git.blast.noho.st/mouse/mastodon.el +;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index 74d4404..e582e4f 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -5,7 +5,7 @@ ;; Maintainer: Marty Hiatt ;; Version: 0.10.0 ;; Package-Requires: ((emacs "27.1")) -;; Homepage: https://git.blast.noho.st/mouse/mastodon.el +;; 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 b27d434..42e8b1f 100644 --- a/lisp/mastodon-client.el +++ b/lisp/mastodon-client.el @@ -5,7 +5,7 @@ ;; Maintainer: Marty Hiatt ;; Version: 0.10.0 ;; Package-Requires: ((emacs "27.1")) -;; Homepage: https://git.blast.noho.st/mouse/mastodon.el +;; 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 10abc59..7046070 100644 --- a/lisp/mastodon-discover.el +++ b/lisp/mastodon-discover.el @@ -5,7 +5,7 @@ ;; Maintainer: Marty Hiatt ;; Version: 0.10.0 ;; Package-Requires: ((emacs "27.1")) -;; Homepage: https://git.blast.noho.st/mouse/mastodon.el +;; 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 f988e39..e288c18 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -5,7 +5,7 @@ ;; Maintainer: Marty Hiatt ;; Version: 0.10.0 ;; Package-Requires: ((emacs "27.1") (request "0.3.0")) -;; Homepage: https://git.blast.noho.st/mouse/mastodon.el +;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-inspect.el b/lisp/mastodon-inspect.el index b0270ee..15ee7ce 100644 --- a/lisp/mastodon-inspect.el +++ b/lisp/mastodon-inspect.el @@ -5,7 +5,7 @@ ;; Maintainer: Marty Hiatt ;; Version: 0.10.0 ;; Package-Requires: ((emacs "27.1")) -;; Homepage: https://git.blast.noho.st/mouse/mastodon.el +;; 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 acce473..4e4a15d 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -5,7 +5,7 @@ ;; Maintainer: Marty Hiatt ;; Version: 0.10.0 ;; Package-Requires: ((emacs "27.1")) -;; Homepage: https://git.blast.noho.st/mouse/mastodon.el +;; 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 77d40a8..ce26924 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -5,7 +5,7 @@ ;; Maintainer: Marty Hiatt ;; Version: 0.10.0 ;; Package-Requires: ((emacs "27.1")) -;; Homepage: https://git.blast.noho.st/mouse/mastodon.el +;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 21b40b3..436ba87 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -5,7 +5,7 @@ ;; Maintainer: Marty Hiatt ;; Version: 0.10.0 ;; Package-Requires: ((emacs "27.1") (seq "1.0")) -;; Homepage: https://git.blast.noho.st/mouse/mastodon.el +;; 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 78c2ab4..5fee328 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -1,12 +1,11 @@ ;;; mastodon-search.el --- Search functions for mastodon.el -*- lexical-binding: t -*- -;; Copyright (C) 2017-2019 Johnson Denen -;; Author: Johnson Denen -;; Marty Hiatt +;; Copyright (C) 2017-2019 Marty Hiatt +;; Author: Marty Hiatt ;; Maintainer: Marty Hiatt ;; Version: 0.10.0 ;; Package-Requires: ((emacs "27.1")) -;; Homepage: https://git.blast.noho.st/mouse/mastodon.el +;; 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 8e2e027..639b497 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -2,10 +2,11 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen +;; Marty Hiatt ;; Maintainer: Marty Hiatt ;; Version: 0.10.0 ;; Package-Requires: ((emacs "27.1")) -;; Homepage: https://git.blast.noho.st/mouse/mastodon.el +;; 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 746b7d4..3978e12 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -2,10 +2,11 @@ ;; Copyright (C) 2017-2019 Johnson Denen ;; Author: Johnson Denen +;; Marty Hiatt ;; Maintainer: Marty Hiatt ;; Version: 0.10.0 ;; Package-Requires: ((emacs "27.1")) -;; Homepage: https://git.blast.noho.st/mouse/mastodon.el +;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon.el b/lisp/mastodon.el index f65a86d..ab199f9 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -5,7 +5,7 @@ ;; Maintainer: Marty Hiatt ;; Version: 0.10.0 ;; Package-Requires: ((emacs "27.1") (request "0.3.2") (seq "1.0")) -;; Homepage: https://git.blast.noho.st/mouse/mastodon.el +;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. -- cgit v1.2.3 From 6a164669e0bffed67ad59c206f13651a67456127 Mon Sep 17 00:00:00 2001 From: mousebot Date: Sat, 5 Feb 2022 12:26:14 +0100 Subject: revert require of mastodon-toot to autoloads - use (autoload) call in mastodon.el for functions - use autoload cookie in mastodon-tool.el for customize options. --- lisp/mastodon-toot.el | 6 ++++++ lisp/mastodon.el | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 3978e12..b50cbf6 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -70,11 +70,13 @@ (autoload 'mastodon-tl--toot-id "mastodon-tl") (autoload 'mastodon-toot "mastodon") +;;;###autoload (defgroup mastodon-toot nil "Tooting in Mastodon." :prefix "mastodon-toot-" :group 'mastodon) +;;;###autoload (defcustom mastodon-toot--default-visibility "public" "The default visibility for new toots. @@ -87,16 +89,19 @@ followers-only), or \"direct\"." (const :tag "followers only" "private") (const :tag "direct" "direct"))) +;;;###autoload (defcustom mastodon-toot--default-media-directory "~/" "The default directory when prompting for a media file to upload." :group 'mastodon-toot :type 'string) +;;;###autoload (defcustom mastodon-toot--attachment-height 80 "Height of the attached images preview in the toot draft buffer." :group 'mastodon-toot :type 'integer) +;;;###autoload (defcustom mastodon-toot--enable-completion-for-mentions (if (require 'company nil :noerror) "following" "off") "Whether to enable company completion for mentions. @@ -110,6 +115,7 @@ This is only used if company mode is installed." (const :tag "following only" "following") (const :tag "all users" "all"))) +;;;###autoload (defcustom mastodon-toot--enable-custom-instance-emoji nil "Whether to enable your instance's custom emoji by default." :group 'mastodon-toot diff --git a/lisp/mastodon.el b/lisp/mastodon.el index ab199f9..bd0a557 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -32,8 +32,6 @@ ;;; Code: (require 'cl-lib) ; for `cl-some' call in mastodon -;; hack to make mastodon-toot customizes visible prior to running mastodon-toot: -(require 'mastodon-toot) (declare-function discover-add-context-menu "discover") (declare-function emojify-mode "emojify") @@ -54,10 +52,10 @@ (autoload 'mastodon-profile--get-toot-author "mastodon-profile") (autoload 'mastodon-profile--make-author-buffer "mastodon-profile") (autoload 'mastodon-profile--show-user "mastodon-profile") -;; (autoload 'mastodon-toot--compose-buffer "mastodon-toot") -;; (autoload 'mastodon-toot--reply "mastodon-toot") -;; (autoload 'mastodon-toot--toggle-boost "mastodon-toot") -;; (autoload 'mastodon-toot--toggle-favourite "mastodon-toot") +(autoload 'mastodon-toot--compose-buffer "mastodon-toot") +(autoload 'mastodon-toot--reply "mastodon-toot") +(autoload 'mastodon-toot--toggle-boost "mastodon-toot") +(autoload 'mastodon-toot--toggle-favourite "mastodon-toot") (autoload 'mastodon-discover "mastodon-discover") (autoload 'mastodon-tl--block-user "mastodon-tl") @@ -72,9 +70,9 @@ (autoload 'mastodon-notifications--follow-request-accept "mastodon-notifications") (autoload 'mastodon-notifications--follow-request-reject "mastodon-notifications") (autoload 'mastodon-search--search-query "mastodon-search") -;; (autoload 'mastodon-toot--delete-toot "mastodon-toot") -;; (autoload 'mastodon-toot--copy-toot-url "mastodon-toot") -;; (autoload 'mastodon-toot--pin-toot-toggle "mastodon-toot") +(autoload 'mastodon-toot--delete-toot "mastodon-toot") +(autoload 'mastodon-toot--copy-toot-url "mastodon-toot") +(autoload 'mastodon-toot--pin-toot-toggle "mastodon-toot") (autoload 'mastodon-auth--get-account-name "mastodon-auth") ;; (autoload 'mastodon-async--stream-federated "mastodon-async") ;; (autoload 'mastodon-async--stream-local "mastodon-async") @@ -84,9 +82,11 @@ (autoload 'mastodon-profile--update-user-profile-note "mastodon-profile") (autoload 'mastodon-auth--user-acct "mastodon-auth") (autoload 'mastodon-tl--poll-vote "mastodon-http") -;; (autoload 'mastodon-toot--delete-and-redraft-toot "mastodon-toot") +(autoload 'mastodon-toot--delete-and-redraft-toot "mastodon-toot") (autoload 'mastodon-profile--view-bookmarks "mastodon-profile") -;; (autoload 'mastodon-toot--bookmark-toot-toggle "mastodon-toot") +(autoload 'mastodon-toot--bookmark-toot-toggle "mastodon-toot") +(autoload 'mastodon-toot--enable-custom-emoji "mastodon-toot") +(defvar mastodon-toot--enable-custom-instance-emoji) (defgroup mastodon nil "Interface with Mastodon." -- cgit v1.2.3 From a7aaba52da9730f29fe796e242c6ee5c75f5f48c Mon Sep 17 00:00:00 2001 From: mousebot Date: Fri, 11 Feb 2022 18:29:14 +0100 Subject: revert to requiring mastodon toot we always need all the funs for operating on individual toots so this is best. Revert "revert require of mastodon-toot to autoloads" This reverts commit 6a164669e0bffed67ad59c206f13651a67456127. --- lisp/mastodon-toot.el | 6 ------ lisp/mastodon.el | 21 ++++++++++----------- 2 files changed, 10 insertions(+), 17 deletions(-) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index b50cbf6..3978e12 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -70,13 +70,11 @@ (autoload 'mastodon-tl--toot-id "mastodon-tl") (autoload 'mastodon-toot "mastodon") -;;;###autoload (defgroup mastodon-toot nil "Tooting in Mastodon." :prefix "mastodon-toot-" :group 'mastodon) -;;;###autoload (defcustom mastodon-toot--default-visibility "public" "The default visibility for new toots. @@ -89,19 +87,16 @@ followers-only), or \"direct\"." (const :tag "followers only" "private") (const :tag "direct" "direct"))) -;;;###autoload (defcustom mastodon-toot--default-media-directory "~/" "The default directory when prompting for a media file to upload." :group 'mastodon-toot :type 'string) -;;;###autoload (defcustom mastodon-toot--attachment-height 80 "Height of the attached images preview in the toot draft buffer." :group 'mastodon-toot :type 'integer) -;;;###autoload (defcustom mastodon-toot--enable-completion-for-mentions (if (require 'company nil :noerror) "following" "off") "Whether to enable company completion for mentions. @@ -115,7 +110,6 @@ This is only used if company mode is installed." (const :tag "following only" "following") (const :tag "all users" "all"))) -;;;###autoload (defcustom mastodon-toot--enable-custom-instance-emoji nil "Whether to enable your instance's custom emoji by default." :group 'mastodon-toot diff --git a/lisp/mastodon.el b/lisp/mastodon.el index bd0a557..a52bf41 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -32,6 +32,7 @@ ;;; Code: (require 'cl-lib) ; for `cl-some' call in mastodon +(require 'mastodon-toot) (declare-function discover-add-context-menu "discover") (declare-function emojify-mode "emojify") @@ -52,10 +53,10 @@ (autoload 'mastodon-profile--get-toot-author "mastodon-profile") (autoload 'mastodon-profile--make-author-buffer "mastodon-profile") (autoload 'mastodon-profile--show-user "mastodon-profile") -(autoload 'mastodon-toot--compose-buffer "mastodon-toot") -(autoload 'mastodon-toot--reply "mastodon-toot") -(autoload 'mastodon-toot--toggle-boost "mastodon-toot") -(autoload 'mastodon-toot--toggle-favourite "mastodon-toot") +;; (autoload 'mastodon-toot--compose-buffer "mastodon-toot") +;; (autoload 'mastodon-toot--reply "mastodon-toot") +;; (autoload 'mastodon-toot--toggle-boost "mastodon-toot") +;; (autoload 'mastodon-toot--toggle-favourite "mastodon-toot") (autoload 'mastodon-discover "mastodon-discover") (autoload 'mastodon-tl--block-user "mastodon-tl") @@ -70,9 +71,9 @@ (autoload 'mastodon-notifications--follow-request-accept "mastodon-notifications") (autoload 'mastodon-notifications--follow-request-reject "mastodon-notifications") (autoload 'mastodon-search--search-query "mastodon-search") -(autoload 'mastodon-toot--delete-toot "mastodon-toot") -(autoload 'mastodon-toot--copy-toot-url "mastodon-toot") -(autoload 'mastodon-toot--pin-toot-toggle "mastodon-toot") +;; (autoload 'mastodon-toot--delete-toot "mastodon-toot") +;; (autoload 'mastodon-toot--copy-toot-url "mastodon-toot") +;; (autoload 'mastodon-toot--pin-toot-toggle "mastodon-toot") (autoload 'mastodon-auth--get-account-name "mastodon-auth") ;; (autoload 'mastodon-async--stream-federated "mastodon-async") ;; (autoload 'mastodon-async--stream-local "mastodon-async") @@ -82,11 +83,9 @@ (autoload 'mastodon-profile--update-user-profile-note "mastodon-profile") (autoload 'mastodon-auth--user-acct "mastodon-auth") (autoload 'mastodon-tl--poll-vote "mastodon-http") -(autoload 'mastodon-toot--delete-and-redraft-toot "mastodon-toot") +;; (autoload 'mastodon-toot--delete-and-redraft-toot "mastodon-toot") (autoload 'mastodon-profile--view-bookmarks "mastodon-profile") -(autoload 'mastodon-toot--bookmark-toot-toggle "mastodon-toot") -(autoload 'mastodon-toot--enable-custom-emoji "mastodon-toot") -(defvar mastodon-toot--enable-custom-instance-emoji) +;; (autoload 'mastodon-toot--bookmark-toot-toggle "mastodon-toot") (defgroup mastodon nil "Interface with Mastodon." -- cgit v1.2.3