unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* progmodes/project.el and search paths
@ 2015-08-02 13:52 Eric Ludlam
  2015-08-02 17:17 ` Dmitry Gutov
  0 siblings, 1 reply; 101+ messages in thread
From: Eric Ludlam @ 2015-08-02 13:52 UTC (permalink / raw)
  To: Emacs Development

[-- Attachment #1: Type: text/plain, Size: 1384 bytes --]

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

[-- Attachment #2: project.el.patch --]
[-- Type: text/x-patch, Size: 1040 bytes --]

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)))
 

^ permalink raw reply related	[flat|nested] 101+ messages in thread

end of thread, other threads:[~2015-12-29  2:00 UTC | newest]

Thread overview: 101+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-02 13:52 progmodes/project.el and search paths Eric Ludlam
2015-08-02 17:17 ` Dmitry Gutov
2015-08-03  1:19   ` Eric Ludlam
2015-08-03 16:16     ` Stephen Leake
2015-08-03 22:56       ` Dmitry Gutov
2015-08-08 13:07       ` Nix
2015-08-09  5:18         ` Stephen Leake
2015-08-09 12:17           ` David Engster
2015-08-09 15:55             ` Stephen Leake
2015-08-10 11:29               ` David Engster
2015-08-10 16:43                 ` Stephen Leake
2015-08-12 10:10                   ` David Engster
2015-08-12 13:49                     ` Stephen Leake
2015-08-12 15:36                       ` David Engster
2015-08-13 11:53                         ` Nix
2015-08-13 12:05                           ` Dmitry Gutov
2015-08-14 11:52                             ` Eric Ludlam
2015-08-14 22:30                               ` Dmitry Gutov
2015-08-15  0:48                                 ` Eric Ludlam
2015-08-15  7:05                                 ` Eli Zaretskii
2015-08-10 17:12             ` Nix
2015-08-03 22:47     ` Dmitry Gutov
2015-08-04 11:52       ` Eric Ludlam
2015-08-04 16:09         ` Dmitry Gutov
2015-08-03 13:49   ` David Engster
2015-08-03 14:09     ` Dmitry Gutov
2015-08-03 14:27       ` David Engster
2015-08-03 15:13         ` Dmitry Gutov
2015-08-03 21:35           ` David Engster
2015-08-03 23:21             ` Dmitry Gutov
2015-08-04  8:15               ` David Engster
2015-08-04 13:43               ` Eli Zaretskii
2015-08-04 18:05                 ` Dmitry Gutov
2015-08-04 18:16                   ` Eli Zaretskii
2015-08-04 18:41                     ` Dmitry Gutov
2015-08-04 19:23                       ` Eli Zaretskii
2015-08-04 19:40                         ` João Távora
2015-08-05  2:52                           ` Eli Zaretskii
2015-08-04 20:15                         ` Dmitry Gutov
2015-08-05  2:49                           ` Eli Zaretskii
2015-08-05  6:18                             ` Stephen Leake
2015-08-05 15:08                               ` Eli Zaretskii
2015-08-05 15:36                                 ` Dmitry Gutov
2015-08-05 16:31                                   ` Eli Zaretskii
2015-08-05 16:45                                   ` David Engster
2015-08-05 22:17                                     ` Dmitry Gutov
2015-08-06  7:56                                     ` Stephen Leake
2015-08-06  7:54                                   ` Stephen Leake
2015-08-05  9:42                             ` Dmitry Gutov
2015-08-05 15:23                               ` Eli Zaretskii
2015-08-05 15:31                                 ` Dmitry Gutov
2015-08-05 16:16                                   ` Eli Zaretskii
2015-08-06  6:44                                     ` Dmitry Gutov
2015-08-06  7:43                               ` Stephen Leake
2015-08-06 10:25                                 ` Dmitry Gutov
2015-08-06 14:27                                   ` Stephen Leake
2015-08-06 23:16                                     ` Dmitry Gutov
2015-08-07 14:10                                       ` Stephen Leake
2015-08-07 14:44                                         ` Dmitry Gutov
2015-08-03 16:35         ` Stephen Leake
2015-08-03 16:45           ` Eli Zaretskii
2015-08-03 21:07             ` Stephen Leake
2015-08-03 21:33               ` David Engster
2015-08-04  2:35               ` Eli Zaretskii
2015-08-03 15:09       ` Eli Zaretskii
2015-08-03 15:16         ` Dmitry Gutov
2015-08-03 15:29           ` Eli Zaretskii
2015-08-03 19:01             ` Dmitry Gutov
2015-08-03 19:19               ` Eli Zaretskii
2015-08-03 21:05                 ` Dmitry Gutov
2015-08-04 11:48         ` Eric Ludlam
2015-08-04 16:20           ` Dmitry Gutov
2015-08-03 16:25     ` Stephen Leake
2015-08-03 21:33     ` Stefan Monnier
2015-08-03 22:15       ` David Engster
2015-08-03 22:50         ` Dmitry Gutov
2015-08-04  7:13         ` Stefan Monnier
2015-08-04  8:13           ` David Engster
2015-08-05 13:42             ` Stefan Monnier
2015-08-06 11:27               ` {Spam?} " Eric Ludlam
2015-08-06 23:10                 ` Stefan Monnier
2015-08-07 11:18                   ` Eric Ludlam
2015-08-07 11:43                     ` David Engster
2015-08-07 12:17                       ` Dmitry Gutov
2015-08-07 12:40                         ` David Engster
2015-08-07 12:54                           ` Dmitry Gutov
2015-08-07 12:08                     ` Alexis
2015-08-04  9:40           ` Stephen Leake
2015-08-04 17:43             ` Dmitry Gutov
2015-08-04 19:49               ` Stephen Leake
2015-08-04 20:03                 ` Dmitry Gutov
2015-08-05  6:02                   ` Stephen Leake
2015-08-05  9:59                     ` Dmitry Gutov
2015-08-06  7:25                       ` Stephen Leake
2015-08-07 14:21                         ` Dmitry Gutov
2015-08-05  1:29   ` Eric Ludlam
2015-08-11 20:01     ` Dmitry Gutov
2015-08-12  0:49       ` Eric Ludlam
2015-08-12  7:25         ` project terminology Stephen Leake
2015-08-12  9:28         ` progmodes/project.el and search paths Dmitry Gutov
2015-12-29  2:00     ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).