Function: aw-dispatch-default

aw-dispatch-default is a byte-compiled function defined in ace-window.el.

Signature

(aw-dispatch-default CHAR)

Documentation

Perform an action depending on CHAR.

Source Code

;; Defined in ~/.emacs.d/elpa/ace-window-20220911.358/ace-window.el
(defun aw-dispatch-default (char)
  "Perform an action depending on CHAR."
  (cond ((and (fboundp 'avy-mouse-event-window)
              (avy-mouse-event-window char)))
        ((= char (aref (kbd "C-g") 0))
         (throw 'done 'exit))
        ((and aw-make-frame-char (= char aw-make-frame-char))
         ;; Make a new frame and perform any action on its window.
         (let ((start-win (selected-window))
               (end-win (frame-selected-window (aw-make-frame))))
           (if aw-action
               ;; Action must be called from the start-win.  The action
               ;; determines which window to leave selected.
               (progn (select-frame-set-input-focus (window-frame start-win))
                      (funcall aw-action end-win))
             ;; Select end-win when no action
             (aw-switch-to-window end-win)))
         (throw 'done 'exit))
        (t
         (let ((action (aw--dispatch-action 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)))
                   (if (commandp fn)
                       (call-interactively fn)
                     (funcall fn))
                   (throw 'done 'exit)))
             (aw-clean-up-avy-current-path)
             ;; Prevent any char from triggering an avy dispatch command.
             (let ((avy-dispatch-alist))
               (avy-handler-default char)))))))