Subject: bug#41741: [PATCH] Save project list as lisp data

From: Dmitry Gutov <[email-masked]>
Date: Sun, 7 Jun 2020 01:59:10 +0300

Hi Simen,

On 06.06.2020 19:40, Simen Heggestøyl wrote:
> I'm attaching a suggested patch for changing project.el's project list
> format from a line based one to proper Lisp data as discussed in the
> "New feature in project.el: Remembering the previously used projects"
> thread on emacs-devel.

Some comments below.

> No metadata is added at this point, but it makes it extensible for the
> future.

I'm not sure we'd really be able to store metadata in it. The list is 
more or less transient: the entries are added automatically, and removed 
automatically as well. If someone needs to know something about a 
project, it's better to leave that to an overridable method, and maybe 
add a project-vc- variable (if that value needs to be user-customizable).

For that reason, we should probably opt for storing directories only.

> -  "Initialize `project--list' from the project list file."
> +  "Initialize `project--list' from the file `project-list-file'."

I think the previous string was okay.

> -          (when (file-exists-p filename)
> +          (when (file-readable-p filename)

What's the difference? File exists, but belongs to another account? I'm 
not sure we'd want to silently fail in that case (kinda puzzling 
behavior), and writing to the file is likely to fail later too.

> +              (car (read-from-string (buffer-string))))))))

AKA:

      (goto-char (point-min))
      (read (current-buffer))

Though the practical difference will be tiny.