[Top][All Lists]

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

Re: A unified project root interface

From: Pascal J. Bourguignon
Subject: Re: A unified project root interface
Date: Sat, 23 Mar 2013 21:51:34 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Dmitry Gutov <address@hidden> writes:

> Jorgen Schaefer <address@hidden> writes:
>> On Sat, 23 Mar 2013 13:10:20 -0400
>> "Eric M. Ludlam" <address@hidden> wrote:
>>> If this project concept is created as a simple thing, that's fine,
>>> but EDE won't be able to use it, though it could contribute.   If
>>> that's the overall story where simple uses need the simple project,
>>> and EDE is used when you need more, that seems like a fine
>>> compromise, but it won't simplify the plethora of project projects.
>> Let's say we create two primary API functions
>> - (project-root)
>> - (project-set-root DIR)
> I think it would work better if insted of the second function, we'll
> have a variable `project-root-functions', along the lines of
> `completion-at-point-functions'.

Not instead, but as hooks:

(defvar *current-project-dir* nil)
(defvar *resign-current-project-hook* '())
(defvar *become-current-project-hook* '())

(defun project-set-root (dir)
   (when *current-project-dir*
     (run-hook-with-args *resign-current-project-hook* *current-project-dir*))
   (do-default-project-set-root dir) 
   (assert (eq *current-project-dir* dir))
   (run-hook-with-args *become-current-project-hook* *current-project-dir*))

> It will contain some simple function by default (that will look for
> .dir-locals.el, for example), and EDE, when loaded, can push its own
> function on top.

Indeed, (do-default-project-set-root dir) could just set 
*current-project-dir*, and allt the rest could be done in

__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.

reply via email to

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