summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)