Function: projectile-session--read-file

projectile-session--read-file is a byte-compiled function defined in projectile.el.

Signature

(projectile-session--read-file FILE)

Documentation

Read and return the session data stored in FILE, or nil.

Data that isn't a well-formed session plist of the current version is ignored, so an unreadable or stale file is skipped rather than erroring. A real session file written by an incompatible format version is skipped with a message, so the user learns why nothing was restored.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile-session--read-file (file)
  "Read and return the session data stored in FILE, or nil.
Data that isn't a well-formed session plist of the current version is
ignored, so an unreadable or stale file is skipped rather than erroring.
A real session file written by an incompatible format version is skipped
with a message, so the user learns why nothing was restored."
  (let ((data (projectile-unserialize file)))
    (cond
     ((and (consp data)
           (equal (plist-get data :projectile-session-version)
                  projectile-session--format-version)
           data))
     ((and (consp data) (plist-member data :projectile-session-version))
      ;; `projectile-session-restore-all' can walk a directory full of these
      ;; at startup, so this is exactly the kind of thing that shouldn't
      ;; announce itself once per file.
      (projectile--message "Ignoring session file %s: format version %s (expected %s)"
                           file (plist-get data :projectile-session-version)
                           projectile-session--format-version)
      nil))))