[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swsw 1411a6314c 116/146: * swsw.el (swsw--update-window):
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swsw 1411a6314c 116/146: * swsw.el (swsw--update-window): Use 'when-let' instead of 'let' and 'when' |
Date: |
Wed, 25 May 2022 02:59:53 -0400 (EDT) |
branch: elpa/swsw
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."
- [nongnu] elpa/swsw 522bfb2da0 074/146: ; Add versioning scheme information to the NEWS file, (continued)
- [nongnu] elpa/swsw 522bfb2da0 074/146: ; Add versioning scheme information to the NEWS file, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 92abfc5de4 119/146: ; Make some long lines short, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 910aea2c75 117/146: ; Declare all window commands should be called while 'swsw-mode' is active, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 862d945bdb 101/146: ; Ignore Emacs' backup files, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 0a3edee2e5 055/146: ; Bump version to 1.1.1 and update NEWS file, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw f9f64e0559 060/146: * swsw.el (swsw--get-id-length): Return 1 when there is one window tracked, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 07f26210e8 086/146: ; Add 'swsw-delete' fix to the NEWS file, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 8044341fdb 040/146: ; Update README to no longer suggest binding 'C-x o' in 'swsw-mode-map', ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw cec8c4aacc 110/146: ; Edit docstrings to conform completely to 'checkdoc', ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw f08caf6f0c 137/146: ; Add build manifest, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 1411a6314c 116/146: * swsw.el (swsw--update-window): Use 'when-let' instead of 'let' and 'when',
ELPA Syncer <=
- [nongnu] elpa/swsw 53321ab4f2 069/146: ; Correct swsw-select's docstring, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 85d9c690b1 102/146: ; Add key binding to swsw-mode's docstring, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw cf70d1d22c 071/146: ; Make an if statement more readable, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 7db205a145 105/146: ; Change all instances of "‘" and "’" to "`" and "'" respectively, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 8a9686e0fe 111/146: ; Change required Emacs version according to package-lint, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 8febd864f9 085/146: ; Remove old reference to 'swsw-minibuffer-id', ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 03747300a3 082/146: ; Add missing 'Window commands' entry to the detailed node listing, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw ff30079d41 075/146: ; Remove trailing period in a tag string of 'swsw-scope', ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 2b43f66c82 145/146: ; Use 'kbd' instead of vector notation for 'define-key' example, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 5d1ea190ab 011/146: Only display a mode line lighter for tracked windows, ELPA Syncer, 2022/05/25