Ludovic Brenta <[email protected]> writes: > In the same context as my follow-up post, ada-mode 5.0.1 does not > directly support our workflow. Suppose a developer wants to browse the > sources in the baseline (i.e. multiple read-only directories containing > the sources and, separately, the .ali files) without creating a working > view. They normally start by find-tag <some_file_or_identifier>; this > opens a read-only source file in a read-only directory. Now they place > point on an identifier and do ada-goto-declaration: this does not > work.
Have they specified an Emacs Ada mode project file somewhere in there? Either a .prj or a .gpr? > As I found, there are two reasons why it does not work: > > 1. gnat-run-gnat calls "gnat find -Pproject.gpr" without specifying > the absolute pathname of "project.gpr". At this point, `default-directory' is supposed to be the directory containing the Emacs Ada mode project file. So this should be ok. >In my situation, the generated project file is in /tmp, not in the same >directory as the source file. How are you telling Emacs where that project file is? > Even in the absence of a generated project file, the top-level > project file would most probably not be in the same directory as the > visited file, either. Right, that's expected. > 2. "gnat find" creates temporary files in $TMPDIR but, if TMPDIR is > unset, it tries to create them in the current, read-only, directory > containing the visited source file. Ah; you are saying 'default-directory' above is the source directory, not /tmp. That's a bug. > The error reporting and recovery from gnat-run-calls in this case is, > unfortunately, not very useful but I don't see how it could be > improved without becoming bloated. Ok. > The attached patch solves the first problem; That may work, but it's not the best fix. Can you investigate why gnat-run-buffer is created with the wrong default-directory? Or give me a recipe for reproducing; how you specify the project file in the first place is the critical step. > setting TMPDIR is outside the scope of ada-mode, I think. You can set it in an Emacs Ada mode project file; $TMPDIR=<path> or in an elisp file referenced from the Emacs Ada mode file: el_file=foo.el in foo.el: (setenv "TMPDIR" "path") I think that's enough support. -- -- Stephe _______________________________________________ Emacs-ada-mode mailing list [email protected] http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org
