From 3ab777cd650825c525c469ce640204064fca7692 Mon Sep 17 00:00:00 2001 From: mousebot Date: Sat, 2 Oct 2021 13:16:25 +0200 Subject: customize option default-media-directory --- lisp/mastodon-toot.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 9fb31d1..17b3a6c 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -68,6 +68,11 @@ Must be one of \"public\", \"unlisted\", \"private\" (for followers-only), or \" "private" "direct")) +(defcustom mastodon-toot--default-media-directory "~/" + "The default directory when prompting for a media file to upload." + :group 'mastodon-toot + :type 'string) + (defvar mastodon-toot--content-warning nil "A flag whether the toot should be marked with a content warning.") (make-variable-buffer-local 'mastodon-toot--content-warning) @@ -296,7 +301,8 @@ Remove MARKER if REMOVE is non-nil, otherwise add it." Set `mastodon-toot--media-attachment-ids' to the item's id so it can be attached to the toot." (interactive) - (let* ((filename (read-file-name "Choose file to attach to this toot: ")) + (let* ((filename (read-file-name "Choose file to attach to this toot: " + mastodon-toot--default-media-directory)) (caption (read-string "Enter a caption: ")) (url (concat mastodon-instance-url "/api/v1/media"))) (message "Uploading %s..." (file-name-nondirectory filename)) -- cgit v1.2.3