From d68cf7104b59e0c98743359bc566d7faf4a07776 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sun, 2 Jun 2024 17:58:13 +0200 Subject: mastodon-toot--clear-poll --- lisp/mastodon-toot.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lisp') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index d21084b..d38b66f 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -279,6 +279,7 @@ send.") (define-key map (kbd "C-c C-a") #'mastodon-toot--attach-media) (define-key map (kbd "C-c !") #'mastodon-toot--clear-all-attachments) (define-key map (kbd "C-c C-p") #'mastodon-toot--create-poll) + (define-key map (kbd "C-c C-o") #'mastodon-toot--clear-poll) (define-key map (kbd "C-c C-l") #'mastodon-toot--set-toot-language) (define-key map (kbd "C-c C-s") #'mastodon-toot--schedule-toot) map) @@ -1428,6 +1429,14 @@ LENGTH is the maximum character length allowed for a poll option." ("14 days" . ,(number-to-string (* 60 60 24 14))) ("30 days" . ,(number-to-string (* 60 60 24 30))))) +(defun mastodon-toot--clear-poll () + "Remove poll from toot compose buffer. +Sets `mastodon-toot-poll' to nil." + (interactive) + (if (not mastodon-toot-poll) + (user-error "No poll?") + (setq mastodon-toot-poll nil) + (mastodon-toot--update-status-fields))) ;;; SCHEDULE -- cgit v1.2.3