[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/window-commander 1411a6314c 116/170: * swsw.el (swsw--u
From: |
ELPA Syncer |
Subject: |
[elpa] externals/window-commander 1411a6314c 116/170: * swsw.el (swsw--update-window): Use 'when-let' instead of 'let' and 'when' |
Date: |
Wed, 28 Jun 2023 19:00:31 -0400 (EDT) |
branch: externals/window-commander
commit 1411a6314c1a81b2a3bc63d410ee8ac43a78a93d
Author: Daniel Semyonov <daniel@dsemy.com>
Commit: Daniel Semyonov <daniel@dsemy.com>
* swsw.el (swsw--update-window): Use 'when-let' instead of 'let' and 'when'
---
swsw.el | 35 +++++++++++++++++------------------
1 file changed, 17 insertions(+), 18 deletions(-)
diff --git a/swsw.el b/swsw.el
index c223610a75..4d2c06f3e1 100644
--- a/swsw.el
+++ b/swsw.el
@@ -184,24 +184,23 @@ If set to `lighter', use a mode line lighter."
(defun swsw--update-window (window)
"Update information for WINDOW."
- (let ((id (if (window-minibuffer-p window)
- (progn
- (setq swsw-window-count (1+ swsw-window-count))
- nil)
- (swsw--next-id))))
- (when id
- ;; Create a key sequence from the ID, which corresponds to a
- ;; command which calls the last command (with the corresponding
- ;; window as the sole argument).
- ;; This allows controlling which command is invoked when
- ;; choosing an ID by setting `this-command' in a command which
- ;; sets the transient map to `swsw--id-map'.
- (define-key swsw--id-map (apply #'vector id)
- `(lambda ()
- (interactive)
- (funcall last-command ,window)))
- (set-window-parameter window 'swsw-id id)
- (setq swsw-window-count (1+ swsw-window-count)))))
+ (when-let ((id (if (window-minibuffer-p window)
+ (progn
+ (setq swsw-window-count (1+ swsw-window-count))
+ nil)
+ (swsw--next-id))))
+ ;; Create a key sequence from the ID, which corresponds to a
+ ;; command which calls the last command (with the corresponding
+ ;; window as the sole argument).
+ ;; This allows controlling which command is invoked when
+ ;; choosing an ID by setting `this-command' in a command which
+ ;; sets the transient map to `swsw--id-map'.
+ (define-key swsw--id-map (apply #'vector id)
+ `(lambda ()
+ (interactive)
+ (funcall last-command ,window)))
+ (set-window-parameter window 'swsw-id id)
+ (setq swsw-window-count (1+ swsw-window-count))))
(defun swsw--update (&optional _frame)
"Update information for all windows."
- [elpa] externals/window-commander d7fe615c3f 049/170: ; Fix inconsistency between requirements in swsw.el and swsw-pkg.el, (continued)
- [elpa] externals/window-commander d7fe615c3f 049/170: ; Fix inconsistency between requirements in swsw.el and swsw-pkg.el, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander cacbe44c08 058/170: ; Remove unnecessary ':group' keywords from 'defcustom' calls, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 73a241cf38 064/170: Ensure 'swsw-id-chars' is set correctly when customized, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander f66c043abc 067/170: Only call 'swsw-update' automatically when it's bound, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 53321ab4f2 069/170: ; Correct swsw-select's docstring, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander dbe46d5b86 070/170: * swsw.el (swsw-select): Don't select the next window for non-existent IDs, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 03747300a3 082/170: ; Add missing 'Window commands' entry to the detailed node listing, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 300a4e8e61 084/170: * swsw.el (swsw-delete): Fix when the other tracked window is a minibuffer, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander c153d9a32c 087/170: ; Add version information to customizable variables, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander dc4595546a 094/170: ; Change a message to a (more fitting in this context) user-error, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 1411a6314c 116/170: * swsw.el (swsw--update-window): Use 'when-let' instead of 'let' and 'when',
ELPA Syncer <=
- [elpa] externals/window-commander 4b308b978a 113/170: ; Move a comment slightly, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander e774ead908 104/170: ; Update mail address, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander af99790728 123/170: ; Various cosmetic changes to NEWS, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander c620c3028c 160/170: ; swsw.text: Fix typos and update information, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander f41a366777 159/170: ; Bump version to 2.3, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 95c25ee03c 022/170: ; Bump version to 1.0 and update README, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 51b8c1eb7c 080/170: ; Update documentation according to latest changes, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander c378be9bae 130/170: ; Load 'subr-x' when compiling, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 444873d9bd 114/170: Fix names of some internal and some external functions, ELPA Syncer, 2023/06/28
- [elpa] externals/window-commander 8a9686e0fe 111/170: ; Change required Emacs version according to package-lint, ELPA Syncer, 2023/06/28