From c5e31ce87d6c0f267f6489ea0b98c6e347c02b7a Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Wed, 8 Nov 2017 11:11:57 +0100 Subject: [PATCH] ace-window.el (aw-show-dispatch-help): Add and bind to "?" Shows available commands. Fixes #103 Fixes #104 --- ace-window.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ace-window.el b/ace-window.el index f9bb391..c459534 100644 --- a/ace-window.el +++ b/ace-window.el @@ -269,7 +269,8 @@ LEAF is (PT . WND)." (?v aw-split-window-vert "Split Vert Window") (?b aw-split-window-horz "Split Horz Window") (?i delete-other-windows "Delete Other Windows") - (?o delete-other-windows)) + (?o delete-other-windows) + (?? aw-show-dispatch-help)) "List of actions for `aw-dispatch-default'.") (defun aw--dispatch-action (char) @@ -460,6 +461,16 @@ Windows are numbered top down, left to right." (interactive) (aw-switch-to-window (aw--pop-window))) +(defun aw-show-dispatch-help () + "Display action shortucts in echo area." + (interactive) + (message "%s" (mapconcat + (lambda (action) + (cl-destructuring-bind (key fn &optional description) action + (format "%s: %s" (char-to-string key) (or description fn)))) + aw-dispatch-alist + "\n"))) + (defun aw-delete-window (window) "Delete window WINDOW." (let ((frame (window-frame window)))