aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2016-04-27 19:21:41 -0400
committerGlenn Morris2016-04-27 19:21:41 -0400
commit5c3534ffdcce41b1aab7bd158cf07224446caa9d (patch)
treefc4d4dbc7b3c056085075e00265e4e8d7584ec7d
parent734fb3ac6c3e5708ed05b6c5b1d8af92838ee3f5 (diff)
downloademacs-5c3534ffdcce41b1aab7bd158cf07224446caa9d.tar.gz
emacs-5c3534ffdcce41b1aab7bd158cf07224446caa9d.zip
* 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).
-rw-r--r--lisp/window.el37
1 files changed, 19 insertions, 18 deletions
diff --git a/lisp/window.el b/lisp/window.el
index 0d7dbd844e7..d9ac0e6d240 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -8520,24 +8520,25 @@ A window is associated with a process if that window is
8520displaying that processes's buffer." 8520displaying that processes's buffer."
8521 (let ((processes (process-list)) 8521 (let ((processes (process-list))
8522 (process-windows nil)) 8522 (process-windows nil))
8523 (walk-windows 8523 (if processes
8524 (lambda (window) 8524 (walk-windows
8525 (let ((buffer (window-buffer window)) 8525 (lambda (window)
8526 (iter processes)) 8526 (let ((buffer (window-buffer window))
8527 (while (let ((process (car iter))) 8527 (iter processes))
8528 (if (and (process-live-p process) 8528 (while (let ((process (car iter)))
8529 (eq buffer (process-buffer process))) 8529 (if (and (process-live-p process)
8530 (let ((procwin (assq process process-windows))) 8530 (eq buffer (process-buffer process)))
8531 ;; Add this window to the list of windows 8531 (let ((procwin (assq process process-windows)))
8532 ;; displaying process. 8532 ;; Add this window to the list of windows
8533 (if procwin 8533 ;; displaying process.
8534 (push window (cdr procwin)) 8534 (if procwin
8535 (push (list process window) process-windows)) 8535 (push window (cdr procwin))
8536 ;; We found our process for this window, so 8536 (push (list process window) process-windows))
8537 ;; stop iterating over the process list. 8537 ;; We found our process for this window, so
8538 nil) 8538 ;; stop iterating over the process list.
8539 (setf iter (cdr iter))))))) 8539 nil)
8540 1 t) 8540 (setf iter (cdr iter)))))))
8541 1 t))
8541 process-windows)) 8542 process-windows))
8542 8543
8543(defun window--adjust-process-windows () 8544(defun window--adjust-process-windows ()