[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/free-keys edfd69dc36 17/19: [Fix #3] Add an option to spec
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/free-keys edfd69dc36 17/19: [Fix #3] Add an option to specify multi-character keys |
Date: |
Sat, 29 Jan 2022 08:02:54 -0500 (EST) |
branch: elpa/free-keys
commit edfd69dc369b2647447b7c28c7c1163b1ddf45b4
Author: Matus Goljer <matus.goljer@gmail.com>
Commit: Matus Goljer <matus.goljer@gmail.com>
[Fix #3] Add an option to specify multi-character keys
---
free-keys.el | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/free-keys.el b/free-keys.el
index 3f28af63e9..b41f19e17d 100644
--- a/free-keys.el
+++ b/free-keys.el
@@ -46,8 +46,16 @@
:group 'free-keys)
(defcustom free-keys-keys
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()-=[]{};'\\:\"|,./<>?`~"
- "String of keys that can be used as bindings."
- :type 'string
+ "String or list of keys that can be used as bindings.
+
+In case of string, each letter is interpreted as a character to
+test.
+
+In case of list, each item is considered as key code. This
+allows you to add keys such as TAB or RET."
+ :type '(choice
+ (string :tag "String of characters")
+ (repeat :tag "List of characters" string))
:group 'free-keys)
(defcustom free-keys-ignored-bindings nil
@@ -137,10 +145,14 @@ This simply calls `free-keys'."
"Process free bindings for MODIFIER."
(let (empty-keys)
(mapc (lambda (key)
- (let* ((key-name
+ (let* ((key-as-string (cond
+ ((characterp key) (char-to-string key))
+ ((stringp key) key)
+ (t (error "Key is not a character nor a
string"))))
+ (key-name
(if (not (equal modifier ""))
- (concat modifier "-" (char-to-string key))
- (char-to-string key)))
+ (concat modifier "-" key-as-string)
+ key-as-string))
(full-name
(if (and prefix (not (equal prefix ""))) (concat prefix "
" key-name) key-name))
(binding
- [nongnu] elpa/free-keys f5d882d4c7 11/19: Better display of empty keys (no empty groups, fixed nil modifiers), (continued)
- [nongnu] elpa/free-keys f5d882d4c7 11/19: Better display of empty keys (no empty groups, fixed nil modifiers), ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys 8c9ea744c1 08/19: Move header help into header-line-format, ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys 79205af5f5 01/19: Initial commit, ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys 452d26a3fc 03/19: Do not autoload the major-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys aca6032c3e 05/19: Merge pull request #1 from syohex/support-for-old-emacs, ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys 9cc42a07a6 04/19: Support old emacs(<= 24.2), ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys 982aea30d1 09/19: Add docstrings & readme, ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys 845d7bc367 10/19: Update readme, ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys e23ec255d4 13/19: Add option to ignore certain keybindings (shadowed by WM etc.), ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys 368820cb36 16/19: Merge pull request #2 from syohex/byte-compile-warning, ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys edfd69dc36 17/19: [Fix #3] Add an option to specify multi-character keys,
ELPA Syncer <=
- [nongnu] elpa/free-keys 6f9172376a 18/19: Bump version to 1.0, ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys 7348ce6819 19/19: Merge pull request #6 from phikal/patch-1, ELPA Syncer, 2022/01/29
- [nongnu] elpa/free-keys f42c5c9480 14/19: Change type of free-keys-ignored-bindings to make customisation easier, ELPA Syncer, 2022/01/29