summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-08-10 16:39:01 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-08-10 16:39:01 -0700
commit7b7198a4194ce0a0d41d2b2f14cd7e7df30a865e (patch)
tree6dcb0e49c9cd801f06e3145b201d98ec599f1a88
parentf63e0ec559f5f5ceeeff352eb636f5b45e305014 (diff)
downloaddotfiles-7b7198a4194ce0a0d41d2b2f14cd7e7df30a865e.tar.gz
replace C-c W with C-c b
-rw-r--r--.emacs.d/init-spw.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/.emacs.d/init-spw.el b/.emacs.d/init-spw.el
index 4ab440f2..fd93eb3e 100644
--- a/.emacs.d/init-spw.el
+++ b/.emacs.d/init-spw.el
@@ -491,13 +491,23 @@ add places the library might be available to `load-path'."
;; bit complicated but we want these commands to be easily repeatable but also
;; avoid setting a transient map containing self-insert chars, as might want
;; to type those right after switching
+(defun spw/maybe-next-buffer ()
+ (interactive)
+ (message
+ (if (window-next-buffers)
+ "Went forwards; use <left> to go back, or C-c b again."
+ "Went backwards; use <right> to go back, or C-c b again."))
+ (call-interactively
+ (if (window-next-buffers)
+ #'next-buffer
+ #'previous-buffer)))
(spw/bind-command-with-cycling
;; Note `previous-buffer' and `next-buffer' actually use
;; `switch-to-prev-buffer' and `switch-to-next-buffer' as subroutines, so
;; buffers previously shown in the selected window come up first, as
;; desired. 'w' is for "window's buffers".
(("\C-cw" . previous-buffer)
- ("\C-cW" . next-buffer))
+ ("\C-cb" . spw/maybe-next-buffer))
(lambda (count)
(interactive "p")
(if (> count 0)
@@ -1449,6 +1459,8 @@ I use by default)."
;; 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