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: Sat, 28 Jan 2023 20:36:07 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2



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']

And then Emacs errors:

command-line-1: End of file during parsing

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.

I opened an issue, so at least is known.

https://github.com/alire-project/alire/issues/1314



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 -------


Good to know. Thanks.



reply via email to

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