[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 9972760 5/5: Merge commit '833ae431a5b35739be3076ea4b586d8
From: |
Ingo Lohmar |
Subject: |
[elpa] master 9972760 5/5: Merge commit '833ae431a5b35739be3076ea4b586d84d6fe269f' from wconf |
Date: |
Thu, 23 Feb 2017 13:27:44 -0500 (EST) |
branch: master
commit 997276013d459170fe1e8ada6dc85f85df27a215
Merge: fcec526 833ae43
Author: Ingo Lohmar <address@hidden>
Commit: Ingo Lohmar <address@hidden>
Merge commit '833ae431a5b35739be3076ea4b586d84d6fe269f' from wconf
* commit '833ae431a5b35739be3076ea4b586d84d6fe269f':
Bump version and copyright
In minibuffer, prevent all commands that alter current config
Fix a compiler warning
Specify customization types
---
packages/wconf/wconf.el | 30 ++++++++++++++++++++++--------
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/packages/wconf/wconf.el b/packages/wconf/wconf.el
index 57add63..51d374a 100644
--- a/packages/wconf/wconf.el
+++ b/packages/wconf/wconf.el
@@ -1,10 +1,10 @@
;;; wconf.el --- Minimal window layout manager -*- lexical-binding: t; -*-
-;; Copyright (C) 2014-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2017 Free Software Foundation, Inc.
;; Author: Ingo Lohmar <address@hidden>
;; URL: https://github.com/ilohmar/wconf
-;; Version: 0.2.0
+;; Version: 0.2.1
;; Keywords: windows, frames, layout
;; Package-Requires: ((emacs "24.4"))
@@ -35,24 +35,29 @@
(defcustom wconf-change-config-function #'wconf-change-config-default
"Function called with current config whenever it is set."
- :group 'wconf)
+ :group 'wconf
+ :type 'function)
(defcustom wconf-file (expand-file-name "wconf-window-configs.el"
user-emacs-directory)
"File used to save and load window configurations."
- :group 'wconf)
+ :group 'wconf
+ :type 'file)
(defcustom wconf-fallback-buffer-name "*scratch*"
"Name of the buffer to substitute for buffers which are not available."
- :group 'wconf)
+ :group 'wconf
+ :type 'string)
(defcustom wconf-no-configs-string "-----"
"String to use if there are no configurations at all."
- :group 'wconf)
+ :group 'wconf
+ :type 'string)
(defcustom wconf-no-config-name "---"
"String to use for the empty window configuration."
- :group 'wconf)
+ :group 'wconf
+ :type 'string)
;; internal variables and helper functions
@@ -78,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))
@@ -123,7 +132,7 @@ this can be nil although wconf--configs is not empty.")
;; global stuff
-(defun wconf-change-config-default (index config)
+(defun wconf-change-config-default (index _config)
"Update `wconf-string' to represent configuration CONFIG at
position INDEX."
(setq wconf-string (if wconf--configs
@@ -190,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
@@ -214,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
@@ -233,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: "))))
@@ -294,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)))
@@ -312,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 <=
- [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, 2017/02/23