Skip to content

Commit

Permalink
Fix the example for editor.cmd (alire-project#1313)
Browse files Browse the repository at this point in the history
Using double quotes, the  ${GPR_FILE} is interpreted as a variable by Bourne-like shells and evaluated to an empty string or whatever value has when executed. Single quotes is a way to avoid that evaluation.

This example will not make Emacs select and load the GPR_FILE as the project file for ada-mode, that would be more cumbersome (and requires ada-mode 8.0.3), but I didn't want to complicate the example:
```
alr config --set --global editor.cmd 'emacs --eval=(ada-build-prompt-select-prj-file"${GPR_FILE}") ${GPR_FILE}'
```
  • Loading branch information
mgrojo authored Feb 7, 2023
1 parent fcc4819 commit 3b7b139
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/user-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,13 +513,13 @@ PR [#611](https://github.com/alire-project/alire/pull/611).

The code editor launched by `alr edit` can now be configured instead of using
the hard-coded GNATstudio. Use
`alr config --set --global editor.cmd "<BINARY> <ARGS>"`
`alr config --set --global editor.cmd '<BINARY> <ARGS>'`
for custom editor and command line arguments. The token ${GPR_FILE} is
replaced by a path to the project file to open.

For instance:
```shell
$ alr config --set --global editor.cmd "emacs ${GPR_FILE}"
$ alr config --set --global editor.cmd 'emacs ${GPR_FILE}'
```

The default editor is still GNATstudio.
Expand Down

0 comments on commit 3b7b139

Please sign in to comment.