summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-09-04 09:46:16 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-09-04 09:46:16 -0700
commit32d137889aec790248343d21ee4bccc4acaa69bd (patch)
tree3260bd0c89c99e194a9d3530e2e50b3858663cd3
parent6d5706ddaa765c175e0f61c44d286db4314dbe20 (diff)
downloaddotfiles-32d137889aec790248343d21ee4bccc4acaa69bd.tar.gz
simplify C-x o binding
-rw-r--r--.emacs.d/init-spw.el18
1 files changed, 6 insertions, 12 deletions
diff --git a/.emacs.d/init-spw.el b/.emacs.d/init-spw.el
index ba66fea8..503d8812 100644
--- a/.emacs.d/init-spw.el
+++ b/.emacs.d/init-spw.el
@@ -1556,19 +1556,13 @@ I use by default)."
(setq best-time time)
(setq best-window window)))))
-(defun spw/back-and-forth (interactive)
+(defun spw/back-and-forth (arg)
(interactive "P")
- (cond
- ;; if there's a prefix arg then just `other-window', so that's still
- ;; available on M-1 C-x o
- (interactive
- (call-interactively #'other-window))
- ;; Thanks to C-c b will probably never take advantage of this branch; drop
- ;; it?
- ((one-window-p)
- (switch-to-buffer (other-buffer) nil t))
- (t
- (select-window (spw/get-mru-window)))))
+ (if arg
+ ;; if there's a prefix arg then just `other-window', so that's still
+ ;; available on M-1 C-x o
+ (call-interactively #'other-window)
+ (select-window (spw/get-mru-window))))
(global-set-key [remap other-window] #'spw/back-and-forth)
(defun spw/set-other-window-to-scroll (arg)