aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-07-18 20:33:37 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-07-18 20:33:37 +0200
commitdb227a8c2572f9985370325eca9f47d697531697 (patch)
treed69bdfb3ba98b29b32520aa9b6f8bd8f542bf847
parent6721f40cfd9111ed8d511d7aa3a3a5d2a0a771cb (diff)
flip an if clause
-rw-r--r--lisp/mastodon-toot.el28
1 files changed, 14 insertions, 14 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index e1d7259..4b1e225 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -1849,20 +1849,20 @@ Added to `after-change-functions' in new toot buffers."
"Select draft toot: "
(multisession-value mastodon-toot-draft-toots-list)
nil t)))
- (if (mastodon-toot--compose-buffer-p)
- (when (and (not (mastodon-toot--empty-p :text-only))
- (y-or-n-p "Replace current text with draft?"))
- (setf (multisession-value mastodon-toot-draft-toots-list)
- (cl-pushnew mastodon-toot-current-toot-text
- (multisession-value mastodon-toot-draft-toots-list)))
- (goto-char
- (cdr (mastodon-tl--find-property-range 'toot-post-header
- (point-min))))
- (kill-region (point) (point-max))
- ;; to not save to kill-ring:
- ;; (delete-region (point) (point-max))
- (insert text))
- (mastodon-toot--compose-buffer nil nil nil text)))
+ (if (not (mastodon-toot--compose-buffer-p))
+ (mastodon-toot--compose-buffer nil nil nil text)
+ (when (and (not (mastodon-toot--empty-p :text-only))
+ (y-or-n-p "Replace current text with draft?"))
+ (setf (multisession-value mastodon-toot-draft-toots-list)
+ (cl-pushnew mastodon-toot-current-toot-text
+ (multisession-value mastodon-toot-draft-toots-list)))
+ (goto-char
+ (cdr (mastodon-tl--find-property-range 'toot-post-header
+ (point-min))))
+ (kill-region (point) (point-max))
+ ;; to not save to kill-ring:
+ ;; (delete-region (point) (point-max))
+ (insert text))))
(unless (mastodon-toot--compose-buffer-p)
(mastodon-toot--compose-buffer))
(message "No drafts available.")))