[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ace-window 26c0ad0 36/92: ace-window.el (aw-dispatch-de
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ace-window 26c0ad0 36/92: ace-window.el (aw-dispatch-default): Check action |
Date: |
Wed, 17 Mar 2021 18:39:17 -0400 (EDT) |
branch: externals/ace-window
commit 26c0ad05157e9c3bf9de5f3c26bdcc2213fc35e5
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
ace-window.el (aw-dispatch-default): Check action
Instead of providing defaults to destructure.
Fixes #119
---
ace-window.el | 42 ++++++++++++++++++++----------------------
1 file changed, 20 insertions(+), 22 deletions(-)
diff --git a/ace-window.el b/ace-window.el
index 1e36d34..bdba85e 100644
--- a/ace-window.el
+++ b/ace-window.el
@@ -369,32 +369,30 @@ pixels."
(defun aw-dispatch-default (char)
"Perform an action depending on CHAR."
(cond ((avy-mouse-event-window char))
- ((= char (aref (kbd "C-g") 0))
- (throw 'done 'exit))
+ ((= char (aref (kbd "C-g") 0))
+ (throw 'done 'exit))
((= char aw-make-frame-char)
(aw-use-frame (selected-window))
(throw 'done 'exit))
- (t
+ (t
(let ((action (aw--dispatch-action char)))
- ;; Prevent cl-destructuring-bind from triggering an error when
- ;; given too few arguments.
- (cl-destructuring-bind (_key fn &optional description) (or action
'(nil nil nil))
- (if action
- (if (and fn description)
- (prog1 (setq aw-action fn)
- (aw-set-mode-line (format " Ace - %s" description)))
- (funcall fn)
- (throw 'done 'exit))
- ;; Remove any possible ace-window command char that may
- ;; precede the last specified window label, so
- ;; functions can use `avy-current-path' as the chosen
- ;; window label.
- (when (and (> (length avy-current-path) 0)
- (assq (aref avy-current-path 0) aw-dispatch-alist))
- (setq avy-current-path (substring avy-current-path 1)))
- ;; Prevent any char from triggering an avy dispatch command.
- (let ((avy-dispatch-alist))
- (avy-handler-default char))))))))
+ (if action
+ (cl-destructuring-bind (_key fn &optional description) action
+ (if (and fn description)
+ (prog1 (setq aw-action fn)
+ (aw-set-mode-line (format " Ace - %s" description)))
+ (funcall fn)
+ (throw 'done 'exit)))
+ ;; Remove any possible ace-window command char that may
+ ;; precede the last specified window label, so
+ ;; functions can use `avy-current-path' as the chosen
+ ;; window label.
+ (when (and (> (length avy-current-path) 0)
+ (assq (aref avy-current-path 0) aw-dispatch-alist))
+ (setq avy-current-path (substring avy-current-path 1)))
+ ;; Prevent any char from triggering an avy dispatch command.
+ (let ((avy-dispatch-alist))
+ (avy-handler-default char)))))))
(defun aw-select (mode-line &optional action)
"Return a selected other window.
- [elpa] externals/ace-window 6d3a6a0 23/92: ace-window.el (aw-switch-buffer-in-window): Use ivy if available, (continued)
- [elpa] externals/ace-window 6d3a6a0 23/92: ace-window.el (aw-switch-buffer-in-window): Use ivy if available, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 137af0d 32/92: ace-window.el: Make "z" open a frame right away, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window be3a885 38/92: Fix so ace-window-display-mode ids are displayed in new frames, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 4ab92e1 39/92: Fix up the previous commit, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window c0fbdd5 40/92: ace-window.el: Fix compiler warning, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window de873d1 09/92: Add `aw-reverse-frame-list` variable, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window d92320e 10/92: Add fair window split., Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 0a59342 12/92: ace-window.el (aw-keys): Add custom type, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window ad7c0fb 21/92: test/make-plain.el: Add, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 5e733ff 35/92: ace-window.el: Documentation and minor changes, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 26c0ad0 36/92: ace-window.el (aw-dispatch-default): Check action,
Stefan Monnier <=
- [elpa] externals/ace-window 92d20e7 47/92: Bring back "Make window ordering rely on frame position", Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 6ff31d1 33/92: Do not ignore window-parameters, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window ceea53d 41/92: ace-window.el (aw-dispatch-default): Add fboundp, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window d5d8f5d 30/92: Update README.md with latest commands and remove "i" (duplicate), Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 5b88de0 49/92: ace-window.el (aw-translate-char-function): New defcustom, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window f0da12d 71/92: Readme.md: Add copy window to both action lists, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window edbbb1b 86/92: ace-window.el (ace-window): Extend doc, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 196382b 78/92: ace-window.el (aw-display-mode-overlay): New defcustom, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window cd82d83 77/92: Use call-interactively if the callee function is a command, Stefan Monnier, 2021/03/17
- [elpa] externals/ace-window 138a80c 83/92: ace-window.el (aw--lead-overlay): Fix double recenter problem, Stefan Monnier, 2021/03/17