summaryrefslogtreecommitdiff
path: root/lisp/windmove.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/windmove.el')
-rw-r--r--lisp/windmove.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/windmove.el b/lisp/windmove.el
index 12ecb936033..b4e77102abd 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -485,7 +485,7 @@ Default value of MODIFIERS is `shift'."
(interactive)
(unless modifiers (setq modifiers 'shift))
(when (eq modifiers 'none) (setq modifiers nil))
- (unless (listp modifiers) (setq modifiers (list modifiers)))
+ (setq modifiers (ensure-list modifiers))
(windmove-install-defaults nil modifiers
'((windmove-left left)
(windmove-right right)
@@ -626,7 +626,7 @@ Default value of MODIFIERS is `shift-meta'."
(interactive)
(unless modifiers (setq modifiers '(shift meta)))
(when (eq modifiers 'none) (setq modifiers nil))
- (unless (listp modifiers) (setq modifiers (list modifiers)))
+ (setq modifiers (ensure-list modifiers))
(windmove-install-defaults nil modifiers
'((windmove-display-left left)
(windmove-display-right right)
@@ -641,7 +641,7 @@ 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 `\\[universal-argument]', also kill the buffer in that window.
+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
@@ -703,10 +703,10 @@ Default value of PREFIX is \\`C-x' and MODIFIERS is `shift'."
(interactive)
(unless prefix (setq prefix '(?\C-x)))
(when (eq prefix 'none) (setq prefix nil))
- (unless (listp prefix) (setq prefix (list prefix)))
+ (setq prefix (ensure-list prefix))
(unless modifiers (setq modifiers '(shift)))
(when (eq modifiers 'none) (setq modifiers nil))
- (unless (listp modifiers) (setq modifiers (list modifiers)))
+ (setq modifiers (ensure-list modifiers))
(windmove-install-defaults prefix modifiers
'((windmove-delete-left left)
(windmove-delete-right right)
@@ -724,6 +724,8 @@ from the opposite side of the frame."
nil windmove-wrap-around 'nomini)))
(cond ((or (null other-window) (window-minibuffer-p other-window))
(user-error "No window %s from selected window" dir))
+ ((window-minibuffer-p (selected-window))
+ (user-error "Can't swap window with the minibuffer"))
(t
(window-swap-states nil other-window)))))
@@ -764,7 +766,7 @@ Default value of MODIFIERS is `shift-super'."
(interactive)
(unless modifiers (setq modifiers '(shift super)))
(when (eq modifiers 'none) (setq modifiers nil))
- (unless (listp modifiers) (setq modifiers (list modifiers)))
+ (setq modifiers (ensure-list modifiers))
(windmove-install-defaults nil modifiers
'((windmove-swap-states-left left)
(windmove-swap-states-right right)