From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jorgen Schaefer Newsgroups: gmane.emacs.devel Subject: Re: A unified project root interface Date: Sun, 24 Mar 2013 11:13:10 +0100 Message-ID: <20130324111310.192618bc@forcix.kollektiv-hamburg.de> References: <20130309174419.6e1cadb4@forcix.kollektiv-hamburg.de> <87y5dmsz5u.fsf@engster.org> <20130317191817.764a44f5@forcix.kollektiv-hamburg.de> <87ppywtj9s.fsf@engster.org> <87li9juabi.fsf@engster.org> <87d2uvtdeb.fsf@engster.org> <874ng6tugb.fsf@engster.org> <87ppyurpxa.fsf@engster.org> <514A5A68.3070907@siege-engine.com> <87hak4af33.fsf@engster.org> <514BAA14.7060702@siege-engine.com> <87li9fyy6v.fsf@engster.org> <514DE1FC.4020805@siege-engine.com> <20130323182648.059f2e2a@forcix.kollektiv-hamburg.de> <87d2uqkna5.fsf@yandex.ru> <87d2upon55.fsf@kuiper.lan.informatimago.com> <87li9d2zlp.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1364120003 30620 80.91.229.3 (24 Mar 2013 10:13:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Mar 2013 10:13:23 +0000 (UTC) Cc: "Pascal J. Bourguignon" , "Eric M. Ludlam" , Stefan Monnier , David Engster , emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 24 11:13:48 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 1UJhvt-000785-5y for ged-emacs-devel@m.gmane.org; Sun, 24 Mar 2013 11:13:45 +0100 Original-Received: from localhost ([::1]:44951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJhvV-0002Jv-Ei for ged-emacs-devel@m.gmane.org; Sun, 24 Mar 2013 06:13:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJhvS-0002Im-3U for emacs-devel@gnu.org; Sun, 24 Mar 2013 06:13:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJhvO-0005Yt-F8 for emacs-devel@gnu.org; Sun, 24 Mar 2013 06:13:18 -0400 Original-Received: from istinn.electusmatari.com ([83.169.37.145]:49589) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJhvO-0005YI-5k for emacs-devel@gnu.org; Sun, 24 Mar 2013 06:13:14 -0400 Original-Received: from forcix.kollektiv-hamburg.de (hmbg-4d06cdce.pool.mediaWays.net [77.6.205.206]) by istinn.electusmatari.com (Postfix) with ESMTPSA id 62B4215DC0005; Sun, 24 Mar 2013 11:13:12 +0100 (CET) In-Reply-To: <87li9d2zlp.fsf@yandex.ru> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; i486-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 83.169.37.145 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:158105 Archived-At: On Sun, 24 Mar 2013 08:25:38 +0400 Dmitry Gutov wrote: > The idea is that `project-root' calls all functions in > `project-root-functions', and as soon as one of them returns a > meaningful value, `project-root' (being the caller) uses it to set the > value of `current-project-dir', and then probably caches it. I did a quick implementation of my current ideas on the topic: https://raw.github.com/jorgenschaefer/project-el/master/project.el Quick run-down: - If you only want to know the project root, you call (project-root) and never have to worry about anything else. - This will call functions in `project-guess-root-functions' until one returns a non-nil value. This value is cached for future calls. - The default functions use the current EDE project if any, or VC directory markers, or ask the user; can be extended as needed. - When an extension provides a way to change the project root, they can call `project-set-root', which will run `project-root-changed-hook' so that other extensions (e.g. EDE) can intercept that and adjust themselves accordingly. Or even throw an error. Other extensions should be able to build on that. Regards, -- Jorgen