[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/window-commander 185861a2e9 010/170: Use a lighter for
From: |
ELPA Syncer |
Subject: |
[elpa] externals/window-commander 185861a2e9 010/170: Use a lighter for 'swsw-mode' |
Date: |
Wed, 28 Jun 2023 19:00:12 -0400 (EDT) |
branch: externals/window-commander
commit 185861a2e9e3db1e3a59750dea1db7923215ea8b
Author: Daniel Semyonov <cmstr@dsemy.com>
Commit: Daniel Semyonov <cmstr@dsemy.com>
Use a lighter for 'swsw-mode'
Use a lighter instead of adding the ID to the start of the modeline.
* swsw.el (swsw-mode-line-format): Add user option to change the
format of the lighter.
(swsw-mode): Use a lighter based on the window's ID and
'swsw-mode-line-format'. Remove previous 'mode-line-format'
manipulation.
---
swsw.el | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/swsw.el b/swsw.el
index d35271f21c..769f3a06cf 100644
--- a/swsw.el
+++ b/swsw.el
@@ -45,6 +45,12 @@
:group 'swsw
:type '(character))
+(defcustom swsw-mode-lighter-format " <%c>"
+ "Format string for the lighter of `swsw-mode'.
+Passed to `format' with the selected window's ID as the only argument."
+ :group 'swsw
+ :type '(string))
+
;;;; Simple window switching minor mode:
(defvar swsw-id-chars swsw-id-chars-base
@@ -79,27 +85,17 @@ line update for all windows."
(define-minor-mode swsw-mode
"Minor mode for selecting windows by their ID."
:global t
+ :lighter (:eval (format swsw-mode-lighter-format
+ (window-parameter (selected-window) 'swsw-id)))
(if swsw-mode
(progn
(walk-windows #'swsw-update nil t)
- (setq-default mode-line-format
- `((swsw-mode
- (:eval (char-to-string
- (window-parameter (selected-window)
- 'swsw-id))))
- ,@(assq-delete-all
- 'swsw-mode
- (default-value 'mode-line-format))))
(force-mode-line-update t)
(add-hook 'window-configuration-change-hook #'swsw--reset-and-update)
(add-hook 'minibuffer-setup-hook #'swsw--reset-and-update)
(add-hook 'minibuffer-exit-hook #'swsw--reset-and-update))
(setq swsw-window-list nil
swsw-id-chars swsw-id-chars-base)
- (setq-default mode-line-format
- (assq-delete-all
- 'swsw-mode
- (default-value 'mode-line-format)))
(remove-hook 'window-configuration-change-hook #'swsw--reset-and-update)
(remove-hook 'minibuffer-setup-hook #'swsw--reset-and-update)
(remove-hook 'minibuffer-exit-hook #'swsw--reset-and-update)))
- [elpa] externals/window-commander b6277eb31f 037/170: ; Indicate that version 1.1 is still in development in the NEWS file, (continued)
- [elpa] externals/window-commander b6277eb31f 037/170: ; Indicate that version 1.1 is still in development in the NEWS file, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 1a5ce9c559 038/170: ; Add binding 'C-x o' to 'swsw-select' in 'swsw-mode-map' to the NEWS, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 7a00ef3140 039/170: ; Small documentation fixes, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 3a9848deac 042/170: Add an Info node for the package, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 74124620af 048/170: ; Add brief usage information to the docstring of 'swsw-mode', ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 5b0f4657cc 052/170: ; Simplify build process, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander f9f64e0559 060/170: * swsw.el (swsw--get-id-length): Return 1 when there is one window tracked, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 64c66d244b 062/170: * swsw.el (swsw-ids): Removed, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander b3f6cee6af 068/170: ; Unify information in the README and commentary, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 5e77d34dfa 054/170: ; Modify installation section of the README file and Info node, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 185861a2e9 010/170: Use a lighter for 'swsw-mode',
ELPA Syncer <=
- [elpa] externals/window-commander c08a9b1e58 024/170: ; Fix a docstring, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 5addab5009 027/170: ; Fix installing swsw.el as a package, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 2d2edca2c3 029/170: ; Add 'Usage:' section to the commentary, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander a5b25e075f 032/170: Allow setting the scope to the selected frame, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 2002152fb7 023/170: ; Add .gitignore file, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 5937f8bc6e 043/170: ; Update .gitignore to ignore some build artifacts, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander d5ab98b9db 044/170: ; Bump version to 1.1, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 04ace20d03 063/170: ; Fix indentation and compact structure in some places, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander eba70478e0 065/170: Update window information after 'swsw-scope' is customized, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander d195e574c0 066/170: ; Add latest changes to the news file, ELPA Syncer, 2023/06/28