emacs-devel
[Top][All Lists]
Advanced

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

Re: A unified project root interface


From: Stefan Monnier
Subject: Re: A unified project root interface
Date: Sun, 10 Mar 2013 00:38:12 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> So this is my somewhat verbose request to say "yes, let's do this" and
> pick a library to provide the functionality.

Agreed.  There are already different such things distributed with Emacs:
.dir-locals.el is one of them.  CEDET has its own notion.
As mentioned .dir-local.el often acts as a project root, but it can also
appear in sub-directories of a project, so it's not sufficient.
It should at least be augmented so that some .dir-locals.el can be
flagged as "non-root".

If the only need is to figure out the "root directory of the project",
then maybe a simple solution is:

   (defvar project-root-predicate
       (lambda () (file-exists-p ".dir-locals.el")))
   (defun project-root ()
     (locate-dominating-file default-directory project-root-predicate))

where packages can (add-function :until-before (default-value
project-root-predicate) <mypredicate>) to recognize other "tell tale
sign" of a project root (e.g. a Tupfile).

   
        Stefan



reply via email to

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