[Emacs-ada-mode] Thanks and my first enquiry

The masked-coder known as Randux randux at Safe-mail.net
Sun Aug 20 06:57:37 PDT 2006


Mucho gusto, Manuel,

I think your suggestion may fix my problem.  I did a quick test and it appears that the gnatmake is now being issued for the correct module!  This will be a big time-saver and as you suggest it's a simple matter to bind it to whatever key one wants.  Thanks loads!

Unfortunately the issue of the compile failing when Emacs isn't started in the directory where the source is, is still a problem.  

> Hello folks,
> 
> > This is a separate issue and I don't want to throw more confusion into the game here, but I've also noticed > >that Emacs seems to need to be associated with the right directory, as I think you're saying here, else the > >gnatmake seems to fail in a very odd way.  For example, if I start Emacs in the home directory and then 
> >C-x C-f to navigate to where the source is and then pull up the file and then do C-c C-c the gnatmake fails; > >if I cd to the directory, start emacs in the directory where the source is, and then do the same thing, then 
> >gnatmake succeeds.
> > 
> 
> I thought compile command always make a cd to the directory of the
> current buffer's file. C-c C-c does call "compile" in my current home
> installation (package adamode from Debian Sarge) and does a cd to the
> proper directory.

I see what the problem is now, thanks to you for prompting me to have another look.  In this instance, I'm compiling an ncurses application in Ada.  I have in my .emacs some compilation options:

'(ada-prj-default-comp-opt "-gnataflnoqv -O2 -largs /my/curses/libAdaCurses.a")

and instead of switching into the source directory, both C-c C-c and M-ada-compile-current both do a cd into the /my/curses library directory.  I don't know why it does that but it's certainly part of the problem.  It doesn't seem to be a problem at all times, sometimes the compile does work and I can't see why.  If there's a better way to advise gnatmake of where libraries are perhaps that will make the problem go away.


> I'm also used to compile single files after writing it for the first
> time or after a minor correction. Ada mode has indeed a command for
> compiling a single source file without project or make files. This
> command (M-x ada-compile-current) is not bound by default to any key but
> you can find it in the Emacs menu: "Ada > Compile file". I think it does
> exactly what you expect. On the other hand, C-c C-c is supposed to do a
> build of the current main program. I suppose the original design was to
> define an ada-mode project file for each main program though its gui.
> Then C-c C-c is supposed to build the main program associated to the
> current project.

Fantastic explanation!  Thanks very much for your post!

Randall

> Manuel Gomez



More information about the Emacs-ada-mode mailing list