about summary refs log tree commit diff
path: root/tools/emacs
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-12-24T17·43+0100
committerVincent Ambo <tazjin@google.com>2019-12-24T17·43+0100
commit4a0cf0de9879f016490fee6e4b3b8197d54be29c (patch)
tree6aa7beb05299419f3597e362bde709f4fa7ec499 /tools/emacs
parent637cb0bd2a091d8a4c60e6566a7d7ba3a83fa6a0 (diff)
fix(emacs.d): Avoid advising split-window-* functions r/299
Advising these functions apparently breaks things internally.
Diffstat (limited to 'tools/emacs')
-rw-r--r--tools/emacs/config/desktop.el3
-rw-r--r--tools/emacs/config/init.el14
2 files changed, 12 insertions, 5 deletions
diff --git a/tools/emacs/config/desktop.el b/tools/emacs/config/desktop.el
index d923ab584c75..05402f68bcff 100644
--- a/tools/emacs/config/desktop.el
+++ b/tools/emacs/config/desktop.el
@@ -210,4 +210,7 @@
 (exwm-input-set-key (kbd "s-m h") #'randr-layout-hdmi1-extend)
 (exwm-input-set-key (kbd "s-m s") #'randr-layout-single)
 
+;; Use edwina for window management shortcuts
+(edwina-mode 1)
+
 (provide 'desktop)
diff --git a/tools/emacs/config/init.el b/tools/emacs/config/init.el
index 307699536cc4..4129de4d37a5 100644
--- a/tools/emacs/config/init.el
+++ b/tools/emacs/config/init.el
@@ -61,11 +61,15 @@
                         (edwina-arrange))
               :matcher #'ivy--switch-buffer-matcher
               :caller 'ivy-switch-buffer))
-  :bind (:map edwina-mode-map
-              ("s-w b" . #'edwina-split-to-buffer))
-  :config
-  (advice-add 'split-window-below :after 'edwina-arrange)
-  (edwina-mode 1))
+  ;; Using an advice for this functionality breaks various internal
+  ;; things in split-window, hence a new interactive function.
+  (defun edwina-split-arrange ()
+    (interactive)
+    (split-window-below)
+    (edwina-arrange))
+  :bind (("C-x 2" . edwina-split-arrange)
+         :map edwina-mode-map
+         ("s-w b" . #'edwina-split-to-buffer)))
 
 (use-package gruber-darker-theme)
 (use-package ht)