summaryrefslogtreecommitdiff
path: root/lisp/window.el
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2019-11-26 22:35:04 +0100
committerJuanma Barranquero <lekktu@gmail.com>2019-11-26 22:35:04 +0100
commit75b41a38dd0735fe63457e12741656c63972d3ce (patch)
tree2c65c6dfbb0a556e540ac94d8cb299066621d564 /lisp/window.el
parent1b9dbca826ad8a742ab22719279f5ce3c5888a67 (diff)
downloademacs-75b41a38dd0735fe63457e12741656c63972d3ce.tar.gz
Fix previous change to (next|previous)-buffer
* lisp/window.el (next-buffer, previous-buffer): If no other buffer is available, signal 'user-error' only when called interactively.
Diffstat (limited to 'lisp/window.el')
-rw-r--r--lisp/window.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/window.el b/lisp/window.el
index c8a5816b8c9..c750ea71ead 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -4850,7 +4850,8 @@ minibuffer window or is dedicated to its buffer."
(user-error "Window is strongly dedicated to its buffer"))
(t
(dotimes (_ (or arg 1))
- (unless (switch-to-next-buffer)
+ (when (and (not (switch-to-next-buffer))
+ (called-interactively-p 'interactive))
(user-error "No next buffer"))))))
(defun previous-buffer (&optional arg)
@@ -4865,7 +4866,8 @@ minibuffer window or is dedicated to its buffer."
(user-error "Window is strongly dedicated to its buffer"))
(t
(dotimes (_ (or arg 1))
- (unless (switch-to-prev-buffer)
+ (when (and (not (switch-to-prev-buffer))
+ (called-interactively-p 'interactive))
(user-error "No previous buffer"))))))
(defun delete-windows-on (&optional buffer-or-name frame)