Function: window-indirect-buffer-p

window-indirect-buffer-p is a byte-compiled function defined in window.el.gz.

Signature

(window-indirect-buffer-p &optional WINDOW BUFFER-OR-NAME)

Documentation

Return non-nil if specified WINDOW is indirectly related to BUFFER-OR-NAME.

WINDOW must be a live window and defaults to the selected window. BUFFER-OR-NAME may be a buffer or the name of an existing buffer and defaults to the current buffer.

WINODW is indirectly related to BUFFER-OR-NAME if one of the following conditions hold:

- BUFFER-OR-NAME specifies an indirect buffer and WINDOW's buffer is its
  base buffer.

- WINDOW's buffer is an indirect buffer whose base buffer is the buffer
  specified by BUFFER-OR-NAME.

- Both, WINDOW's buffer and the buffer specified by BUFFER-OR-NAME, are
  indirect buffer's sharing the same base buffer.

Return nil if none of the above holds.

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun window-indirect-buffer-p (&optional window buffer-or-name)
  "Return non-nil if specified WINDOW is indirectly related to BUFFER-OR-NAME.
WINDOW must be a live window and defaults to the selected window.
BUFFER-OR-NAME may be a buffer or the name of an existing buffer and
defaults to the current buffer.

WINODW is indirectly related to BUFFER-OR-NAME if one of the following
conditions hold:

- BUFFER-OR-NAME specifies an indirect buffer and WINDOW's buffer is its
  base buffer.

- WINDOW's buffer is an indirect buffer whose base buffer is the buffer
  specified by BUFFER-OR-NAME.

- Both, WINDOW's buffer and the buffer specified by BUFFER-OR-NAME, are
  indirect buffer's sharing the same base buffer.

Return nil if none of the above holds."
  (let* ((window (window-normalize-window window t))
	 (window-buffer (window-buffer window))
	 (window-base-buffer (buffer-base-buffer window-buffer))
	 (buffer (window-normalize-buffer buffer-or-name))
	 (buffer-base-buffer (buffer-base-buffer buffer)))
    (or (eq buffer-base-buffer window-buffer)
	(eq window-base-buffer buffer)
	(and buffer-base-buffer
	     (eq buffer-base-buffer window-base-buffer)))))