diff options
| author | Juri Linkov | 2018-12-21 01:41:25 +0200 |
|---|---|---|
| committer | Juri Linkov | 2018-12-21 01:41:25 +0200 |
| commit | 157ada833f36b9919be44ad4ecbae6d94c808dec (patch) | |
| tree | bb75cb834bea9b80124e7313dd6b85347f04f08b | |
| parent | 3f36651c6470bab951f12f486eb4928235f1ba50 (diff) | |
| download | emacs-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/NEWS | 5 | ||||
| -rw-r--r-- | lisp/windmove.el | 7 |
2 files changed, 8 insertions, 4 deletions
| @@ -346,8 +346,9 @@ The new command 'windmove-delete-default-keybindings' binds default | |||
| 346 | keys with provided prefix (by default, C-x) and modifiers (by default, | 346 | keys with provided prefix (by default, C-x) and modifiers (by default, |
| 347 | Shift) to the commands that delete the window in the specified | 347 | Shift) to the commands that delete the window in the specified |
| 348 | direction. For example, 'C-x S-down' deletes the window below. | 348 | direction. For example, 'C-x S-down' deletes the window below. |
| 349 | With a prefix arg 'C-u', deletes the selected window and selects | 349 | With a prefix arg 'C-u', also kills the buffer in that window. |
| 350 | the window that was in the specified direction. | 350 | With `M-0', deletes the selected window and selects the window |
| 351 | that was in the specified direction. | ||
| 351 | 352 | ||
| 352 | ** Octave mode | 353 | ** Octave mode |
| 353 | The mode is automatically enabled in files that start with the | 354 | The 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. |
| 687 | If prefix ARG is `C-u', delete the selected window and | 687 | If prefix ARG is `\\[universal-argument]', also kill the buffer in that window. |
| 688 | With `M-0' prefix, delete the selected window and | ||
| 688 | select the window at direction DIR. | 689 | select the window at direction DIR. |
| 689 | When `windmove-wrap-around' is non-nil, takes the window | 690 | When `windmove-wrap-around' is non-nil, takes the window |
| 690 | from the opposite side of the frame." | 691 | from 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)))))) |