aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-toot.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@disroot.org>2024-10-23 21:29:41 +0200
committermarty hiatt <martianhiatus@disroot.org>2024-10-23 21:29:41 +0200
commit7c9e5577f77da54d10bc0ed1426f0eff3570e3de (patch)
tree2e1c6cc8826097c7a941e4b3dbd6ed16b0b78c38 /lisp/mastodon-toot.el
parent263d486c3bb83bc7cbfb9bb5196f25f1253c02a5 (diff)
boolean defcustom for transient poll
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r--lisp/mastodon-toot.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 4177062..efcbc72 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -168,6 +168,10 @@ By default fixed width fonts are used."
:type '(boolean :tag "Enable using proportional rather than fixed \
width fonts"))
+(defcustom mastodon-toot-poll-use-transient t
+ "Whether to use the transient menu to create a poll."
+ :type '(boolean))
+
(defvar-local mastodon-toot--content-warning nil
"The content warning of the current toot.")
@@ -1401,6 +1405,12 @@ MAX is the maximum number set by their instance."
(defun mastodon-toot--create-poll ()
"Prompt for new poll options and return as a list."
(interactive)
+ (if mastodon-toot-poll-use-transient
+ (mastodon-create-poll)
+ (mastodon-toot--read-poll)))
+
+(defun mastodon-toot--read-poll ()
+ "Read poll options."
(let* ((instance (mastodon-instance-data))
(max-options (mastodon-toot--fetch-max-poll-options instance))
(count (mastodon-toot--read-poll-options-count max-options))