branch: externals/window-commander commit ac8efcbbd1d64841d3143cbc94932c54d531b499 Author: Daniel Semyonov <cm...@dsemy.com> Commit: Daniel Semyonov <cm...@dsemy.com>
Assign a unique ID to an active minibuffer * swsw.el (swsw-minibuffer-id): Add user option to change the ID assigned to the minibuffer (swsw-update): Assign 'swsw-minibuffer-id' to the minibuffer. (swsw--reset-and-update, swsw-mode): Allow 'walk-windows' to call 'swsw-update' on an active minibuffer. --- swsw.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/swsw.el b/swsw.el index 41d05684cd..c9573e9df7 100644 --- a/swsw.el +++ b/swsw.el @@ -40,6 +40,11 @@ :group 'swsw :type '(repeat character)) +(defcustom swsw-minibuffer-id ?m + "ID reserved for the minibuffer." + :group 'swsw + :type '(character)) + ;;;; Simple window switching minor mode: (defvar swsw-id-chars swsw-id-chars-base @@ -55,7 +60,9 @@ (defun swsw-update (window) "Update information for WINDOW." - (let ((id (pop swsw-id-chars))) + (let ((id (if (window-minibuffer-p window) + swsw-minibuffer-id + (pop swsw-id-chars)))) (when id (push (cons id window) swsw-window-list) @@ -65,7 +72,7 @@ "Run `swsw-reset', run `swsw-update' for all active windows and force a mode line update for all windows." (swsw-reset) - (walk-windows #'swsw-update 'no-minibuffer t) + (walk-windows #'swsw-update nil t) (force-mode-line-update t)) ;;;###autoload @@ -74,7 +81,7 @@ line update for all windows." :global t (if swsw-mode (progn - (walk-windows #'swsw-update 'no-minibuffer t) + (walk-windows #'swsw-update nil t) (setq-default mode-line-format `((swsw-mode (:eval (char-to-string