Function: projectile-session--sanitize-window-state

projectile-session--sanitize-window-state is a byte-compiled function defined in projectile.el.

Signature

(projectile-session--sanitize-window-state STATE)

Documentation

Return a copy of window STATE with missing buffers replaced.

Any window referencing a buffer that isn't live is pointed at a placeholder buffer instead, so window-state-put can't error out. This is the Emacs 28 substitute for window-restore-killed-buffer-windows
(added in Emacs 30).

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile-session--sanitize-window-state (state)
  "Return a copy of window STATE with missing buffers replaced.
Any window referencing a buffer that isn't live is pointed at a
placeholder buffer instead, so `window-state-put' can't error out.  This
is the Emacs 28 substitute for `window-restore-killed-buffer-windows'
\(added in Emacs 30)."
  (cond
   ((and (consp state)
         (eq (car state) 'buffer)
         (stringp (cadr state))
         (not (get-buffer (cadr state))))
    (cons 'buffer
          (cons (buffer-name (projectile-session--placeholder-buffer))
                (cddr state))))
   ((consp state)
    (cons (projectile-session--sanitize-window-state (car state))
          (projectile-session--sanitize-window-state (cdr state))))
   (t state)))