[Emacs-ada-mode] Adapting comp_cmd or make_cmd in my .emacs, NOT in some .adp (project) file

Ludovic Brenta ludovic at ludovic-brenta.org
Fri Oct 13 03:26:14 PDT 2006


Philippe Bertin writes:
> I have also looked at Ludovic Brenta's changes (diff'ing in Emacs :) but
> I don't understand that well Emacs lisp. I'm not *that* familiar with it.
> I think I should also first try it out. But seeing Ludovic's snip  ...

Patching ada-mode has been a great learning experience for me; I had to
read the emacs lisp manual for that :)

> <snip Ludovic Brenta>
> ...
> In addition, it parses the project file to find the source
> directories.
> </snip>

> ... my question is: what about the 2 environment variables ? If I use
> these, then there should be no problem, should there ?

Actually, my patched ada-mode ignores ADA_INCLUDE_PATH, ADA_OBJECT_PATH and
ADA_PROJECT_PATH completely.  Only gnatmake cares about them.  So, what
happens is:

C-c C-f seaches the Source_dirs from the project file, so it sonly
        sees the files in the current project, not in withed projects.

C-c C-d calls gnatxref, which reads the .ali files in the Object_Dir
        of the project file, as well as the project file itself.
	Thus gnatxref finds the file correctly, even if it is in a
	"withed" project.  gnatxref does read ADA_PROJECTS_PATH but does
	not need ADA_INCLUDE_PATHS because the withed projects provide
	the necessary information.

Like I said in another post, this solution works well for me.  I do not
use environment variables and I dislike them; I want my source directories
to be clearly listed in a file which I can put, like everything else, in a
Monotone database.

I never meant for my patched ada-mode to be the solution for everyone;
but it is certainly the solution that suits me best for now.

-- 
Ludovic Brenta.



More information about the Emacs-ada-mode mailing list