Add a function/keybind to delete invisible frames
Workaround for annoying "Attempt to delete a surrogate minibuffer frame" issues when closing frames
This commit is contained in:
parent
a8cced9d29
commit
eaad8ce86a
@ -295,12 +295,19 @@
|
|||||||
#'(lambda () (setq-local show-trailing-whitespace t))))
|
#'(lambda () (setq-local show-trailing-whitespace t))))
|
||||||
|
|
||||||
(use-package frame :demand
|
(use-package frame :demand
|
||||||
|
:bind ("C-x C-S-c" . delete-invisible-frames)
|
||||||
:config
|
:config
|
||||||
(defun suspend-frame ()
|
(defun suspend-frame ()
|
||||||
"If running in a secondary tty, call `suspend-tty', else nop"
|
"If running in a secondary tty, call `suspend-tty', else nop"
|
||||||
(interactive)
|
(interactive)
|
||||||
(when (eq (framep (selected-frame)) t)
|
(when (eq (framep (selected-frame)) t)
|
||||||
(suspend-tty))))
|
(suspend-tty)))
|
||||||
|
(defun delete-invisible-frames ()
|
||||||
|
"Delete all non-visible frames, to fix \"Attempt to delete a surrogate minibuffer frame\" issues"
|
||||||
|
(interactive)
|
||||||
|
(mapc (lambda (frame)
|
||||||
|
(unless (frame-visible-p frame) (delete-frame frame)))
|
||||||
|
(frame-list))))
|
||||||
|
|
||||||
(use-package cc-styles
|
(use-package cc-styles
|
||||||
:config
|
:config
|
||||||
|
Loading…
Reference in New Issue
Block a user