lilypond-invoke-editor in Windows

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

lilypond-invoke-editor in Windows

Federico Bruni-2
Hi all

I'm trying again to make lilypond-invoke-editor work in Windows.
Someone managed to make it work using Windows Subsystem for Linux, that
is installing the LylyPond Linux binary in Windows. But I'd like to use
the installation for Windows.

I think I'm really close to it.
The easiest setup seems to add all the necessary environment variables
and add LilyPond bin/ directory to the path.
Now I'm at a point where in Git Bash I can easily run
lilypond-invoke-editor without errors.
Except when I try to open a URI and the $(file)s, $(line)s and
$(column)s variables are not expanded. What do you think it's missing?
It may be a bug in editor.scm?

$ echo $LYEDITOR
"C:\Program Files\Microsoft VS Code\bin\code" --goto
$(file)s:$(line)s:$(column)s

$ lilypond-invoke-editor
textedit:///c/Users/test/Documents/test.ly:1:1:1
Arguments in `--goto` mode should be in the format of
`FILE(:LINE(:CHARACTER))`.
lilypond-invoke-editor (GNU LilyPond) 2.19.82

# dummy test to show that the editor (VS Code) command is failing
$ code --goto Documents/test.ly:file:line:column
Arguments in `--goto` mode should be in the format of
`FILE(:LINE(:CHARACTER))`.





_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: lilypond-invoke-editor in Windows

David Kastrup
Federico Bruni <[hidden email]> writes:

> Hi all
>
> I'm trying again to make lilypond-invoke-editor work in Windows.
> Someone managed to make it work using Windows Subsystem for Linux,
> that is installing the LylyPond Linux binary in Windows. But I'd like
> to use the installation for Windows.
>
> I think I'm really close to it.
> The easiest setup seems to add all the necessary environment variables
> and add LilyPond bin/ directory to the path.
> Now I'm at a point where in Git Bash I can easily run
> lilypond-invoke-editor without errors.
> Except when I try to open a URI and the $(file)s, $(line)s and
> $(column)s variables are not expanded. What do you think it's missing?
> It may be a bug in editor.scm?
>
> $ echo $LYEDITOR
> "C:\Program Files\Microsoft VS Code\bin\code" --goto
> $(file)s:$(line)s:$(column)s
>
> $ lilypond-invoke-editor
> textedit:///c/Users/test/Documents/test.ly:1:1:1
> Arguments in `--goto` mode should be in the format of
> `FILE(:LINE(:CHARACTER))`.
> lilypond-invoke-editor (GNU LilyPond) 2.19.82

You have one :1 too many.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: lilypond-invoke-editor in Windows

Aaron Hill
On 2018-10-31 12:34 am, David Kastrup wrote:

> Federico Bruni <[hidden email]> writes:
>
>> Hi all
>>
>> I'm trying again to make lilypond-invoke-editor work in Windows.
>> Someone managed to make it work using Windows Subsystem for Linux,
>> that is installing the LylyPond Linux binary in Windows. But I'd like
>> to use the installation for Windows.
>>
>> I think I'm really close to it.
>> The easiest setup seems to add all the necessary environment variables
>> and add LilyPond bin/ directory to the path.
>> Now I'm at a point where in Git Bash I can easily run
>> lilypond-invoke-editor without errors.
>> Except when I try to open a URI and the $(file)s, $(line)s and
>> $(column)s variables are not expanded. What do you think it's missing?
>> It may be a bug in editor.scm?
>>
>> $ echo $LYEDITOR
>> "C:\Program Files\Microsoft VS Code\bin\code" --goto
>> $(file)s:$(line)s:$(column)s
>>
>> $ lilypond-invoke-editor
>> textedit:///c/Users/test/Documents/test.ly:1:1:1
>> Arguments in `--goto` mode should be in the format of
>> `FILE(:LINE(:CHARACTER))`.
>> lilypond-invoke-editor (GNU LilyPond) 2.19.82
>
> You have one :1 too many.

Technically, the format is file:line:char:column, so you can have three
values.  Granted, I've never quite understood the distinction between
"char" and "column".  Usually column is one more than char, so perhaps
it's a count-from-zero vs. count-from-one thing.  *shrug*

But I think the original issue is the use of $(file)s instead of
%(file)s.  editor.scm expects a percent sign if I am reading the code
correctly.

-- Aaron Hill

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: lilypond-invoke-editor in Windows

Federico Bruni-2
Il 2018-10-31 07:43 Aaron Hill ha scritto:

> On 2018-10-31 12:34 am, David Kastrup wrote:
>> Federico Bruni <[hidden email]> writes:
>>
>>> Hi all
>>>
>>> I'm trying again to make lilypond-invoke-editor work in Windows.
>>> Someone managed to make it work using Windows Subsystem for Linux,
>>> that is installing the LylyPond Linux binary in Windows. But I'd like
>>> to use the installation for Windows.
>>>
>>> I think I'm really close to it.
>>> The easiest setup seems to add all the necessary environment
>>> variables
>>> and add LilyPond bin/ directory to the path.
>>> Now I'm at a point where in Git Bash I can easily run
>>> lilypond-invoke-editor without errors.
>>> Except when I try to open a URI and the $(file)s, $(line)s and
>>> $(column)s variables are not expanded. What do you think it's
>>> missing?
>>> It may be a bug in editor.scm?
>>>
>>> $ echo $LYEDITOR
>>> "C:\Program Files\Microsoft VS Code\bin\code" --goto
>>> $(file)s:$(line)s:$(column)s
>>>
>>> $ lilypond-invoke-editor
>>> textedit:///c/Users/test/Documents/test.ly:1:1:1
>>> Arguments in `--goto` mode should be in the format of
>>> `FILE(:LINE(:CHARACTER))`.
>>> lilypond-invoke-editor (GNU LilyPond) 2.19.82
>>
>> You have one :1 too many.
>
> Technically, the format is file:line:char:column, so you can have
> three values.  Granted, I've never quite understood the distinction
> between "char" and "column".  Usually column is one more than char, so
> perhaps it's a count-from-zero vs. count-from-one thing.  *shrug*
>

Actually, lilypond-invoke-editor *requires* three values:

$ lilypond-invoke-editor textedit:///Users/test/Documents/test.ly:4:2
lilypond-invoke-editor (GNU LilyPond) 2.19.82
invalid textedit URI: textedit:///Users/test/Documents/test.ly:4:2
expect: textedit://FILE:LINE:CHAR:COLUMN

$ lilypond-invoke-editor textedit:///Users/test/Documents/test.ly:4:2:2
lilypond-invoke-editor (GNU LilyPond) 2.19.82



> But I think the original issue is the use of $(file)s instead of
> %(file)s.  editor.scm expects a percent sign if I am reading the code
> correctly.
>

Indeed, my oversight due to being used to bash...
It works now in Git Bash, thanks! (I had to remove the c/ from path (see
above))

Tomorrow I'll try to figure out how to make it work also on Command
Prompt and/or PowerShell.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user