Simon Wright <[email protected]> writes:
> On 22 Jun 2016, at 13:06, Stephen Leake <[email protected]>
> wrote:
>>
>> Simon Wright <[email protected]> writes:
>>
>>> ================================================
>>> -*- mode: compilation; default-directory: "~/adacore/svd2ada/" -*-
>>> Compilation started at Wed Jun 22 07:54:37
>>>
>>> gnat find -a -r Common_Prefix:base_types.adb:603:13 -Psvd2ada.gpr
>>> gnat: 'gnat find -P' is no longer supported;
>>>
>>> Compilation exited abnormally with code 4 at Wed Jun 22 07:54:37
>>> ================================================
>>>
>>> Hmpf.
>>
>> Yes. That's what gpr_query is for.
>>
>> Let me know if it works for you, and if the manual on how to install and
>> use it needs to be improved.
>
> Looking good! handles 'for Target use', 'for Runtime ("Ada") use' just fine.
>
> The manual certainly needs to be updated for building and for actual
> use. For info, I built with the macOS GCC 6.1.0 as at SF.
>
> Is readline functionality actually required in use, or only for test?
> the instructions to build GNATColl won't build a (working) readline.
gpr_query does not use readline
> Do you think that a person using gpr-query should be able to type C-c
> C-r to show references, as in gnatxref, rather than C-c TAB C-r (or
> the equivalent but more comfortable C-c C-i C-r)? And it would be nice
> not to have to M-x gpr-query for each file.
C-c TAB C-r is from 'gpr-query.el'. That's a minor mode for use in
non-Ada files (ie C, C++).
For Ada files, gpr_query is a cross-reference backend just like gnatxref
is a backend; C-c C-r invokes "ada_show_references", which dispatches to
the backend.
To use the gpr_query backend, set:
(setq ada-xref-tool 'gpr_query)
You can do that in the project file:
xref_tool: gpr_query
Hmm; this is not explicit in the info manual.
I think it would be best if you took a stab at editing the info manual
for this; you have fresh experience. You can change the gnat version to
2016, and mention that it works back thru 2014.
I set ada-xref-tool with this function in ada-mode-hook:
(defun sal-xref-tool ()
"Choose the best setting for `ada-xref-tool'."
(interactive)
(cond
((locate-file "gpr_query" exec-path '("" ".exe"))
(setq ada-xref-tool 'gpr_query))
((locate-file "gnatfind" exec-path '("" ".exe"))
(setq ada-xref-tool 'gnat))
(t
(message "no ada-xref-tool found")))
(message "%s" ada-xref-tool))
It might make sense to have that in ada-mode somewhere, but we need to
allow the user to override it.
>> Ok; I can finally get rid of 'gnat list' in ada-mode :).
>
> I suppose some users might not want to install gnatcoll and gpr_query
> unless they have to?
yes, but the error from gnat find means they have to.
Hmm. I guess they can use some of Ada mode, just not gnat find. I guess
we could document what is lost. I see there is a FIXME: about that in
ada-mode.texi already :).
>> Hmm. I'm guessing this is according to some directory layout standard;
>> why do you have other dirs in your search path?
>
> The longer list of paths includes paths in the RTS. gpr_query gets
> this longer list.
Ok, good.
--
-- Stephe
_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org