lilypond-user
[Top][All Lists]
Advanced

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

Re: Windows/WSL textedit handling (was Re: Interactive PDF Link to Notes


From: Aaron Hill
Subject: Re: Windows/WSL textedit handling (was Re: Interactive PDF Link to Notes in Preview)
Date: Thu, 19 Jul 2018 13:15:04 -0700
User-agent: Roundcube Webmail/1.3.6

On 2018-07-19 10:10, Federico Bruni wrote:
I made a quick try now and not surprisingly (I'm not a Windows user) did not work.

This stuff is significantly advanced for the average Windows user. Also, I would consider my approach here more akin to a hack or kludge. For posterity, I will reiterate that my configuration is very unusual and not representative of a typical Windows system. Unless you too are running LilyPond via WSL and wanting to launch Visual Studio Code, then do expect work on your side to adapt things for your needs.

- have you used a multistring for Classes\textedit key? Otherwise you
cannot put the two lines.

All strings are simple REG_SZ values. I am not sure what you mean by "the two lines", so please clarify that so I can best advise.

Does it have to have a special name?

I would lean towards "yes", but that is not something I can definitely answer. Regardless of whether it is required or not, though, it would be best to stick to a consistent naming throughout.

For your reference, I based my registry modification on an existing URI protocol handler, specifically "HKEY_CURRENT_USER\Software\Classes\vscode". I used regedit to export that section of the registry to a file, modified the file as appropriate, and then merged it back in. This simplified things since I had a specific template to follow; also it was much faster than trying to manually add keys via the GUI.

NOTE: If you do the same thing, be sure that you find and replace all instances of "vscode" within the exported registry file with "textedit". You do not want to accidentally modify the wrong part of the registry.

- I guess that the CMD path to lilypond-invoke-editor is wrong (it
seems a Linux path). Should I use what PowerShell gcm finds for it?

It must be a Linux-centric path because I am using WSL to launch it. You could not use anything else. And PowerShell's Get-Command will not return anything useful, as it has no vision into WSL. (Someone probably has a PowerShell addon that addresses that.)

But keep in mind that I chose to install LilyPond to /usr/local/bin which is the default location when you run the installation script with `sudo`. You can, of course, install LilyPond to your local /home directory if you choose. As such, you will need to adjust the path accordingly.

Full paths are necessary, right?

In my testing, I found full paths worked best, but they are not strictly required in all cases. It really depends on your environment.

To avoid confusion, though, I chose to use full paths both to be as specific as possible and to make sure it was clear what paths I had hard-coded.

- C:// becomes /mnt/c in cmd scripts?

Not as a strict rule, no. It all depends on what context you are talking about. If you need to reference a Windows-based path from the WSL environment, then you can use the default mount point of /mnt/c for C:\. (Any other drive letters should have equivalent mount points.) The built-in command `/bin/wslpath` can be useful for converting between Linux-centric and Windows-centric paths. I am only using it, however, as a convenient means to convert the paths LilyPond embeds in the PDF.

That said, remember that the command script executes within Windows, so *it* needs to use Windows-based paths. Case in point, note that the command to launch WSL itself uses its Windows path.

There is a lot of back-and-forth between Windows and WSL in the approach I outlined. Understandably, there can be confusion. On reflection, I was too terse in my email. But to be honest, I did not expect many people would run with the idea. I figured I was probably the only person using LilyPond via WSL and editing with VS Code.


-- Aaron Hill



reply via email to

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