Subject: bug#76587: 31.0.50; [FR] project.el should have a way to exclude certain projects from being saved

From: Visuwesh <[email-masked]>
Date: Fri, 28 Feb 2025 09:18:24 +0530

[வெள்ளி பிப்ரவரி 28, 2025] Dmitry Gutov wrote:

> On 27/02/2025 19:35, Juri Linkov wrote:
>> OTOH, since project--remember-dir is an internal function
>> we could add a new argument 'project' to it.
>
> That shouldn't be a problem indeed.
>
> OTOH, the project object is not very easily available in some callers
> of project--remember-dir, so the change might require some
> reorganization.

I see one caller of project--remember-dir, project-switch-project, that
does not have the project object handy.  Maybe we could do

    (project--remember-dir dir nil (project-current nil dir))

in place of the current call in project-switch-project?  Or should we do
something like

    (defun project--remember-dir (root &optional no-write project)
      ...
      (setq project (or project (project-current nil dir)))
      ...)

instead?

[வெள்ளி பிப்ரவரி 28, 2025] Dmitry Gutov wrote:

> But I'm guessing the problem is that there is no meaningful "root" for
> those files either, and so showing those projects in the project
> history is not that easy, even if one wanted (i.e. you can't go from
> the root to the file list, only in the reverse direction).

Yes, there's no exact definition of a project root here.  This breaks
some project commands (like project-shell).  Even project-current seems
to rely on the notion of a root which I essentially ignore in my backend
function (I only check if the current file-visiting buffer's directory
is a parent of project-current's directory).