Subject: Re: bug#66993: [PATCH] project.el: avoid asking user about project-list-file lock

From: Eli Zaretskii <[email-masked]>
Date: Wed, 08 Nov 2023 18:32:35 +0200

> From: Spencer Baugh <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  [email-masked]
> Date: Wed, 08 Nov 2023 10:36:12 -0500
> 
> Alternatively, I suppose if we had a periodic timer that writes the
> file, that timer could also do the somewhat useful maintenance work of
> calling project-forget-zombie-projects.  Or maybe we could just call
> that from kill-emacs-hook too?  Just a thought.

There's midnight.el for that kind of jobs.

> Separately: Currently, even without any locking issues, if there are
> multiple Emacsen then project-list-file just contains the project--list
> of the last one to write.  So they're constantly clobbering each others'
> added and removed projects.  If we do the writes more rarely, then we
> could try to read project-list-file first and add or remove the projects
> that were added or removed during the life of this Emacs instance,
> instead of just blindly writing out project--list.  Then if there are
> multiple Emacsen around, their changes to project--list won't clobber
> each other, they'll just be cleanly merged.  Does that sound reasonable?

I thought these writes were already just adding projects, not
clobbering the list.