[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 99252c6 3/5: In minibuffer, prevent all commands that alte
From: |
Ingo Lohmar |
Subject: |
[elpa] master 99252c6 3/5: In minibuffer, prevent all commands that alter current config |
Date: |
Thu, 23 Feb 2017 13:27:44 -0500 (EST) |
branch: master
commit 99252c65a3864e5944489d72775fdeaf31599070
Author: Ingo Lohmar <address@hidden>
Commit: Ingo Lohmar <address@hidden>
In minibuffer, prevent all commands that alter current config
---
wconf.el | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/wconf.el b/wconf.el
index 9fbb817..9a537fb 100644
--- a/wconf.el
+++ b/wconf.el
@@ -83,6 +83,10 @@ this can be nil although wconf--configs is not empty.")
(unless (<= 0 index (1- (length wconf--configs)))
(error "wconf: No window configuration index %s" index)))
+(defsubst wconf--not-from-minibuffer ()
+ (when (minibuffer-window-active-p (frame-selected-window))
+ (error "wconf: Cannot change window configs when minibuffer is active")))
+
(defun wconf--current-config ()
(window-state-get (frame-root-window (selected-frame))
'writable))
@@ -195,6 +199,7 @@ With optional prefix argument NEW, or if there are no
configurations yet, create a new configuration from the current
window config."
(interactive "P")
+ (wconf--not-from-minibuffer)
(wconf--update-active-config)
(setq wconf--configs
(append wconf--configs
@@ -219,6 +224,7 @@ window config."
"Kill current configuration."
(interactive)
(wconf--ensure-configs 'current)
+ (wconf--not-from-minibuffer)
(let ((old-string (wconf--to-string wconf--index)))
(setq wconf--configs
(append (butlast wconf--configs
@@ -238,6 +244,7 @@ window config."
(interactive
(progn
(wconf--ensure-configs 'current) ;interactive? then want current config
+ (wconf--not-from-minibuffer)
(list
wconf--index
(read-number "Swap current config with index: "))))
@@ -299,6 +306,7 @@ window config."
"Restore stored configuration."
(interactive)
(wconf--ensure-configs 'current)
+ (wconf--not-from-minibuffer)
(wconf--restore (wconf- wconf--index))
(wconf--use-config wconf--index)
(message "wconf: Restored configuration %s" (wconf--to-string wconf--index)))
@@ -317,6 +325,7 @@ window config."
"Change to current config INDEX."
(interactive "P")
(wconf--ensure-configs)
+ (wconf--not-from-minibuffer)
(let ((index (or index
(read-number "Switch to config number: "))))
(wconf--ensure-index index)
- [elpa] master updated (fcec526 -> 9972760), Ingo Lohmar, 2017/02/23
- [elpa] master 833ae43 4/5: Bump version and copyright, Ingo Lohmar, 2017/02/23
- [elpa] master ec80c8b 2/5: Fix a compiler warning, Ingo Lohmar, 2017/02/23
- [elpa] master 9972760 5/5: Merge commit '833ae431a5b35739be3076ea4b586d84d6fe269f' from wconf, Ingo Lohmar, 2017/02/23
- [elpa] master ab21b66 1/5: Specify customization types, Ingo Lohmar, 2017/02/23
- [elpa] master 99252c6 3/5: In minibuffer, prevent all commands that alter current config,
Ingo Lohmar <=