[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/free-keys f42c5c9480 14/19: Change type of free-keys-ignor
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/free-keys f42c5c9480 14/19: Change type of free-keys-ignored-bindings to make customisation easier |
Date: |
Sat, 29 Jan 2022 08:02:54 -0500 (EST) |
branch: elpa/free-keys
commit f42c5c9480c229b41dba13be46fea7ad0e2bc366
Author: Matus Goljer <dota.keys@gmail.com>
Commit: Matus Goljer <dota.keys@gmail.com>
Change type of free-keys-ignored-bindings to make customisation easier
---
free-keys.el | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/free-keys.el b/free-keys.el
index 8ef8145a44..6116963e9d 100644
--- a/free-keys.el
+++ b/free-keys.el
@@ -51,14 +51,36 @@
:group 'free-keys)
(defcustom free-keys-ignored-bindings nil
- "List of bindings with modifiers which shouldn't be considered as free.
+ "List of bindings with modifiers which should never be considered free.
+
+The elements could be either strings of form \"MOD-KEY\" or cons
+where the car is a single letter modifier as in
+`free-keys-modifiers' and the cdr is a string containing keys to
+be ignored with this modifiers, like `free-keys-keys'.
The bindings should not contain a prefix. This can typically be
used to ignore bindings intercepted by the window manager used
for swapping windows and similar operations."
- :type '(repeat string)
+ :type '(repeat (choice (string :tag "Key binding")
+ (cons :tag "Modifier and string of key bindings"
+ (string :tag "Modifier")
+ (string :tag "Key bindings"))))
:group 'free-keys)
+(defun free-keys-ignored-bindings ()
+ "Return a list of bindings that should never be considered free.
+
+The elements of the returned list are of form \"MOD-KEY\".
+
+See also the variable `free-keys-ignored-bindings'."
+ (apply 'append
+ (mapcar (lambda (x)
+ (if (stringp x) (list x)
+ (mapcar (lambda (y)
+ (concat (car x) "-" (char-to-string y)))
+ (cdr x))))
+ free-keys-ignored-bindings)))
+
(defvar free-keys-mode-map
(let ((map (make-keymap)))
(define-key map "b" 'free-keys-change-buffer)
@@ -123,7 +145,7 @@ This simply calls `free-keys'."
(if (and prefix (not (equal prefix ""))) (concat prefix "
" key-name) key-name))
(binding
(with-current-buffer free-keys-original-buffer
(key-binding (read-kbd-macro full-name)))))
- (when (and (not (member key-name free-keys-ignored-bindings))
+ (when (and (not (member key-name (free-keys-ignored-bindings)))
(or (not binding)
(eq binding 'undefined)))
(push full-name empty-keys))))
- [nongnu] elpa/free-keys 452d26a3fc 03/19: Do not autoload the major-mode, (continued)
- [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, 2022/01/29
- [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 <=