ada-mode-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Selecting a project from the command line


From: Manuel Gómez
Subject: Re: Selecting a project from the command line
Date: Sun, 29 Jan 2023 23:20:42 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2



El 29/1/23 a las 22:32, Stephen Leake escribió:
Manuel Gómez <mgrojo@gmail.com> writes:

El 28/1/23 a las 20:05, Stephen Leake escribió:
Manuel Gómez <mgrojo@gmail.com> writes:
Thanks. Now, I am able to set it in this way:

alr config --set --global editor.cmd 'emacs
--eval=(ada-build-prompt-select-prj-file"${GPR_FILE}") ${GPR_FILE}'
I'm glad that works; thanks for the feedback.

Note that there is no space between the function and the string
argument. Otherwise, Alire splits the argument and Emacs is not able
to evaluate it correctly. Don't know if that could be considered a bug
in Alire or not, but I couldn't find a proper way to escape the space.
The space problem sounds like a bug, but it could be in your shell
rather than in Alire. It's simpler just to edit the alire config file
directly; it's ~/.config/alire/config.toml

When the config file is edited and space added:

$ alr edit
Editing crate with: ['emacs'
'--eval=(ada-build-prompt-select-prj-file', '"play_2048.gpr")',
'play_2048.gpr']

This should be:

'--eval=(ada-build-prompt-select-prj-file, "play_2048.gpr")',

All one arg to emacs.

And then Emacs errors:

command-line-1: End of file during parsing

This is telling you it is missing a closing paren in the eval arg.

That can be attributed to Alire, it's splitting the command assuming
spaces as separator, so command lines containing spaces inside
arguments are not supported. Using shell syntax (e.g. single quotes)
inside the config file doesn't work either.

Hmm. Does that mean you tried what I suggest above?


Yes, I had already test it. In fact, there's no way to prevent Alire from splitting the command line at the spaces looking at the source.

https://github.com/alire-project/alire/blob/49c04043a3a8d259257729191f5bfe4a104385e5/src/alr/alr-commands-edit.adb#L67

I guess fixing it is not easy and would imply user-visible changes, but the workaround of joining function and string luckily worked.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]