Re: Regexp on sourcepath possible?
At 12:58 AM 3/15/2005, Paul Kinnucan wrote: Ole Arndt writes: Hi Lars, But I'm curious as to what kind of a project structure would make regular expressions in source paths useful. The structure that I have at work is one such. We have multiple subprojects side by side: source project1 prj.el com/foo/project1 *.java project2 prj.el com/foo/project2 *.java ... project17 prj.el com/foo/project17 *.java products similar tree with class files Some projects depend on others, but the dependency graph is non-cyclic, so we build and test project 1, then project 2 and so on. Each prj.el sets jde-sourcepath to . and jde-global-classpath to include ../products/projectName/directoriesWithClasses. Which works, except when I try to jump to a source file in a different subproject. What I'd like to do is set jde-sourcepath to (. ../*) but instead, I have to manually do (. ../project1 ../project2 ... ../projectN-1). Which eventually gets built up in each prj.el. And we frequently add more projects, so even if the list is complete, that's only a temporary condition. Whether this is a good coding practice is debatable, but it is what we do. Finally, to handle a path specification like: */src/java the JDEE would have to cycle through every directory on your system, appending /src/java to it, testing whether such a directory exists, and then searching that directory for the source file? Seems like a pretty time-consuming operation that might make finding and opening source files a very slow process. I'd be happy with just something that expands * like a unix wildcard. So */src/java woudn't be the equivalent of a unix find command, but more like the equivalent of ls */src/java. Troy Paul Just be sure to never save your project files with jde-save-project, or you will lose your changes. I have written myself a small module for a related purpose: Read the dependencies from a maven project.xml file and build the jde-global-classpath from this information. My .prj.el files now typically look like this: (setq pom (pom-read-pom)) (jde-set-variables '(jde-global-classpath (pom-get-classpath pom)) '(jde-project-name (pom-get-project-id pom)) '(jde-sourcepath (quote (./src/java ./src/test I have, of course, also a prj.el file for all my default settings in my top level source directory. Ole -- Ole Arndt http://www.sugarshark.com Troy Daniels [EMAIL PROTECTED] 781-273-3388 x218
Re: Regexp on sourcepath possible?
At 12:58 AM 3/15/2005, Paul Kinnucan wrote: Ole Arndt writes: Hi Lars, Lars Degerstedt [EMAIL PROTECTED] writes: Also, I've never understood the big attraction of having to manually find and open a project file, edit it, and then save it, an error-prone and tedious process. Not my idea of a good time but, heck, to each his own. Why do we use JDEE at all instead of just using the customize interface to make emacs perform like we want to? Because there's no option that turns on all the functionality we want. I generally edit prj.el by using the customize interface, but I'll sometimes edit prj.el directly. There's a few cases where I do this, which probably indicates my wish list of prj.el enhancements. I'm copying a prj.el file to a new but related project. I want most of the settings to be the same, but there's some points where the project name is hard-coded. M-x replace-string is actually better than jde-customize-variable, because I know I won't skip a variable. I want to run the program with a different set of arguments, but be able to swap back to the old arguments. Generally, this involves changing the arguments passed to junit.textui.TestRunner from package.SmokeTestSuite to package.NightlyTestSuite. I copy the old value to a comment, and then (usually) uncomment the value from the last time I did this. I want to turn on profiling or remote debugging, so I want to comment/uncomment a fairly complex set of arguments and not have to remember how I set them. Of course, there's always the alternative of proposing a change to the JDEE to enhance the customization interface to support features that you need, e.g., providing the option to specify a function to compute jde-sourcepath or as in this case regular expressions. This is the better long-term solution, assuming somebody has the time and knowledge to implement the solution. Troy Troy Daniels [EMAIL PROTECTED] 781-273-3388 x218