From b11ee2ad1b9bf0e770927c4c1922479d6f1a5703 Mon Sep 17 00:00:00 2001 From: Marcel van der Boom Date: Sat, 17 May 2014 11:48:20 +0200 Subject: [PATCH] Only delete the capture window if it has no parent delete-window will give an error if the window is the sole window in its frame. In my emacs confige i use popup-like 'capture' frames for denting, twisting, etc. On cancelling or posting, the delete-window would fail, so a test for a parent window prevents this. --- twister.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/twister.el b/twister.el index aa132e8..9d88566 100644 --- a/twister.el +++ b/twister.el @@ -165,7 +165,8 @@ while PARAMS contain the rest of the parameters." (interactive) (when (get-buffer twister-post-buffername) (with-current-buffer twister-post-buffername - (delete-window) + ;; if the window is the sole window in its frame, delete-window will error + (if (window-parent) (delete-window)) (kill-buffer twister-post-buffername) )))