auto toggle ace-window-posframe-mode
This commit is contained in:
1 file changed
+11
-2
+11
-2
@@ -4,10 +4,19 @@
|
|||||||
|
|
||||||
|
|
||||||
(with-eval-after-load 'ace-window
|
(with-eval-after-load 'ace-window
|
||||||
(require 'ace-window-posframe)
|
|
||||||
(ace-window-posframe-mode 1)
|
|
||||||
(setq aw-dispatch-when-more-than 3))
|
(setq aw-dispatch-when-more-than 3))
|
||||||
|
|
||||||
|
(defun creature/auto-toggle-ace-window-posframe-mode (&rest _ignore)
|
||||||
|
"Enable `ace-window-posframe-mode' when Emacs running with GUI, otherwise disable it."
|
||||||
|
(if (display-graphic-p)
|
||||||
|
(progn
|
||||||
|
(require 'ace-window-posframe)
|
||||||
|
(ace-window-posframe-mode 1))
|
||||||
|
(when (fboundp 'ace-window-posframe-mode)
|
||||||
|
(ace-window-posframe-mode -1))))
|
||||||
|
|
||||||
|
(advice-add 'ace-window :before #'creature/auto-toggle-ace-window-posframe-mode)
|
||||||
|
|
||||||
(lazy-load-global-keys
|
(lazy-load-global-keys
|
||||||
'(("C-x o" . ace-window))
|
'(("C-x o" . ace-window))
|
||||||
"ace-window")
|
"ace-window")
|
||||||
|
|||||||
Reference in new issue
Block a user