aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2018-12-21 01:41:25 +0200
committerJuri Linkov2018-12-21 01:41:25 +0200
commit157ada833f36b9919be44ad4ecbae6d94c808dec (patch)
treebb75cb834bea9b80124e7313dd6b85347f04f08b
parent3f36651c6470bab951f12f486eb4928235f1ba50 (diff)
downloademacs-157ada833f36b9919be44ad4ecbae6d94c808dec.tar.gz
emacs-157ada833f36b9919be44ad4ecbae6d94c808dec.zip
* lisp/windmove.el (windmove-delete-in-direction): Change prefix arg C-u
to kill the buffer. Add prefix arg M-0 to delete the selected window. (Bug#32790)
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/windmove.el7
2 files changed, 8 insertions, 4 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 7a2123a2128..31067c3ff3e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -346,8 +346,9 @@ The new command 'windmove-delete-default-keybindings' binds default
346keys with provided prefix (by default, C-x) and modifiers (by default, 346keys with provided prefix (by default, C-x) and modifiers (by default,
347Shift) to the commands that delete the window in the specified 347Shift) to the commands that delete the window in the specified
348direction. For example, 'C-x S-down' deletes the window below. 348direction. For example, 'C-x S-down' deletes the window below.
349With a prefix arg 'C-u', deletes the selected window and selects 349With a prefix arg 'C-u', also kills the buffer in that window.
350the window that was in the specified direction. 350With `M-0', deletes the selected window and selects the window
351that was in the specified direction.
351 352
352** Octave mode 353** Octave mode
353The mode is automatically enabled in files that start with the 354The mode is automatically enabled in files that start with the
diff --git a/lisp/windmove.el b/lisp/windmove.el
index c16c12444a0..75b9e0cf599 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -684,7 +684,8 @@ Default value of MODIFIERS is `shift-meta'."
684 684
685(defun windmove-delete-in-direction (dir &optional arg) 685(defun windmove-delete-in-direction (dir &optional arg)
686 "Delete the window at direction DIR. 686 "Delete the window at direction DIR.
687If prefix ARG is `C-u', delete the selected window and 687If prefix ARG is `\\[universal-argument]', also kill the buffer in that window.
688With `M-0' prefix, delete the selected window and
688select the window at direction DIR. 689select the window at direction DIR.
689When `windmove-wrap-around' is non-nil, takes the window 690When `windmove-wrap-around' is non-nil, takes the window
690from the opposite side of the frame." 691from the opposite side of the frame."
@@ -693,7 +694,9 @@ from the opposite side of the frame."
693 (cond ((null other-window) 694 (cond ((null other-window)
694 (user-error "No window %s from selected window" dir)) 695 (user-error "No window %s from selected window" dir))
695 (t 696 (t
696 (if (not (consp arg)) 697 (when (equal arg '(4))
698 (kill-buffer (window-buffer other-window)))
699 (if (not (equal arg 0))
697 (delete-window other-window) 700 (delete-window other-window)
698 (delete-window (selected-window)) 701 (delete-window (selected-window))
699 (select-window other-window)))))) 702 (select-window other-window))))))