branch: externals/leaf
commit 097cb1d2fdab35ab0c3e11a51b21ee8a734a855c
Author: lorniu/sz <lor...@gmail.com>
Commit: lorniu/sz <lor...@gmail.com>

    Remove extra quote before (lambda) generated by `leaf-key`.
---
 leaf-tests.el | 2 +-
 leaf.el       | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/leaf-tests.el b/leaf-tests.el
index 72552f7ae6..b7fdeeb113 100644
--- a/leaf-tests.el
+++ b/leaf-tests.el
@@ -2454,7 +2454,7 @@ Example:
        (let* ((old (lookup-key global-map (kbd "M-s O")))
               (value `(global-map "M-s O" *lambda-function* ,(and old (not 
(numberp old)) old) nil)))
          (leaf-safe-push value leaf-key-bindlist)
-         (define-key global-map (kbd "M-s O") '(lambda () "color-moccur" 
(interactive) (color-moccur)))))
+         (define-key global-map (kbd "M-s O") (lambda () "color-moccur" 
(interactive) (color-moccur)))))
 
       ((leaf-key "M-s O" '(menu-item "" nil :filter (lambda (&optional _) 
#'other-window)))
        (let* ((old (lookup-key global-map (kbd "M-s O")))
diff --git a/leaf.el b/leaf.el
index f36e76a05c..08ae412cf6 100644
--- a/leaf.el
+++ b/leaf.el
@@ -858,7 +858,8 @@ For example:
     `(let* ((old (lookup-key ,mmap ,(if vecp key* `(kbd ,key*))))
             (value ,(list '\` `(,mmap ,mstr ,bindto ,',(and old (not (numberp 
old)) old) ,path))))
        (leaf-safe-push value leaf-key-bindlist)
-       (define-key ,mmap ,(if vecp key* `(kbd ,key*)) ',command*))))
+       (define-key ,mmap ,(if vecp key* `(kbd ,key*))
+                   ,(if (eq bindto '*lambda-function*) command* 
`',command*)))))
 
 (defmacro leaf-key* (key command)
   "Similar to `leaf-key', but overrides any mode-specific bindings.

Reply via email to