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

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

[elpa] externals/leaf 8c8c793 23/29: remove tabulated-list guard


From: Stefan Monnier
Subject: [elpa] externals/leaf 8c8c793 23/29: remove tabulated-list guard
Date: Tue, 10 Nov 2020 14:47:43 -0500 (EST)

branch: externals/leaf
commit 8c8c7934ffa3a8a5e03cd694ce00fbfbabc06ecc
Author: conao3 <conao3@gmail.com>
Commit: conao3 <conao3@gmail.com>

    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



reply via email to

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