emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: project.el semantics


From: Dmitry Gutov
Subject: Re: project.el semantics
Date: Sun, 8 Nov 2015 22:11:31 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Thunderbird/42.0

On 11/08/2015 03:07 PM, Dmitry Gutov wrote:
On 11/08/2015 09:11 AM, Stephen Leake wrote:
emacs-lisp-mode makes project-library-roots-function buffer-local,
which makes it language-specific. That's an argument for overriding the
default implementation of project-library-roots to do something more
useful. Which is what `project-library-roots ((project (head vc))' does,
for example. Which means that the behavior of projects in an elisp file
that happens to be in a vc directory is different from one that is not.

`project-library-roots ((project (head vc))' knows nothing of library
roots, however, aside from the local variable that's supposed to be set
by the user.
...
The root cause of this problem is trying to infer a project in an elisp
file. This makes sense in general, because an elisp file implies the use
of load-path, which is the main part of defining a project. A better way
is to provide a project-find-function that returns an elisp-project
object in elisp buffers;

That implies having to create a separate project implementation for
every language, making vc-project utterly useless.

I can also propose another change: if project-library-roots-function, in your opinion, complicates the project API unnecessarily, we can fold it into project-vc-library-roots, for now (and make that variable a hook).

In practice, other project implementation would still be able to use it, and if we see that happen, we can promote it formally to a variable independent from vc-project (with a rename). We'd have to figure out which of the roots to visit to read .dir-locals.el, though.

In this scenario, project-vc-library-roots would be allowed to contain both strings and functions, and the functions will normally be put into the global value.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]