diff options
author | Martin Rudalics <rudalics@gmx.at> | 2019-10-11 09:26:41 +0200 |
---|---|---|
committer | Martin Rudalics <rudalics@gmx.at> | 2019-10-11 09:26:41 +0200 |
commit | 64b80b42c6ac0779f4ce1152ab3e2546826eb017 (patch) | |
tree | bfed3fc011106e08d95381a605fddb0f189d48c1 /lisp/window.el | |
parent | 49614ec8002c7b424a4d794b5e7491f0959280fd (diff) | |
download | emacs-64b80b42c6ac0779f4ce1152ab3e2546826eb017.tar.gz |
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'.
Diffstat (limited to 'lisp/window.el')
-rw-r--r-- | lisp/window.el | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lisp/window.el b/lisp/window.el index fafb6f90ed5..d7955209cd4 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)))) |