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

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

[nongnu] elpa/engine-mode 00e0dde543: Allow binding engines to non-prefi


From: ELPA Syncer
Subject: [nongnu] elpa/engine-mode 00e0dde543: Allow binding engines to non-prefix key sequences
Date: Sun, 14 May 2023 13:00:46 -0400 (EDT)

branch: elpa/engine-mode
commit 00e0dde543e36745c8a14165bc0c9871468f7f3f
Author: Harry R. Schwartz <hello@harryrschwartz.com>
Commit: Harry R. Schwartz <hello@harryrschwartz.com>

    Allow binding engines to non-prefix key sequences
    
    We'd like to be able to bind some engines to sequences of keys "nested" 
under
    the common engine-mode prefix. For example, something like this ought to 
work:
    
    ```
    (defengine wikipedia-spanish
        "https://es.wikipedia.org/w/index.php?search=%s";
        :keybinding "w s")
    ```
    
    This makes that possible by replacing the use of `define-key` (which takes 
a key
    sequence, which needs to start with a prefix key) with the recommended 
function
    `keymap-set` (which takes any string that satisfies `key-valid-p`).
    
    Closes #56.
---
 engine-mode.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/engine-mode.el b/engine-mode.el
index 2bc84457c2..cae3fa8b59 100644
--- a/engine-mode.el
+++ b/engine-mode.el
@@ -1,7 +1,7 @@
 ;;; engine-mode.el --- Define and query search engines from within Emacs
 
 ;; Author: Harry R. Schwartz <hello@harryrschwartz.com>
-;; Version: 2.2.1
+;; Version: 2.2.2
 ;; URL: https://github.com/hrs/engine-mode
 ;; Package-Requires: ((cl-lib "0.5"))
 
@@ -124,7 +124,7 @@ Defaults to `browse-url-browser-function'."
 
 (defun engine/bind-key (engine-name keybinding)
   (when keybinding
-    `(define-key engine-mode-prefixed-map (kbd ,keybinding)
+    `(keymap-set engine-mode-prefixed-map ,keybinding
        (quote ,(engine/function-name engine-name)))))
 
 ;;;###autoload



reply via email to

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