branch: externals/leaf
commit bc78da09e5e9a9e2e09b2bfeab94d5a0c1a12d78
Author: Z572 <[email protected]>
Commit: Naoya Yamashita <[email protected]>
Let the leaf-key-describe-bindings with a path
---
leaf.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/leaf.el b/leaf.el
index 933194b..45eb281 100644
--- a/leaf.el
+++ b/leaf.el
@@ -788,7 +788,7 @@ see `alist-get'."
(defvar leaf-key-bindlist nil
"List of bindings performed by `leaf-key'.
-Elements have the form (MAP KEY CMD ORIGINAL-CMD)")
+Elements have the form (MAP KEY CMD ORIGINAL-CMD PATH)")
(defmacro leaf-key (key command &optional keymap)
"Bind KEY to COMMAND in KEYMAP (`global-map' if not passed).
@@ -817,10 +817,11 @@ For example:
(keymap* (eval keymap))
(mmap (or keymap* 'global-map))
(vecp (vectorp key*))
+ (path load-file-name)
(_mvec (if (vectorp key*) key* (read-kbd-macro key*)))
(mstr (if (stringp key*) key* (key-description key*))))
`(let* ((old (lookup-key ,mmap ,(if vecp key `(kbd ,key))))
- (value ,(list '\` `(,mmap ,mstr ,command* ,',(and old (not
(numberp old)) old)))))
+ (value ,(list '\` `(,mmap ,mstr ,command* ,',(and old (not
(numberp old)) old) ,path))))
(push value leaf-key-bindlist)
(define-key ,mmap ,(if vecp key `(kbd ,key)) ',command*))))
@@ -909,7 +910,8 @@ BIND must not contain :{{map}}."
(setq tabulated-list-format [("Map" 20 t)
("Key" 20 t)
("Command" 40 t)
- ("Before Command" 0 t)])
+ ("Before Command" 40 t)
+ ("Path" 0 t)])
(setq tabulated-list-entries
(let ((id 0)
(formatfn (lambda (elm)
@@ -922,7 +924,8 @@ BIND must not contain :{{map}}."
(push `(,id [,(funcall formatfn (nth 0 elm))
,(funcall formatfn (nth 1 elm))
,(funcall formatfn (nth 2 elm))
- ,(funcall formatfn (nth 3 elm))])
+ ,(funcall formatfn (nth 3 elm))
+ ,(funcall formatfn (nth 4 elm))])
res))
(nreverse res)))
(setq tabulated-list-sort-key '("Map" . nil))