about summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2021-12-17 18:29:58 -0600
committerCase Duckworth2021-12-17 18:29:58 -0600
commit506b6c66fee75b1c5d3a94527c0f3945805ce1b8 (patch)
treeca9d24e6fb7d3278156a282b8ea93e68d7908ee7 /lisp
parentLots of changes, most interestingly browse-url stuff (diff)
downloademacs-506b6c66fee75b1c5d3a94527c0f3945805ce1b8.tar.gz
emacs-506b6c66fee75b1c5d3a94527c0f3945805ce1b8.zip
Add ace-window
Diffstat (limited to 'lisp')
-rw-r--r--lisp/+ace-window.el37
1 files changed, 37 insertions, 0 deletions
diff --git a/lisp/+ace-window.el b/lisp/+ace-window.el new file mode 100644 index 0000000..fca27d9 --- /dev/null +++ b/lisp/+ace-window.el
@@ -0,0 +1,37 @@
1;;; +ace-window.el -*- lexical-binding: t; -*-
2
3;;; Code:
4
5(require 'ace-window)
6
7;;;###autoload
8(define-minor-mode +ace-window-display-mode
9 "Minor mode for updating data for `+modeline-ace-window-display'."
10 ;; This is stolen from ace-window.el but with the mode-line stuff ripped out.
11 :global t
12 (if +ace-window-display-mode
13 (progn
14 (aw-update)
15 (force-mode-line-update t)
16 (add-hook 'window-configuration-change-hook 'aw-update)
17 (add-hook 'after-make-frame-functions 'aw--after-make-frame t)
18 (advice-add 'aw--lead-overlay :override 'ignore))
19 (remove-hook 'window-configuration-change-hook 'aw-update)
20 (remove-hook 'after-make-frame-functions 'aw--after-make-frame)
21 (advice-remove 'aw--lead-overlay 'ignore)))
22
23;;;###autoload
24(defun +ace-window-or-switch-buffer (arg)
25 "Call `ace-window' with ARG if more than one window is visible.
26Switch to most recent buffer otherwise."
27 ;; cribbed from `crux-other-window-or-switch-buffer'
28 (interactive "p")
29 (if (one-window-p)
30 (switch-to-buffer nil)
31 (ace-window arg)))
32
33(defun +ace-window@disable-overlay (_fn &rest _args)
34 "ADVICE for FN `aw--lead-overlay' (and ARGS) to not show overlays.")
35
36(provide '+ace-window)
37;;; +ace-window.el ends here