branch: elpa/devil
commit c60437c11b3b76c6709dab63a34a94b35ac4c865
Author: Susam Pal <[email protected]>
Commit: Susam Pal <[email protected]>
Support making all key sequences repeatable
---
devil.el | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/devil.el b/devil.el
index a50b503e19..5440139b6d 100644
--- a/devil.el
+++ b/devil.el
@@ -85,7 +85,7 @@ be modified before loading Devil for it to take effect.")
(devil-mode 1))
(defcustom devil-logging nil
- "Non-nil if and only if Devil should print log messages."
+ "Non-nil iff Devil should print log messages."
:type 'boolean)
(defvar devil-special-keys
@@ -134,9 +134,28 @@ to represent `devil-key' in the keys."
The value of this variable is a list where each item represents a
key sequence that may be repeated merely by typing the last
character in the key sequence. The format control specified `%k'
-may be used to represent `devil-key' in the keys."
+may be used to represent `devil-key' in the keys. Only key
+sequences that translate to a complete Emacs key sequence
+according to `devil-translations' and execute an Emacs command
+are made repeatable. Key sequences that belong to
+`devil-special-keys' are never made repeatable. Note that this
+variable is ignored if `devil-all-keys-repeatable' is set to t."
:type '(repeat string))
+(defcustom devil-all-keys-repeatable nil
+ "All successfully translated key sequences become repeatable iff t.
+
+When this variable is set to t all key sequences that translate
+to a complete and defined Emacs key sequence become a repeatable
+key sequence, i.e., it can be repeated merely by typing the last
+character in the key sequence. Note that key sequences that
+belong to `devil-special-keys' are never made repeatable. Also,
+note that when this variable is set to t, the variable
+`devil-repeatable-keys' is ignored. However when this variable
+is set to nil, the variable `devil-repeatable-keys' is used to
+determine whether a key sequence is repeatable or not."
+ :type 'boolean)
+
(defun devil-run-key (key)
"Execute the given key sequence KEY.
@@ -277,7 +296,8 @@ sequences should be read from the user."
(devil--log "Executing key: %s => %s => %s"
described-key translated-key binding)
(call-interactively binding)
- (when (devil--repeatable-key-p described-key)
+ (when (or devil-all-keys-repeatable
+ (devil--repeatable-key-p described-key))
(devil--set-transient-map (substring described-key -1) binding))
t)
(t