From e60988f62570d0b4ab94a073ee5f07c8da249824 Mon Sep 17 00:00:00 2001 From: Justin Burkett Date: Tue, 5 Jun 2018 14:14:16 -0400 Subject: [PATCH] Add evil-collection-describe-all-bindings This is a simple function to write out known evil-collection bindings to a new buffer. --- evil-collection.el | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/evil-collection.el b/evil-collection.el index 98ac617..086ba3f 100644 --- a/evil-collection.el +++ b/evil-collection.el @@ -220,6 +220,28 @@ Filter keys on the basis of `evil-collection-key-whitelist' and (push (cons package record) evil-collection-bindings-record)) nil)) +(defun evil-collection-describe-all-bindings () + "Print bindings made by evil-collection to separate buffer." + (interactive) + (let ((buf (get-buffer-create "*evil-collection*"))) + (switch-to-buffer-other-window buf) + (with-current-buffer buf + (erase-buffer) + (org-mode) + (dolist (package evil-collection-bindings-record) + (insert "\n\n* " (symbol-name (car package)) ) + (insert " +| Key | Definition | +|-----|------------| +") + (dolist (binding (cdr package)) + ;; Don't print nil definitions + (when (cdr binding) + ;; FIXME: Handle keys with | in them + (insert (format "| %s | %S |\n" + (key-description (car binding)) (cdr binding))))) + (org-table-align))))) + (defun evil-collection--translate-key (state keymap-symbol translations destructive)