Commit 75b41a38 authored by Juanma Barranquero's avatar Juanma Barranquero

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.
parent 1b9dbca8
Pipeline #4171 failed with stage
in 67 minutes and 36 seconds
......@@ -2620,10 +2620,6 @@ scrolling.
** help-follow-symbol now signals 'user-error' if point (or the
position pointed to by the argument POS) is not in a symbol.
---
*** next-buffer and previous-buffer now signal 'user-error' if there
is no buffer to switch to.
* Lisp Changes in Emacs 27.1
......@@ -3259,6 +3255,10 @@ by setting 'undo-inhibit-region' symbol property of that command to
non-nil. This is used by 'mouse-drag-region' to make the effect
easier to undo immediately afterwards.
---
** When called interactively, next-buffer and previous-buffer now
signal 'user-error' if there is no buffer to switch to.
* Changes in Emacs 27.1 on Non-Free Operating Systems
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment