[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Selecting a project from the command line
From: |
Stephen Leake |
Subject: |
Re: Selecting a project from the command line |
Date: |
Sat, 28 Jan 2023 11:05:06 -0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Manuel Gómez <mgrojo@gmail.com> writes:
> El 27/10/22 a las 11:28, Stephen Leake escribió:
>> Stephen Leake <stephen_leake@stephe-leake.org> writes:
>>
>>> Manuel Gómez <mgrojo@gmail.com> writes:
>>>
>>>> Am 1/9/21 um 22:59 schrieb Stephen Leake:
>>>> I'm a bit lost, probably because I didn't express my intention right.
>>>> That snippet runs without errors but I still don't get the full setup:
>>>> C-c C-c asks for the make command. What I would like to get is the
>>>> same setup as when I choose "Ada | Project Files | Find and select
>>>> Project ...".
>>>
>>> Ok. That menu entry runs ada-build-prompt-select-prj-file, in file
>>> ada-build.el.
>>>
>>> If that function took a file name argument, you could just call it; I'll
>>> add that for the next release.
>> This will be in the upcoming ada-mode 8.0 release.
>>
>
> 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
You can also tell ada-mode to use an alire environment from within
Emacs. For example, here is the elisp code to do that for the
ada_language_server source:
------ prj.el ------
;; Emacs wisi project definitions for navigating ada_language_server -*-
no-byte-compile: t; -*-
(require 'gnat-alire)
(wisi-prj-select-cache
"alire.toml"
(create-alire-project
:name "als 23.1 patch"
:gpr-file (expand-file-name "gnat/lsp_server.gpr")
:xref-label ada-xref-backend
)
"alire.toml"
)
------- end prj.el -------
--
-- Stephe