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

From: Dmitry Gutov <[email-masked]>
Date: Wed, 8 Nov 2023 15:58:25 +0200

On 07/11/2023 23:28, Spencer Baugh wrote:
> - project-mode-line will call this on mode-line update
> 
> - My own private project-watch will call this based on file-notify
>    events.
> 
> If a user has multiple Emacs instances open using one or more of these
> features, it's fairly easy for both of the Emacs instances to see a
> new project at the same time.  In that case, they'll both call
> project--write-project-list at the same time, which will clash and run
> ask-user-about-lock.  This will happen frequently if the user is often
> looking at new projects.

Hmmm. What happens if we just show two buffers from different projects 
in the same Emacs instance? Do the mode-line refreshes trigger the 
changes in the list of remembered projects and subsequent writes to disk 
(e.g. alternating the "current" project between these two, potentially 
many times a second)?

If so, we'll need a way to inhibit these updates, at least from the 
mode-line formatter.