* lisp/window.el (window--process-window-list): No-op if no processes.

This avoids an issue with save-selected-window (from walk-windows)
failing if frame.el is not loaded, eg if the terminal is resized
during startup of a -nw CANNOT_DUMP build.  (Bug#23369).
This commit is contained in:
Glenn Morris 2016-04-27 19:21:41 -04:00
parent 734fb3ac6c
commit 5c3534ffdc

View file

@ -8520,24 +8520,25 @@ A window is associated with a process if that window is
displaying that processes's buffer." displaying that processes's buffer."
(let ((processes (process-list)) (let ((processes (process-list))
(process-windows nil)) (process-windows nil))
(walk-windows (if processes
(lambda (window) (walk-windows
(let ((buffer (window-buffer window)) (lambda (window)
(iter processes)) (let ((buffer (window-buffer window))
(while (let ((process (car iter))) (iter processes))
(if (and (process-live-p process) (while (let ((process (car iter)))
(eq buffer (process-buffer process))) (if (and (process-live-p process)
(let ((procwin (assq process process-windows))) (eq buffer (process-buffer process)))
;; Add this window to the list of windows (let ((procwin (assq process process-windows)))
;; displaying process. ;; Add this window to the list of windows
(if procwin ;; displaying process.
(push window (cdr procwin)) (if procwin
(push (list process window) process-windows)) (push window (cdr procwin))
;; We found our process for this window, so (push (list process window) process-windows))
;; stop iterating over the process list. ;; We found our process for this window, so
nil) ;; stop iterating over the process list.
(setf iter (cdr iter))))))) nil)
1 t) (setf iter (cdr iter)))))))
1 t))
process-windows)) process-windows))
(defun window--adjust-process-windows () (defun window--adjust-process-windows ()