emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 157ada8: * lisp/windmove.el (windmove-delete-in-dir


From: Juri Linkov
Subject: [Emacs-diffs] master 157ada8: * lisp/windmove.el (windmove-delete-in-direction): Change prefix arg C-u
Date: Thu, 20 Dec 2018 18:41:32 -0500 (EST)

branch: master
commit 157ada833f36b9919be44ad4ecbae6d94c808dec
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>

    * 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)
---
 etc/NEWS         | 5 +++--
 lisp/windmove.el | 7 +++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 7a2123a..31067c3 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -346,8 +346,9 @@ The new command 'windmove-delete-default-keybindings' binds 
default
 keys with provided prefix (by default, C-x) and modifiers (by default,
 Shift) to the commands that delete the window in the specified
 direction.  For example, 'C-x S-down' deletes the window below.
-With a prefix arg 'C-u', deletes the selected window and selects
-the window that was in the specified direction.
+With a prefix arg 'C-u', also kills the buffer in that window.
+With `M-0', deletes the selected window and selects the window
+that was in the specified direction.
 
 ** Octave mode
 The mode is automatically enabled in files that start with the
diff --git a/lisp/windmove.el b/lisp/windmove.el
index c16c124..75b9e0c 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -684,7 +684,8 @@ Default value of MODIFIERS is `shift-meta'."
 
 (defun windmove-delete-in-direction (dir &optional arg)
   "Delete the window at direction DIR.
-If prefix ARG is `C-u', delete the selected window and
+If prefix ARG is `\\[universal-argument]', also kill the buffer in that window.
+With `M-0' prefix, delete the selected window and
 select the window at direction DIR.
 When `windmove-wrap-around' is non-nil, takes the window
 from the opposite side of the frame."
@@ -693,7 +694,9 @@ from the opposite side of the frame."
     (cond ((null other-window)
            (user-error "No window %s from selected window" dir))
           (t
-           (if (not (consp arg))
+           (when (equal arg '(4))
+             (kill-buffer (window-buffer other-window)))
+           (if (not (equal arg 0))
                (delete-window other-window)
              (delete-window (selected-window))
              (select-window other-window))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]