[Emacs-ada-mode] [Emacs][ada-mode] ada-xref.el -- missing gnatls in PATH

Pierre-Louis Escouflaire pierre-louis.escouflaire at eurocontrol.int
Fri Nov 16 03:49:06 PST 2007


Hello,

Stephen Leake wrote:
> Pierre-Louis Escouflaire <pierre-louis.escouflaire at eurocontrol.int> writes:
> 
> 
>>We found a relatively drastic problem related to the 'ada-xref.el' 
>>script file that appears when you do NOT have 'gnatls' in your PATH.
>>
>><snip>
>>
>>Another solution (maybe wiser) would be to change `ada-find-executable' 
>>so that it raises an error when the executable has not been found. The 
>>one using it should then protect it using a `condition-case'.
> 
> 
> Yes, this is right way (you'd think people using Ada would not ignore
> errors!). Try this:
> 
> (defun ada-find-executable (exec-name)
>   "Find the full path to the executable file EXEC-NAME.
> If not found, throw an error.
> On Windows systems, this will properly handle .exe extension as well"
>   (let ((result (or (ada-find-file-in-dir exec-name exec-path)
>                     (ada-find-file-in-dir (concat exec-name ".exe") exec-path))))
>     (if result
>         result
>       (error "'%s' not found in path" exec-name))))
> 
> ada-find-executable is only used in ada-initialize-runtime-library, so
> this won't break anything else.
> 
> I don't think there's any point in attempting to handle the error in
> ada-initialize-runtime-library; if gnatls isn't found, nothing else
> will work either, because gnat won't be found.

This is perfectly correct... based on a developer's point of view.

However, I think that Emacs should start properly:
   . for users that only need to read Ada sources,
   . for users in a restrained environment,
   . for users not using the GNAT compiler and tools.

Thus, the 'ada-initialize-runtime-library' behavior might be to warn 
users that some features are not available because of one of the two 
last reasons.

An extension of this might be to enable/disable shortcuts, menu items, 
etc. whether or not the user is in a restrained environments or without 
the GNAT compiler and tools.
Another solution might be to raise an error saying that no tool allows 
the user to use these commands.

> Too late for 3.9; this will be in 4.00 (sometime).


Thanks for your concern.

Regards,
Pierre-Louis ESCOUFLAIRE

____

This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful.

Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL, unless it is confirmed by appropriately signed hard copy.

Any views expressed in this message are those of the sender.




More information about the Emacs-ada-mode mailing list