[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 64b80b4 1/2: Minor fixes for switching to previous
From: |
Martin Rudalics |
Subject: |
[Emacs-diffs] master 64b80b4 1/2: Minor fixes for switching to previous and next buffers (Bug#37514) |
Date: |
Fri, 11 Oct 2019 03:28:57 -0400 (EDT) |
branch: master
commit 64b80b42c6ac0779f4ce1152ab3e2546826eb017
Author: Martin Rudalics <address@hidden>
Commit: Martin Rudalics <address@hidden>
Minor fixes for switching to previous and next buffers (Bug#37514)
* lisp/window.el (switch-to-prev-buffer)
(switch-to-next-buffer): In doc-strings add links to
'prev-buffer' and 'next-buffer'.
(next-buffer, previous-buffer): Signal 'user-error' instead of
'error'. In doc-strings link to 'switch-to-prev-buffer' and
'switch-to-next-buffer'.
---
lisp/window.el | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/lisp/window.el b/lisp/window.el
index fafb6f9..d795520 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -4422,7 +4422,9 @@ shall not be switched to in future invocations of this
command.
As a special case, if BURY-OR-KILL equals `append', this means to
move the buffer to the end of WINDOW's previous buffers list so a
future invocation of `switch-to-prev-buffer' less likely switches
-to it."
+to it.
+
+This function is called by `prev-buffer'."
(interactive)
(let* ((window (window-normalize-window window t))
(frame (window-frame window))
@@ -4545,7 +4547,7 @@ to it."
"In WINDOW switch to next buffer.
WINDOW must be a live window and defaults to the selected one.
Return the buffer switched to, nil if no suitable buffer could be
-found."
+found. This function is called by `next-buffer'."
(interactive)
(let* ((window (window-normalize-window window t))
(frame (window-frame window))
@@ -4746,24 +4748,28 @@ displayed there."
(switch-to-buffer (last-buffer)))
(defun next-buffer ()
- "In selected window switch to next buffer."
+ "In selected window switch to next buffer.
+Call `switch-to-next-buffer' unless the selected window is the
+minibuffer window or is dedicated to its buffer."
(interactive)
(cond
((window-minibuffer-p)
- (error "Cannot switch buffers in minibuffer window"))
+ (user-error "Cannot switch buffers in minibuffer window"))
((eq (window-dedicated-p) t)
- (error "Window is strongly dedicated to its buffer"))
+ (user-error "Window is strongly dedicated to its buffer"))
(t
(switch-to-next-buffer))))
(defun previous-buffer ()
- "In selected window switch to previous buffer."
+ "In selected window switch to previous buffer.
+Call `switch-to-prev-buffer' unless the selected window is the
+minibuffer window or is dedicated to its buffer."
(interactive)
(cond
((window-minibuffer-p)
- (error "Cannot switch buffers in minibuffer window"))
+ (user-error "Cannot switch buffers in minibuffer window"))
((eq (window-dedicated-p) t)
- (error "Window is strongly dedicated to its buffer"))
+ (user-error "Window is strongly dedicated to its buffer"))
(t
(switch-to-prev-buffer))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 64b80b4 1/2: Minor fixes for switching to previous and next buffers (Bug#37514),
Martin Rudalics <=