Fix some ‘window-normalize-’ prefixed functions (Bug#28947)
* lisp/window.el (window-normalize-buffer): Fix case where BUFFER-OR-NAME is a string specifying a dead buffer. Fix doc-string (Bug#28947). (window-normalize-frame, window-normalize-window): Fix doc-strings (Bug#28947).
This commit is contained in:
parent
6360611457
commit
46cdc01daa
1 changed files with 31 additions and 15 deletions
|
@ -320,22 +320,34 @@ WINDOW can be any window."
|
||||||
|
|
||||||
(defun window-normalize-buffer (buffer-or-name)
|
(defun window-normalize-buffer (buffer-or-name)
|
||||||
"Return buffer specified by BUFFER-OR-NAME.
|
"Return buffer specified by BUFFER-OR-NAME.
|
||||||
BUFFER-OR-NAME must be either a buffer or a string naming a live
|
BUFFER-OR-NAME must be a live buffer, a string naming a live
|
||||||
buffer and defaults to the current buffer."
|
buffer or nil which means to return the current buffer.
|
||||||
(cond
|
|
||||||
((not buffer-or-name)
|
This function is commonly used to process the (usually optional)
|
||||||
(current-buffer))
|
\"BUFFER-OR-NAME\" argument of window related functions where nil
|
||||||
((bufferp buffer-or-name)
|
stands for the current buffer."
|
||||||
(if (buffer-live-p buffer-or-name)
|
(let ((buffer
|
||||||
buffer-or-name
|
(cond
|
||||||
(error "Buffer %s is not a live buffer" buffer-or-name)))
|
((not buffer-or-name)
|
||||||
((get-buffer buffer-or-name))
|
(current-buffer))
|
||||||
(t
|
((bufferp buffer-or-name)
|
||||||
(error "No such buffer %s" buffer-or-name))))
|
buffer-or-name)
|
||||||
|
((stringp buffer-or-name)
|
||||||
|
(get-buffer buffer-or-name))
|
||||||
|
(t
|
||||||
|
(error "No such buffer %s" buffer-or-name)))))
|
||||||
|
(if (buffer-live-p buffer)
|
||||||
|
buffer
|
||||||
|
(error "No such live buffer %s" buffer-or-name))))
|
||||||
|
|
||||||
(defun window-normalize-frame (frame)
|
(defun window-normalize-frame (frame)
|
||||||
"Return frame specified by FRAME.
|
"Return frame specified by FRAME.
|
||||||
FRAME must be a live frame and defaults to the selected frame."
|
FRAME must be a live frame or nil which means to return the
|
||||||
|
selected frame.
|
||||||
|
|
||||||
|
This function is commonly used to process the (usually optional)
|
||||||
|
\"FRAME\" argument of window and frame related functions where
|
||||||
|
nil stands for the selected frame."
|
||||||
(if frame
|
(if frame
|
||||||
(if (frame-live-p frame)
|
(if (frame-live-p frame)
|
||||||
frame
|
frame
|
||||||
|
@ -343,11 +355,15 @@ FRAME must be a live frame and defaults to the selected frame."
|
||||||
(selected-frame)))
|
(selected-frame)))
|
||||||
|
|
||||||
(defun window-normalize-window (window &optional live-only)
|
(defun window-normalize-window (window &optional live-only)
|
||||||
"Return the window specified by WINDOW.
|
"Return window specified by WINDOW.
|
||||||
If WINDOW is nil, return the selected window. Otherwise, if
|
If WINDOW is nil, return the selected window. Otherwise, if
|
||||||
WINDOW is a live or an internal window, return WINDOW; if
|
WINDOW is a live or an internal window, return WINDOW; if
|
||||||
LIVE-ONLY is non-nil, return WINDOW for a live window only.
|
LIVE-ONLY is non-nil, return WINDOW for a live window only.
|
||||||
Otherwise, signal an error."
|
Otherwise, signal an error.
|
||||||
|
|
||||||
|
This function is commonly used to process the (usually optional)
|
||||||
|
\"WINDOW\" argument of window related functions where nil stands
|
||||||
|
for the selected window."
|
||||||
(cond
|
(cond
|
||||||
((null window)
|
((null window)
|
||||||
(selected-window))
|
(selected-window))
|
||||||
|
|
Loading…
Add table
Reference in a new issue