From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Ludlam Newsgroups: gmane.emacs.devel Subject: progmodes/project.el and search paths Date: Sun, 02 Aug 2015 09:52:31 -0400 Message-ID: <55BE209F.1000009@siege-engine.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070301040103090305090903" X-Trace: ger.gmane.org 1438523571 5102 80.91.229.3 (2 Aug 2015 13:52:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Aug 2015 13:52:51 +0000 (UTC) To: Emacs Development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 02 15:52:42 2015 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 1ZLtgv-0001Ch-JB for ged-emacs-devel@m.gmane.org; Sun, 02 Aug 2015 15:52:41 +0200 Original-Received: from localhost ([::1]:56105 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLtgu-0006Bd-Sl for ged-emacs-devel@m.gmane.org; Sun, 02 Aug 2015 09:52:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLtgr-0006Ao-JY for emacs-devel@gnu.org; Sun, 02 Aug 2015 09:52:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZLtgo-0006Tf-Cq for emacs-devel@gnu.org; Sun, 02 Aug 2015 09:52:37 -0400 Original-Received: from mail-vk0-f50.google.com ([209.85.213.50]:34019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLtgo-0006TZ-88 for emacs-devel@gnu.org; Sun, 02 Aug 2015 09:52:34 -0400 Original-Received: by vkca124 with SMTP id a124so34519034vkc.1 for ; Sun, 02 Aug 2015 06:52:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; bh=gfeZ9rf+Xye2HfL6Zq8bTV3gdqF8WRlwcMQDEswkzes=; b=LBlDq7zmikT5EhUwcFuK/QqEVIPWD45tmjiyfdWGQIdU20d+TOQwyl8EKtrLGNa/vT vlhelmuo6h8Or4ZUMZipaohUMV6gpVzQrtSK9E8yMBTlj0Vvb5qU8i5wMT6nzprZofgz oxqkkrLlWtqo8CIyyp1WU/VxVNT4rdg6azc6bR9Kfo+o6/oVS7p6MnKie1OSiG6i31hI SjE4k/8fKPwwAjA48cO3+eQYas461rjNog/8REklm+RzZqCqKYZYOaxqWIcGW5DeNIrN 1p+OWC4mJIoTlgtih7zrD5LLtqOn6PI3g/yqT8t5KzClE9Jsg2qgbb/xKjn0B7VNc42i 0rXQ== X-Received: by 10.52.109.230 with SMTP id hv6mr20109448vdb.43.1438523553826; Sun, 02 Aug 2015 06:52:33 -0700 (PDT) Original-Received: from [192.168.1.202] (pool-71-184-198-118.bstnma.fios.verizon.net. [71.184.198.118]) by smtp.googlemail.com with ESMTPSA id x2sm2228049vdb.13.2015.08.02.06.52.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 06:52:32 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.213.50 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:188292 Archived-At: This is a multi-part message in MIME format. --------------070301040103090305090903 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit I have a some thoughts related to the project.el project being discussed in the mailing list. When it was first proposed as a set of core functions to generically describe a project, I thought it could be a good idea, since there are a several 'projects' out there, such as EDE, projectile, jdee, and a few others I know less about. It would save some tools the trouble of knowing how to integrate all those possibilities if all they needed was some random piece of project metadata. project.el and the current discussion seems to revolve almost entirely around search paths and xref. EDE does project management, but has not needed to track search paths the way project.el does. It certainly has ways to find files, and has include paths and such needed by source code, but not generic search paths. I think project.el should be recast as defining search paths for search tools. EDE could then plug itself in to provide some paths if asked. I think calling it a "project" is overstating what project.el does. In the meantime, attached is a small patch to enable EDE to provide roots to project.el. The new function works for me with 24.3, but I didn't try it in project.el Perhaps all the work you're doing could just hang off ede since it only takes 2 lines of code, and if it is missing some sort of pruning tricks, it could just be added to ede. Eric --------------070301040103090305090903 Content-Type: text/x-patch; name="project.el.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="project.el.patch" diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index d849f93..3fd1358 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -27,7 +27,8 @@ (require 'cl-generic) -(defvar project-find-functions (list #'project-try-vc +(defvar project-find-functions (list #'project-try-ede + #'project-try-vc #'project-ask-user) "Special hook to find the project containing a given directory. Each functions on this hook is called in turn with one @@ -99,6 +100,13 @@ an element of `project-search-path'." (vc-call-backend backend 'root dir))))) (and root (cons 'vc root)))) +(defun project-try-ede (dir) + "Use EDE to determine if DIR is a project directory." + (when (featurep 'ede) + (let* ((eproj (ede-current-project dir)) + (eroot (ede-project-root-directory eproj))) + (cons 'ede eroot)))) + (cl-defmethod project-roots ((project (head vc))) (list (cdr project))) --------------070301040103090305090903--