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

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

[elpa] externals/ace-window 137af0d 32/92: ace-window.el: Make "z" open


From: Stefan Monnier
Subject: [elpa] externals/ace-window 137af0d 32/92: ace-window.el: Make "z" open a frame right away
Date: Wed, 17 Mar 2021 18:39:16 -0400 (EDT)

branch: externals/ace-window
commit 137af0de121d4f79293c19e447192561ce0d6cae
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    ace-window.el: Make "z" open a frame right away
    
    Re #114
---
 ace-window.el | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/ace-window.el b/ace-window.el
index 105fe99..1c92a17 100644
--- a/ace-window.el
+++ b/ace-window.el
@@ -294,8 +294,7 @@ LEAF is (PT . WND)."
     (?v aw-split-window-vert "Split Vert Window")
     (?b aw-split-window-horz "Split Horz Window")
     (?o delete-other-windows)
-    (?? aw-show-dispatch-help)
-    (?z aw-use-frame "Use new frame"))
+    (?? aw-show-dispatch-help))
   "List of actions for `aw-dispatch-default'.")
 
 (defun aw--dispatch-action (char)
@@ -331,17 +330,21 @@ pixels."
 
 (defun aw-dispatch-default (char)
   "Perform an action depending on CHAR."
-  (if (= char (aref (kbd "C-g") 0))
-      (throw 'done 'exit)
-    (let ((action (aw--dispatch-action char)))
-      (cl-destructuring-bind (_key fn &optional description) action
-        (if action
-            (if (and fn description)
-                (prog1 (setq aw-action fn)
-                  (aw-set-mode-line (format " Ace - %s" description)))
-              (funcall fn)
-              (throw 'done 'exit))
-          (avy-handler-default char))))))
+  (cond ((= char (aref (kbd "C-g") 0))
+         (throw 'done 'exit))
+        ((= char ?z)
+         (aw-use-frame (selected-window))
+         (throw 'done 'exit))
+        (t
+         (let ((action (aw--dispatch-action char)))
+           (cl-destructuring-bind (_key fn &optional description) action
+             (if action
+                 (if (and fn description)
+                     (prog1 (setq aw-action fn)
+                       (aw-set-mode-line (format " Ace - %s" description)))
+                   (funcall fn)
+                   (throw 'done 'exit))
+               (avy-handler-default char)))))))
 
 (defun aw-select (mode-line &optional action)
   "Return a selected other window.



reply via email to

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