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

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

[elpa] externals/ace-window c5e31ce 16/92: ace-window.el (aw-show-dispat


From: Stefan Monnier
Subject: [elpa] externals/ace-window c5e31ce 16/92: ace-window.el (aw-show-dispatch-help): Add and bind to "?"
Date: Wed, 17 Mar 2021 18:39:13 -0400 (EDT)

branch: externals/ace-window
commit c5e31ce87d6c0f267f6489ea0b98c6e347c02b7a
Author: Damien Cassou <damien@cassou.me>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    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)))



reply via email to

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