emacs-devel
[Top][All Lists]
Advanced

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

Re: cl-defgeneric vs random funcall in project.el


From: Stephen Leake
Subject: Re: cl-defgeneric vs random funcall in project.el
Date: Sat, 01 Aug 2015 14:08:12 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt)

Dmitry Gutov <address@hidden> writes:

> On 08/01/2015 05:20 PM, Stephen Leake wrote:
>
>>> Not at all, they need variables. You can easily set the variables from
>>> .dir-locals.el, and any Emacs-wielding team member on the same project
>>> will use them automatically.
>>
>> Ok, I agree they could be variables.
>
> Thinking about this more, buffer-local variables have their own
> complications:
>
> - You need an buffer open, inside the given directory tree, to get
> their values. The project-find-functions API just passes in DIR to get
> a project instance. There might not even be a buffer open in that
> directory.
>
> - If a user tries to set their values in init.el, that won't end well.
>
>> The point is the name should be declared in project.el, so all backends
>> use the same name.
>
> You can't reuse the variables. There might be several project
> instances open at the same time.

Yes; I assumed the variables would be read once by some project-create
function.

But that's one reason why I proposed functions in the first place.

> The best bet seems to be to store them in the project file, which a
> project backend reads and saves to the project instance's slots.

Yes.

> Not sure what this means for the VC project backend. Git allows
> storing arbitrary key-value pairs in .git/config via 'git config', but
> that isn't true for every VCS. Bazaar doesn't, AFAICT.

I would not mess with .git/config; that's not an Emacs project file, nor
is it intended to be one. It might be useful to read some info from it,
but there must be a separate Emacs project file.

-- 
-- Stephe



reply via email to

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