emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ace-window 5b88de0 49/92: ace-window.el (aw-translate-c


From: Stefan Monnier
Subject: [elpa] externals/ace-window 5b88de0 49/92: ace-window.el (aw-translate-char-function): New defcustom
Date: Wed, 17 Mar 2021 18:39:20 -0400 (EDT)

branch: externals/ace-window
commit 5b88de026cea5fc57e62bb490034392815be5f0f
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    ace-window.el (aw-translate-char-function): New defcustom
    
    Fixes #141
---
 ace-window.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/ace-window.el b/ace-window.el
index e84221e..1382fdd 100644
--- a/ace-window.el
+++ b/ace-window.el
@@ -83,6 +83,15 @@
           (const :tag "global" global)
           (const :tag "frame" frame)))
 
+(defcustom aw-translate-char-function #'identity
+  "Function to translate user input key into another key.
+For example, to make SPC do the same as ?a, use
+\(lambda (c) (if (= c 32) ?a c))."
+  :type '(choice
+          (const :tag "Off" #'identity)
+          (const :tag "Ignore Case" #'downcase)
+          (function :tag "Custom")))
+
 (defcustom aw-minibuffer-flag nil
   "When non-nil, also display `ace-window-mode' string in the minibuffer when 
ace-window is active."
   :type 'boolean)
@@ -487,7 +496,7 @@ Amend MODE-LINE to the mode line for the duration of the 
selection."
                    (remove-hook 'post-command-hook 'helm--maybe-update-keymap)
                    (unwind-protect
                         (let* ((avy-handler-function aw-dispatch-function)
-                               (avy-translate-char-function #'identity)
+                               (avy-translate-char-function 
aw-translate-char-function)
                                (res (avy-read (avy-tree candidate-list aw-keys)
                                               #'aw--lead-overlay
                                               #'avy--remove-leading-chars)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]