From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?Llu=C3=ADs?= Newsgroups: gmane.emacs.devel Subject: Re: A unified project root interface Date: Mon, 11 Mar 2013 19:57:22 +0100 Message-ID: <87hakh2299.fsf@fimbulvetr.bsc.es> References: <20130309174419.6e1cadb4@forcix.kollektiv-hamburg.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1363028261 16469 80.91.229.3 (11 Mar 2013 18:57:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Mar 2013 18:57:41 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 11 19:58:04 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UF7v7-0006FF-AL for ged-emacs-devel@m.gmane.org; Mon, 11 Mar 2013 19:58:01 +0100 Original-Received: from localhost ([::1]:47977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UF7ul-0000UK-7L for ged-emacs-devel@m.gmane.org; Mon, 11 Mar 2013 14:57:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UF7ua-0000UA-29 for emacs-devel@gnu.org; Mon, 11 Mar 2013 14:57:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UF7uY-0001Av-7b for emacs-devel@gnu.org; Mon, 11 Mar 2013 14:57:28 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:59941) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UF7uX-0001Ah-U3 for emacs-devel@gnu.org; Mon, 11 Mar 2013 14:57:26 -0400 Original-Received: from mailout-de.gmx.net ([10.1.76.16]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0LaZKz-1Uc3Ct0qFz-00mIVi for ; Mon, 11 Mar 2013 19:57:24 +0100 Original-Received: (qmail invoked by alias); 11 Mar 2013 18:57:23 -0000 Original-Received: from unknown (EHLO localhost) [84.88.51.85] by mail.gmx.net (mp016) with SMTP; 11 Mar 2013 19:57:23 +0100 X-Authenticated: #12333383 X-Provags-ID: V01U2FsdGVkX19oWNx6TiZoTMQqF4YwzS+z1Vm9xoVxaYAzrBUa7q ucCxKGfdCXXv2r Mail-Followup-To: emacs-devel@gnu.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.15.15 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:157740 Archived-At: Stefan Monnier writes: >> 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) ) to recognize other "tell tale > sign" of a project root (e.g. a Tupfile). CEDET provides this in two ways (as part of the EDE subsystem): * If a Project.ede file exists, that's the root (similar to .dir-locals.el in this context) * If signs of a "project-like" structure exist (e.g., (auto)makefiles, scons, java, etc), uses system-specific knowledge to automatically detect the project root. I'm commenting this because, first, managing projects is the purpose of EDE (although it tries to do more than just identifying their root) and it's integrated in Emacs; and second, because the auto-detection could help in making the process simpler and, in the best case, auto-magical. Lluis -- "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth