summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'emacs')
-rw-r--r--emacs/init.el17
1 files changed, 11 insertions, 6 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 5c8aa17..602b2fa 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -271,13 +271,18 @@ With ARG, open a Dired buffer instead."
(defun my/layout-swap (&optional arg)
"Swap between the two saved window configurations.
With ARG, don't save the current layout."
- (interactive "P")
+ (interactive "p")
+ (messaghe "%s" arg)
(let ((left (car my/layout-pair))
- (right (cdr my/layout-pair)))
- (unless arg
- (setq left (current-window-configuration)))
- (set-window-configuration right t t)
- (setq my/layout-pair (cons right left))))
+ (right (cdr my/layout-pair))
+ (cwc (current-window-configuration)))
+ (cond
+ ((>= arg 16) (setq my/layout-pair (cons cwc cwc)))
+ ((eq (selected-frame) (window-configuration-frame right))
+ (unless (>= arg 4) (setq left cwc))
+ (set-window-configuration right t t)
+ (setq my/layout-pair (cons right left)))
+ (t (message "Quick layout swap only works with same frame!")))))
(progn ; my global keybinds
(define-minor-mode my/keys-mode