aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-toot.el
diff options
context:
space:
mode:
authorBjörn Bidar <bjorn.bidar@thaodan.de>2023-10-05 21:24:08 +0300
committermarty hiatt <martianhiatus@riseup.net>2023-12-31 10:59:18 +0100
commit20b41bfa9512cc643c23b8e3d8062c8bebf0be79 (patch)
tree1586b2dab05f3c61983c7c3c703f611fdcd8bea2 /lisp/mastodon-toot.el
parent3437dbbeeaa340e85ad1f2e9108469761c3e1aa6 (diff)
Avoid error when there's only one window in a frame when closing window
Use `(quit-window 'kill)` instead of `(kill-buffer-and-window)` to avoid error when there's only one window instead the frame: `kill-buffer-and-window: Attempt to delete minibuffer or sole ordinary window` Signed-off-by: Björn Bidar <bjorn.bidar@thaodan.de>
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r--lisp/mastodon-toot.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index c96ee5b..c26db1e 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -64,6 +64,7 @@
(autoload 'mastodon-http--put "mastodon-http")
(autoload 'mastodon-http--read-file-as-string "mastodon-http")
(autoload 'mastodon-http--triage "mastodon-http")
+(autoload 'mastodon-kill-window "mastodon")
(autoload 'mastodon-profile--fetch-server-account-settings "mastodon-profile")
(autoload 'mastodon-profile--fetch-server-account-settings-maybe "mastodon-profile")
(autoload 'mastodon-profile--get-source-pref "mastodon-profile")
@@ -682,7 +683,7 @@ CANCEL means the toot was not sent, so we save the toot text as a draft."
mastodon-toot-draft-toots-list :test 'equal)))
;; prevent some weird bug when cancelling a non-empty toot:
(delete #'mastodon-toot--save-toot-text after-change-functions)
- (kill-buffer-and-window)
+ (quit-window 'kill)
(mastodon-toot--restore-previous-window-config prev-window-config)))
(defun mastodon-toot--cancel ()