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: Jorgen Schaefer
Subject: Re: A unified project root interface
Date: Wed, 20 Mar 2013 18:49:26 +0100

On Wed, 20 Mar 2013 17:34:09 +0100
David Engster <address@hidden> wrote:

> Instead, I'd vote for a very simple approach which at least takes EDE
> projects into account, among other things. Roughly like this:
> 
> (defun project-root-ede (file)
>   (when (and (featurep' ede)
>              (with-current-buffer file
>                ede-object-root-project))
>     ... return EDE root ... ))
> 
> (defun project-root-vc (file)
>   (when (vc-file-registered file)
>     ... return root from VC ... ))
> 
> (defvar project-root-detect-functions 
>           '(project-root-ede project-root-vc))
> 
> (defun project-root ()
>    (run-hook-with-args-until-success
>        project-root-detect-functions
>        (buffer-file-name (current-buffer))))

This sounds like an excellent idea. If you guarantee the hook to be run
in the file's buffer, you do not even need the argument.

Happy to write the code etc. if this is deemed the way to go :-)

Regards,
        -- Jorgen



reply via email to

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