[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swsw 73a241cf38 064/146: Ensure 'swsw-id-chars' is set cor
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swsw 73a241cf38 064/146: Ensure 'swsw-id-chars' is set correctly when customized |
Date: |
Wed, 25 May 2022 02:59:45 -0400 (EDT) |
branch: elpa/swsw
commit 73a241cf383ef7c6a8591cb34b17ac3cdd1c4668
Author: Daniel Semyonov <cmstr@dsemy.com>
Commit: Daniel Semyonov <cmstr@dsemy.com>
Ensure 'swsw-id-chars' is set correctly when customized
* swsw.el (swsw--set-id-chars): New set function for 'swsw-id-chars'
which ensures it contains at least 2 characters and updates
information for all tracked windows.
(swsw-id-chars): Set 'set' function to 'swsw--set-id-chars'.
---
swsw.el | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/swsw.el b/swsw.el
index a41d48d748..65c52f0f52 100644
--- a/swsw.el
+++ b/swsw.el
@@ -64,9 +64,21 @@
:group 'convenience
:prefix "swsw-")
+(defun swsw--set-id-chars (sym chars)
+ "Set the variable ‘swsw-id-chars’.
+Check that the new list has at least two elements, set SYM’s value to
+CHARS, and call ‘swsw-update’."
+ (if (> 2 (length chars))
+ (user-error
+ "‘swsw-id-chars’ should contain at least two characters")
+ (set-default sym chars)
+ (swsw-update)))
+
(defcustom swsw-id-chars '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
- "Base set of characters from which window IDs are constructed."
- :type '(repeat character))
+ "Base set of characters from which window IDs are constructed.
+This list should contain at least two characters."
+ :type '(repeat character)
+ :set #'swsw--set-id-chars)
(defcustom swsw-minibuffer-id ?m
"ID reserved for the minibuffer."
- [nongnu] elpa/swsw c2c579a3c9 061/146: Construct multi-character IDs without pre-computing all possible IDs, (continued)
- [nongnu] elpa/swsw c2c579a3c9 061/146: Construct multi-character IDs without pre-computing all possible IDs, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 7d82ffeef4 076/146: ; Small modifications to the NEWS file, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 4ceacd0330 132/146: Indicate that some functions are for interactive use only, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw eba70478e0 065/146: Update window information after 'swsw-scope' is customized, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 51fcc776bd 081/146: ; Reorganize swsw.el, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 2f7500636d 098/146: ; Add 'swsw' to .gitignore, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw db5cd237a7 125/146: ; Documentation improvements, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 6a70afa84f 097/146: ; Documentation fixes, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 384dae5d45 128/146: ; Move local mode declaration to the top of NEWS, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 220c023a2a 088/146: ; Update copyright years, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 73a241cf38 064/146: Ensure 'swsw-id-chars' is set correctly when customized,
ELPA Syncer <=
- [nongnu] elpa/swsw 3261f323e9 077/146: ; Bump version to 1.1.2, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw e43021aa7e 112/146: * swsw.el (swsw-format-id): Use 'format-spec' instead of 'format', ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw c864e6d524 144/146: ; Add change log for version 2.1.1, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw d7fe615c3f 049/146: ; Fix inconsistency between requirements in swsw.el and swsw-pkg.el, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 74124620af 048/146: ; Add brief usage information to the docstring of 'swsw-mode', ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 83eb90586a 051/146: ; Alter comments and docstrings to comply with Emacs' conventions, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 8fc0e7dfa7 046/146: ; Bump required emacs version to 26.1, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 095091cf33 057/146: Handle cases where there are less than three tracked windows better, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw cacbe44c08 058/146: ; Remove unnecessary ':group' keywords from 'defcustom' calls, ELPA Syncer, 2022/05/25
- [nongnu] elpa/swsw 0b67d7bc00 056/146: * swsw.el (swsw-display-function): Define early only when byte-compiling, ELPA Syncer, 2022/05/25