From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Fabian Ezequiel Gallina Newsgroups: gmane.emacs.devel Subject: Re: A unified project root interface Date: Sat, 9 Mar 2013 14:12:05 -0300 Message-ID: References: <20130309174419.6e1cadb4@forcix.kollektiv-hamburg.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1362849137 9262 80.91.229.3 (9 Mar 2013 17:12:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Mar 2013 17:12:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Jorgen Schaefer Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 09 18:12:41 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 1UENK4-0006zQ-LP for ged-emacs-devel@m.gmane.org; Sat, 09 Mar 2013 18:12:40 +0100 Original-Received: from localhost ([::1]:34639 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UENJi-0005Tg-Iw for ged-emacs-devel@m.gmane.org; Sat, 09 Mar 2013 12:12:18 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UENJb-0005Si-Ct for emacs-devel@gnu.org; Sat, 09 Mar 2013 12:12:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UENJW-0007sj-3W for emacs-devel@gnu.org; Sat, 09 Mar 2013 12:12:11 -0500 Original-Received: from mail-ia0-x233.google.com ([2607:f8b0:4001:c02::233]:51017) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UENJV-0007se-V5 for emacs-devel@gnu.org; Sat, 09 Mar 2013 12:12:06 -0500 Original-Received: by mail-ia0-f179.google.com with SMTP id x24so2390248iak.38 for ; Sat, 09 Mar 2013 09:12:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=hMNNrIzHlRjqbZTCO3DnGhYbnyL9O7+To1WUkJk25MI=; b=Dj/ochNFfFL67J/TdLj6GKRZk3gKjUSP4DY6WzOLE5PUlR7+FpjKPjaBny1vFu2c86 SixEAfgdPL0yQ8weTaRYMaUsKSnR1YUHIX84dDu6A6IIN349zcmdA+/+z0Vf1QrOYVvh xI66YY1O+kXXtqAWTOtR9mlkZMs/AOGIh3Tomf+fey3L2tgmtE8AguDtY5xs3iLEQVy2 LlcwVk+YPLkZudz74q73IYcP2QaUdD0+hMTdGhsf/OJ5TUSQRQAZ/6+AKHHtDb/nnsgk RSEXvpBF9C1LQi8pLjWNTwDObCoFfaUWJj0KxPg2k2/6iqIYDYYMAruo72vY1d5k5cBX WKaQ== X-Received: by 10.50.185.234 with SMTP id ff10mr2984049igc.25.1362849125125; Sat, 09 Mar 2013 09:12:05 -0800 (PST) Original-Received: by 10.64.42.71 with HTTP; Sat, 9 Mar 2013 09:12:05 -0800 (PST) In-Reply-To: <20130309174419.6e1cadb4@forcix.kollektiv-hamburg.de> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c02::233 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:157671 Archived-At: 2013/3/9 Jorgen Schaefer : > > It would be really useful if there was a single standard way to define > the project root, so that extensions can just use that standard way > without each and every one of them writing the same code over and over > again. Sadly, as the code is not exactly difficult and so many projects > have already used their own way, it's highly unlikely that a random > third-party library would simply "emerge" as the standard way of doing > things. Which makes me believe the only way to solve this is via a bit > of a top-down decision to include a library in Emacs and declare it as > "the default". > There's a standard way of defining variable values for files inside a parent folder (read project). This mechanism is the Directory Local variables [M-: (info "(emacs)Directory Variables")]. And it works, and works good, in fact python.el makes use of this a lot and is able to even to set the virtualenv for all your project files (without messing with external others) thanks to it[0]. Normally I would consider the .dir-locals.el file location as the project root, but then perhaps the user needs to override some values in a sub-folder. So in that case I think it might be a good idea to introduce an additional standard name for .dir-locals.el files that are ought to be used only at the project root. I propose the name of .project-locals.el. With this detecting if a file belongs to a project and what's the project root is as easy as to find the .project-locals.el. > > So this is my somewhat verbose request to say "yes, let's do this" and > pick a library to provide the functionality. The library itself doesn't > have to be big at all, in theory a single variable `project-root' > that everyone is encouraged to use would be enough. Adding some > basic functionality to this would be helpful, though. If we keep the > functionality to a minimum, this lets other extensions use it without > being annoyed at the features they drag in. > With something like the .project-locals.el, the only thing missing is some UI for people fearing associations lists. I think, the best way to go is a similar interface of what you get with customize-group (hopefully most of its code could be borrowed). [0] See Directory Local Variables section at: http://bit.ly/ZzUxxL Regards, Fabi=E1n