branch: externals/leaf commit d314af8e9f8b545a23cc1c33056cbec4dde0fc9b Merge: 2d395ee3d4 097cb1d2fd Author: Naoya Yamashita <con...@gmail.com> Commit: GitHub <nore...@github.com>
Merge pull request #521 from lorniu/master 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 ee1d2d25bb..a093970aa0 100644 --- a/leaf.el +++ b/leaf.el @@ -874,7 +874,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.