emacs-diffs
[Top][All Lists]
Advanced

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

master 75b41a3: Fix previous change to (next|previous)-buffer


From: Juanma Barranquero
Subject: master 75b41a3: Fix previous change to (next|previous)-buffer
Date: Tue, 26 Nov 2019 16:35:40 -0500 (EST)

branch: master
commit 75b41a38dd0735fe63457e12741656c63972d3ce
Author: Juanma Barranquero <address@hidden>
Commit: Juanma Barranquero <address@hidden>

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

diff --git a/etc/NEWS b/etc/NEWS
index d3331da..662156d 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -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
 
diff --git a/lisp/window.el b/lisp/window.el
index c8a5816..c750ea7 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)



reply via email to

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