Function: projectile-session--save-all-tabs
projectile-session--save-all-tabs is a byte-compiled function defined
in projectile.el.
Signature
(projectile-session--save-all-tabs)
Documentation
Save the session of every open project tab, selecting each in turn.
Each project tab is selected so its own window layout is what gets saved,
then the originally-selected tab is restored. Tabs are re-resolved by
root on each iteration rather than by a cons captured up front, because
tab-bar-select-tab rebuilds cons cells as it switches tabs (a stale cons
would save the wrong layout under a project's root). The per-tab body is
guarded so a tab that can't be selected or saved (its root gone, say)
neither abandons the remaining projects nor lets an error escape (this
also matters on kill-emacs-hook). Return the number of tabs whose
session was actually written.
Source Code
;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile-session--save-all-tabs ()
"Save the session of every open project tab, selecting each in turn.
Each project tab is selected so its own window layout is what gets saved,
then the originally-selected tab is restored. Tabs are re-resolved by
root on each iteration rather than by a cons captured up front, because
`tab-bar-select-tab' rebuilds cons cells as it switches tabs (a stale cons
would save the wrong layout under a project's root). The per-tab body is
guarded so a tab that can't be selected or saved (its root gone, say)
neither abandons the remaining projects nor lets an error escape (this
also matters on `kill-emacs-hook'). Return the number of tabs whose
session was actually written."
(let ((origin (projectile-session--current-tab-index))
(roots (delq nil (mapcar #'projectile-session--tab-root
(projectile-session--project-tabs))))
(saved 0))
(dolist (root roots)
(ignore-errors
(when (and (projectile-session--select-tab-by-root root)
(projectile-session-save root))
(setq saved (1+ saved)))))
(ignore-errors (tab-bar-select-tab origin))
saved))