From 137af0de121d4f79293c19e447192561ce0d6cae Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Sat, 9 Dec 2017 16:51:30 +0100 Subject: [PATCH] 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.