From 9ce001b04cffb5482faceaa450ec06a7abb1e1b7 Mon Sep 17 00:00:00 2001 From: Vasilij Schneidermann Date: Sun, 14 Jun 2015 23:02:26 +0200 Subject: [PATCH] Make window config closing customizable Closes #35 --- eyebrowse.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/eyebrowse.el b/eyebrowse.el index 1c1ce35..780052e 100644 --- a/eyebrowse.el +++ b/eyebrowse.el @@ -167,6 +167,12 @@ The following format codes are supported: :type 'string :group 'eyebrowse) +(defcustom eyebrowse-close-window-config-prompt nil + "Ask user for confirmation when closing a window config? +If t, ask for confirmation." + :type 'boolean + :group 'eyebrowse) + (defvar eyebrowse-mode-map (let ((map (make-sparse-keymap))) (let ((prefix-map (make-sparse-keymap))) @@ -360,7 +366,9 @@ This removes it from `eyebrowse-window-configs' and switches to another appropriate window config." (interactive) (let ((window-configs (eyebrowse--get 'window-configs))) - (when (> (length window-configs) 1) + (when (and (> (length window-configs) 1) + (or (not eyebrowse-close-window-config-prompt) + (yes-or-no-p "Close current window config?"))) (if (equal (assq (eyebrowse--get 'current-slot) window-configs) (car (last window-configs))) (eyebrowse-prev-window-config nil)