aboutsummaryrefslogtreecommitdiff
path: root/modules/custom-buffer-file.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-11 15:35:43 -0500
committerCraig Jennings <c@cjennings.net>2026-05-11 15:35:43 -0500
commit0ddbcde1e9f17021377f4160b39cd0790afcbdcc (patch)
treed1872d799dc7554b128989411a23b9cad65a6671 /modules/custom-buffer-file.el
parentf837e5f7464932fc49c10a7442dc1a23af61b257 (diff)
downloaddotemacs-0ddbcde1e9f17021377f4160b39cd0790afcbdcc.tar.gz
dotemacs-0ddbcde1e9f17021377f4160b39cd0790afcbdcc.zip
feat(window): kill the other window's buffer with C-; b K
`cj/kill-other-window-buffer' (in undead-buffers.el, on `C-; b K') kills or buries the buffer shown in the other window and leaves that window and the split alone. The window just shows whatever bury/kill surfaces next. It reuses `cj/kill-buffer-or-bury-alive', so buffers in `cj/undead-buffer-list' (like `*scratch*') get buried. With more than two windows it acts on `next-window'. Sibling of `cj/kill-other-window' (M-S-o), which deletes the other window. This one keeps it.
Diffstat (limited to 'modules/custom-buffer-file.el')
-rw-r--r--modules/custom-buffer-file.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/custom-buffer-file.el b/modules/custom-buffer-file.el
index f4401d1f..ef4fc945 100644
--- a/modules/custom-buffer-file.el
+++ b/modules/custom-buffer-file.el
@@ -17,6 +17,8 @@
;;
;; Keybindings under ~C-; b~:
;; - ~C-; b k~ kill buffer and window (delete window, kill/bury buffer)
+;; - ~C-; b K~ kill the other window's buffer, keeping that window/split
+;; (cj/kill-other-window-buffer in undead-buffers.el)
;; - ~C-; b <arrow>~ move the active window's divider that way (via windsize);
;; bare arrows keep nudging until any other key (cj/window-resize-sticky in
;; ui-navigation.el)
@@ -37,8 +39,9 @@
(require 'mm-decode)
(require 'external-open) ;; for cj/xdg-open, cj/open-this-file-with
-;; cj/kill-buffer-and-window defined in undead-buffers.el
+;; cj/kill-buffer-and-window and cj/kill-other-window-buffer defined in undead-buffers.el
(declare-function cj/kill-buffer-and-window "undead-buffers")
+(declare-function cj/kill-other-window-buffer "undead-buffers")
;; cj/window-resize-sticky (C-; b <arrow>) defined in ui-navigation.el
(declare-function cj/window-resize-sticky "ui-navigation")
@@ -449,6 +452,7 @@ Signals an error if:
"n" #'cj/copy-buffer-name
"l" #'cj/copy-link-to-buffer-file
"k" #'cj/kill-buffer-and-window
+ "K" #'cj/kill-other-window-buffer
"P" #'cj/print-buffer-ps
"t" #'cj/clear-to-top-of-buffer
"b" #'cj/clear-to-bottom-of-buffer
@@ -486,6 +490,7 @@ Signals an error if:
"C-; b n" "copy buffer name"
"C-; b l" "copy file link"
"C-; b k" "kill buffer and window"
+ "C-; b K" "kill other window's buffer"
"C-; b P" "print to PS"
"C-; b t" "clear to top"
"C-; b b" "clear to bottom"