branch: externals/leaf
commit 8c8c7934ffa3a8a5e03cd694ce00fbfbabc06ecc
Author: conao3 <[email protected]>
Commit: conao3 <[email protected]>
remove tabulated-list guard
---
leaf.el | 69 ++++++++++++++++++++++++++++++-----------------------------------
1 file changed, 32 insertions(+), 37 deletions(-)
diff --git a/leaf.el b/leaf.el
index b8329b1..73411e3 100644
--- a/leaf.el
+++ b/leaf.el
@@ -851,45 +851,40 @@ BIND must not contain :{{map}}."
(let ((binds (if (and (atom (car bind)) (atom (cdr bind))) `(,bind) bind)))
`(leaf-keys (:leaf-key-override-global-map ,@binds))))
-(eval
- (eval-and-compile
- (when (featurep 'tabulated-list)
- '(progn
- (require 'tabulated-list)
-
- (define-derived-mode leaf-key-list-mode tabulated-list-mode "Leaf-key
Bindings"
- "Major mode for listing bindings configured via `leaf-key'."
- (setq tabulated-list-format [("Map" 20 t)
- ("Key" 20 t)
- ("Command" 40 t)
- ("Before Command" 0 t)])
- (setq tabulated-list-entries
- (let ((id 0)
- (formatfn (lambda (elm)
- (if (stringp elm)
- elm
- (prin1-to-string (if (eq elm nil) '---
elm)))))
- res)
- (dolist (elm leaf-key-bindlist)
- (setq id (1+ id))
- (push `(,id [,(funcall formatfn (nth 0 elm))
- ,(funcall formatfn (nth 1 elm))
- ,(funcall formatfn (nth 2 elm))
- ,(funcall formatfn (nth 3 elm))])
- res))
- (nreverse res)))
- (setq tabulated-list-sort-key '("Map" . nil))
- (tabulated-list-print)
- (tabulated-list-init-header))
+(define-derived-mode leaf-key-list-mode tabulated-list-mode "Leaf-key Bindings"
+ "Major mode for listing bindings configured via `leaf-key'."
+ (setq tabulated-list-format [("Map" 20 t)
+ ("Key" 20 t)
+ ("Command" 40 t)
+ ("Before Command" 0 t)])
+ (setq tabulated-list-entries
+ (let ((id 0)
+ (formatfn (lambda (elm)
+ (if (stringp elm)
+ elm
+ (prin1-to-string (if (eq elm nil) '--- elm)))))
+ res)
+ (dolist (elm leaf-key-bindlist)
+ (setq id (1+ id))
+ (push `(,id [,(funcall formatfn (nth 0 elm))
+ ,(funcall formatfn (nth 1 elm))
+ ,(funcall formatfn (nth 2 elm))
+ ,(funcall formatfn (nth 3 elm))])
+ res))
+ (nreverse res)))
+ (setq tabulated-list-sort-key '("Map" . nil))
+ (tabulated-list-print)
+ (tabulated-list-init-header))
;;;###autoload
- (defun leaf-key-describe-bindings ()
- "Display all the bindings configured via `leaf-key'."
- (interactive)
- (let ((buf (get-buffer-create "*Leaf-key bindings*")))
- (with-current-buffer buf
- (leaf-key-list-mode))
- (display-buffer buf)))))))
+(defun leaf-key-describe-bindings ()
+ "Display all the bindings configured via `leaf-key'."
+ (interactive)
+ (require 'tabulated-list)
+ (let ((buf (get-buffer-create "*Leaf-key bindings*")))
+ (with-current-buffer buf
+ (leaf-key-list-mode))
+ (display-buffer buf)))
;;;; Handler