Function: image-mode-winprops
image-mode-winprops is a byte-compiled function defined in
image-mode.el.gz.
Signature
(image-mode-winprops &optional WINDOW CLEANUP)
Documentation
Return winprops of WINDOW.
A winprops object has the shape (WINDOW . ALIST).
WINDOW defaults to selected-window if it displays the current buffer, and
otherwise it defaults to t, used for times when the buffer is not displayed.
Source Code
;; Defined in /usr/src/emacs/lisp/image-mode.el.gz
(defun image-mode-winprops (&optional window cleanup)
"Return winprops of WINDOW.
A winprops object has the shape (WINDOW . ALIST).
WINDOW defaults to `selected-window' if it displays the current buffer, and
otherwise it defaults to t, used for times when the buffer is not displayed."
(cond ((null window)
(setq window
(if (eq (current-buffer) (window-buffer)) (selected-window) t)))
((eq window t))
((not (windowp window))
(error "Not a window: %s" window)))
(when cleanup
(setq image-mode-winprops-alist
(delq nil (mapcar (lambda (winprop)
(let ((w (car-safe winprop)))
(if (or (not (windowp w)) (window-live-p w))
winprop)))
image-mode-winprops-alist))))
(let ((winprops (assq window image-mode-winprops-alist)))
;; For new windows, set defaults from the latest.
(if winprops
;; Move window to front.
(setq image-mode-winprops-alist
(cons winprops (delq winprops image-mode-winprops-alist)))
(setq winprops (cons window
(copy-alist (cdar image-mode-winprops-alist))))
;; Add winprops before running the hook, to avoid inf-loops if the hook
;; triggers window-configuration-change-hook.
(setq image-mode-winprops-alist
(cons winprops image-mode-winprops-alist))
(run-hook-with-args 'image-mode-new-window-functions winprops))
winprops))