Function: project--read-project-list

project--read-project-list is a byte-compiled function defined in project.el.gz.

Signature

(project--read-project-list)

Documentation

Initialize project--list using contents of project-list-file.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/project.el.gz
(defun project--read-project-list ()
  "Initialize `project--list' using contents of `project-list-file'."
  (let ((filename project-list-file))
    (setq project--list
          (when (file-exists-p filename)
            (with-temp-buffer
              (insert-file-contents filename)
              (mapcar
               (lambda (elem)
                 (let ((name (car elem)))
                   (list (if (file-remote-p name) name
                           (file-name-as-directory
                            (abbreviate-file-name name))))))
               (condition-case nil
                   (read (current-buffer))
                 (end-of-file
                  (warn "Failed to read the projects list file due to unexpected EOF")))))))
    (unless (seq-every-p
             (lambda (elt) (stringp (car-safe elt)))
             project--list)
      (warn "Contents of %s are in wrong format, resetting"
            project-list-file)
      (setq project--list nil))))