Re: gvim point and click

2024-06-04 Thread Stefan Thomas
Dear Timothy,
for all, who are interested in, I finally got it to work (with Your help
and also with chatgpt).
I wrote in okular/settings/configure okular/edior:

> custom editor  gvim --servername GVIM --remote-send ":e %f:call
> SetCursorAdjusted(%l,%c)"

And I wrote in .vimrc

function! SetCursorAdjusted(line, col)
  " Adjust line number down by 1
  let lnum = a:line - 1
  " Use the cursor function to set the cursor position
  call cursor(lnum, a:col)
endfunction

Now I start gvim with
gvim --servername GVIM
and everything works fine!

Am Mo., 3. Juni 2024 um 10:35 Uhr schrieb Timothy Lanfear <
timo...@lanfear.me>:

> Maybe you could try the call cursor command
>
> vim +"call cursor(%l,%c)" %f
>
> As in David' remarks, you may need to adjust the quoting to get the
> desired result.
>
> vim +"call cursor(5,3)" file.ly
>
> works on the shell command line.
> On 03/06/2024 06:24, Stefan Thomas wrote:
>
> Dear David,
> thanks for Your reply.
> Unfortunately, none of your suggestions have brought the desired result!
> Best,
> Stefan
>
> Am Mo., 3. Juni 2024 um 03:19 Uhr schrieb David Wright <
> lily...@lionunicorn.co.uk>:
>
>> On Sun 02 Jun 2024 at 16:10:56 (+0200), Stefan Thomas wrote:
>> > again, I'm trying to activate point and click in gvim. I made a little
>> > success:
>> > I wrote in the editor options of okular:
>> > gvim --remote-silent +%l %f +normal! %c
>> > When I click on a note, the right document is opened and the cursor is
>> > placed at the correct line, but not at the correct note in the lilypond
>> > file.
>> > What can I do?
>>
>> Perhaps the command you're trying to invoke is, for example:
>>
>>   gvim --remote-silent +:123:norm45l path-to-file
>>
>> using literal constants for line number 123 and column 45.
>>
>> Naively, that would mean okular would have something like:
>>
>>   gvim --remote-silent +:%l:norm%cl %f
>>
>> but, not being familiar with okular, I can't tell how it would
>> handle %cl (where l means move to the right by %c columns) and
>> whether it would need any quoting. For example,
>>
>>   gvim --remote-silent '+:%l:norm%c l' %f
>>
>> might work better.
>>
>> Cheers,
>> David.
>>
> --
> Timothy Lanfear, Bristol, UK.
>
>


Re: gvim point and click

2024-06-03 Thread David Wright
On Mon 03 Jun 2024 at 07:24:41 (+0200), Stefan Thomas wrote:
> Am Mo., 3. Juni 2024 um 03:19 Uhr schrieb David Wright:
> > On Sun 02 Jun 2024 at 16:10:56 (+0200), Stefan Thomas wrote:
> > > again, I'm trying to activate point and click in gvim. I made a little
> > > success:
> > > I wrote in the editor options of okular:
> > > gvim --remote-silent +%l %f +normal! %c
> > > When I click on a note, the right document is opened and the cursor is
> > > placed at the correct line, but not at the correct note in the lilypond
> > > file.
> > > What can I do?
> >
> > Perhaps the command you're trying to invoke is, for example:
> >
> >   gvim --remote-silent +:123:norm45l path-to-file
> >
> > using literal constants for line number 123 and column 45.
> >
> > Naively, that would mean okular would have something like:
> >
> >   gvim --remote-silent +:%l:norm%cl %f
> >
> > but, not being familiar with okular, I can't tell how it would
> > handle %cl (where l means move to the right by %c columns) and
> > whether it would need any quoting. For example,
> >
> >   gvim --remote-silent '+:%l:norm%c l' %f
> >
> > might work better.
> >
> Unfortunately, none of your suggestions have brought the desired result!

It always helps to post exactly what your new options were, and the
result they produced. Does gvim complain about the invocating command,
for example, or just ignore part of it? If there's a controlling
terminal, you could try replacing   gvim --remote-silent   by echo,
to see whether the command option is well-formed.

BTW, in your OP, does "not at the correct note" mean the cursor is
at the start of the line, or pointing at an incorrect note? (I'm
assuming column one would never have a note in it).

As I don't run okular (installing it would require 195 other
packages), I would suggest you add the word okular into the
Subject line, as I know two or three users here use it, though
perhaps not exclusively.

Cheers,
David.



Re: gvim point and click

2024-06-03 Thread Timothy Lanfear

Maybe you could try the call cursor command

vim +"call cursor(%l,%c)" %f

As in David' remarks, you may need to adjust the quoting to get the 
desired result.


vim +"call cursor(5,3)" file.ly

works on the shell command line.

On 03/06/2024 06:24, Stefan Thomas wrote:

Dear David,
thanks for Your reply.
Unfortunately, none of your suggestions have brought the desired result!
Best,
Stefan

Am Mo., 3. Juni 2024 um 03:19 Uhr schrieb David Wright 
:


On Sun 02 Jun 2024 at 16:10:56 (+0200), Stefan Thomas wrote:
> again, I'm trying to activate point and click in gvim. I made a
little
> success:
> I wrote in the editor options of okular:
> gvim --remote-silent +%l %f +normal! %c
> When I click on a note, the right document is opened and the
cursor is
> placed at the correct line, but not at the correct note in the
lilypond
> file.
> What can I do?

Perhaps the command you're trying to invoke is, for example:

  gvim --remote-silent +:123:norm45l path-to-file

using literal constants for line number 123 and column 45.

Naively, that would mean okular would have something like:

  gvim --remote-silent +:%l:norm%cl %f

but, not being familiar with okular, I can't tell how it would
handle %cl (where l means move to the right by %c columns) and
whether it would need any quoting. For example,

  gvim --remote-silent '+:%l:norm%c l' %f

might work better.

Cheers,
David.


--
Timothy Lanfear, Bristol, UK.


Re: gvim point and click

2024-06-02 Thread Stefan Thomas
Dear David,
thanks for Your reply.
Unfortunately, none of your suggestions have brought the desired result!
Best,
Stefan

Am Mo., 3. Juni 2024 um 03:19 Uhr schrieb David Wright <
lily...@lionunicorn.co.uk>:

> On Sun 02 Jun 2024 at 16:10:56 (+0200), Stefan Thomas wrote:
> > again, I'm trying to activate point and click in gvim. I made a little
> > success:
> > I wrote in the editor options of okular:
> > gvim --remote-silent +%l %f +normal! %c
> > When I click on a note, the right document is opened and the cursor is
> > placed at the correct line, but not at the correct note in the lilypond
> > file.
> > What can I do?
>
> Perhaps the command you're trying to invoke is, for example:
>
>   gvim --remote-silent +:123:norm45l path-to-file
>
> using literal constants for line number 123 and column 45.
>
> Naively, that would mean okular would have something like:
>
>   gvim --remote-silent +:%l:norm%cl %f
>
> but, not being familiar with okular, I can't tell how it would
> handle %cl (where l means move to the right by %c columns) and
> whether it would need any quoting. For example,
>
>   gvim --remote-silent '+:%l:norm%c l' %f
>
> might work better.
>
> Cheers,
> David.
>


Re: gvim point and click

2024-06-02 Thread David Wright
On Sun 02 Jun 2024 at 16:10:56 (+0200), Stefan Thomas wrote:
> again, I'm trying to activate point and click in gvim. I made a little
> success:
> I wrote in the editor options of okular:
> gvim --remote-silent +%l %f +normal! %c
> When I click on a note, the right document is opened and the cursor is
> placed at the correct line, but not at the correct note in the lilypond
> file.
> What can I do?

Perhaps the command you're trying to invoke is, for example:

  gvim --remote-silent +:123:norm45l path-to-file

using literal constants for line number 123 and column 45.

Naively, that would mean okular would have something like:

  gvim --remote-silent +:%l:norm%cl %f

but, not being familiar with okular, I can't tell how it would
handle %cl (where l means move to the right by %c columns) and
whether it would need any quoting. For example,

  gvim --remote-silent '+:%l:norm%c l' %f

might work better.

Cheers,
David.



gvim point and click

2024-06-02 Thread Stefan Thomas
Dear community,
again, I'm trying to activate point and click in gvim. I made a little
success:
I wrote in the editor options of okular:
gvim --remote-silent +%l %f +normal! %c
When I click on a note, the right document is opened and the cursor is
placed at the correct line, but not at the correct note in the lilypond
file.
What can I do?
Thanks for Your help,
Stefan


Re: Point and click - permission denied

2024-03-22 Thread Tom Brennan
Ok, I just noticed that the binary location is wrong -- and I have
more than one install on this computer, so I'm going to remove both
and start with the latest version and see what happens.

On Fri, Mar 22, 2024 at 10:20 AM Tom Brennan  wrote:
>
> BTW, for what it's worth it does still seem to be an apparmor issue.
> The output from dmesg is
>
> ```
> [ 8087.871623] audit: type=1400 audit(177091.247:143):
> apparmor="DENIED" operation="exec" profile="/usr/bin/evince"
> name="/usr/local/bin/lilypond-wrapper.guile" pid=65082 comm="sh"
> requested_mask="x" denied_mask="x" fsuid=1000 ouid=0
> [ 8087.871694] audit: type=1400 audit(177091.247:144):
> apparmor="DENIED" operation="exec" profile="/usr/bin/evince"
> name="/usr/bin/lilypond-invoke-editor" pid=65082 comm="sh"
> requested_mask="x" denied_mask="x" fsuid=1000 ouid=0
> [ 8087.871698] audit: type=1400 audit(177091.247:145):
> apparmor="DENIED" operation="exec" profile="/usr/bin/evince"
> name="/usr/bin/lilypond-invoke-editor" pid=65082 comm="sh"
> requested_mask="x" denied_mask="x" fsuid=1000 ouid=0
> ```
>
> On Fri, Mar 22, 2024 at 9:19 AM Tom Brennan  wrote:
> >
> > Hello
> >
> > (Note: this email uses markdown formatting.)
> >
> > It's been a while since I've used lilypond, and I had point and click
> > working on another system, but I can't remember what I did. I do
> > remember there were hiccups. Also, it was probably Arch Linux and now
> > the distro I'm using is Ubuntu 22.04, Lilypond version 2.22.2.
> >
> > I want to set up point and click with VS Code, ultimately, and I open
> > the pdf from a terminal emulator with xdg-open (I believe the app that
> > opens it is called "evince" but it just displays "Document Viewer".
> >
> > First I updated the `LYEDITOR` to point to VS Code with its required
> > CLI arguments.
> >
> > ```
> > ~/Workspace/my-lilypond-project$ lilypond main.ly
> > ~/Workspace/my-lilypond-project$ xdg-open main.pdf
> > ~/Workspace/my-lilypond-project$ export LYEDITOR="code --goto
> > %(file)s:%(line)s:%(column)s"
> > ```
> >
> > From there I right-clicked a clickable thing and copied its address to
> > try it out with the CLI:
> >
> > ```
> > ~/Workspace/my-lilypond-project$ lilypond-invoke-editor
> > textedit:///home/tjb1982/Workspace/my-lilypond-project/./movement-foo/cello.ly:27:107:108
> > ```
> >
> > And this worked as expected, so then I went to configure xdg-mime to
> > handle the `x-scheme-handler/textedit` mimetype as per the docs
> > [here](https://lilypond.org/doc/v2.25/Documentation/usage/using-gnome-for-point-and-click).
> >
> > ```shell
> > ~/Workspace/my-lilypond-project$ cd /tmp
> > /tmp$ cat <<_EOF > lilypond-invoke-editor.desktop
> > [Desktop Entry]
> > Version=1.0
> > Name=lilypond-invoke-editor
> > GenericName=Textedit URI handler
> > Comment=URI handler for textedit:
> > Exec=lilypond-invoke-editor %u
> > Terminal=false
> > Type=Application
> > MimeType=x-scheme-handler/textedit;
> > Categories=Editor
> > NoDisplay=true
> > _EOF
> > /tmp$ xdg-desktop-menu install ./lilypond-invoke-editor.desktop
> > /tmp$ xdg-mime default lilypond-invoke-editor.desktop 
> > x-scheme-handler/textedit
> > /tmp$ cd -
> > ~/Workspace/my-lilypond-project$ lilypond main.ly
> > ~/Workspace/my-lilypond-project$ xdg-open main.pdf
> > ```
> >
> > From here, clicking on a clickable item in the pdf results in the
> > console logging:
> >
> > ```
> > sh: 1: exec: lilypond-invoke-editor: Permission denied
> > ```
> >
> > I found the thread
> > [here](https://lists.gnu.org/archive/html/lilypond-user/2019-02/msg00276.html)
> > where David Sumbler figured out some required configuration for
> > apparmor and evince, so I tried to follow the same process. I already
> > had a file at `/etc/apparmor.d/usr.bin.evince`, so I edited the
> > `/usr/bin/evince` section of the file like this:
> >
> > ```
> > /usr/bin/evince {
> >   ...
> >   /usr/local/bin/lilypond-invoke-editor Cx -> sanitized_helper,
> > }
> > ```
> >
> > I ran the parser, double-checked that this is the actual location of
> > `lilypond-invoke-editor`, and restarted the apparmor service:
> >
> > ```
> > ~$ sudo apparmor_parser -r -T -W /etc/apparmor.d/usr.b

Re: Point and click - permission denied

2024-03-22 Thread Tom Brennan
BTW, for what it's worth it does still seem to be an apparmor issue.
The output from dmesg is

```
[ 8087.871623] audit: type=1400 audit(177091.247:143):
apparmor="DENIED" operation="exec" profile="/usr/bin/evince"
name="/usr/local/bin/lilypond-wrapper.guile" pid=65082 comm="sh"
requested_mask="x" denied_mask="x" fsuid=1000 ouid=0
[ 8087.871694] audit: type=1400 audit(177091.247:144):
apparmor="DENIED" operation="exec" profile="/usr/bin/evince"
name="/usr/bin/lilypond-invoke-editor" pid=65082 comm="sh"
requested_mask="x" denied_mask="x" fsuid=1000 ouid=0
[ 8087.871698] audit: type=1400 audit(177091.247:145):
apparmor="DENIED" operation="exec" profile="/usr/bin/evince"
name="/usr/bin/lilypond-invoke-editor" pid=65082 comm="sh"
requested_mask="x" denied_mask="x" fsuid=1000 ouid=0
```

On Fri, Mar 22, 2024 at 9:19 AM Tom Brennan  wrote:
>
> Hello
>
> (Note: this email uses markdown formatting.)
>
> It's been a while since I've used lilypond, and I had point and click
> working on another system, but I can't remember what I did. I do
> remember there were hiccups. Also, it was probably Arch Linux and now
> the distro I'm using is Ubuntu 22.04, Lilypond version 2.22.2.
>
> I want to set up point and click with VS Code, ultimately, and I open
> the pdf from a terminal emulator with xdg-open (I believe the app that
> opens it is called "evince" but it just displays "Document Viewer".
>
> First I updated the `LYEDITOR` to point to VS Code with its required
> CLI arguments.
>
> ```
> ~/Workspace/my-lilypond-project$ lilypond main.ly
> ~/Workspace/my-lilypond-project$ xdg-open main.pdf
> ~/Workspace/my-lilypond-project$ export LYEDITOR="code --goto
> %(file)s:%(line)s:%(column)s"
> ```
>
> From there I right-clicked a clickable thing and copied its address to
> try it out with the CLI:
>
> ```
> ~/Workspace/my-lilypond-project$ lilypond-invoke-editor
> textedit:///home/tjb1982/Workspace/my-lilypond-project/./movement-foo/cello.ly:27:107:108
> ```
>
> And this worked as expected, so then I went to configure xdg-mime to
> handle the `x-scheme-handler/textedit` mimetype as per the docs
> [here](https://lilypond.org/doc/v2.25/Documentation/usage/using-gnome-for-point-and-click).
>
> ```shell
> ~/Workspace/my-lilypond-project$ cd /tmp
> /tmp$ cat <<_EOF > lilypond-invoke-editor.desktop
> [Desktop Entry]
> Version=1.0
> Name=lilypond-invoke-editor
> GenericName=Textedit URI handler
> Comment=URI handler for textedit:
> Exec=lilypond-invoke-editor %u
> Terminal=false
> Type=Application
> MimeType=x-scheme-handler/textedit;
> Categories=Editor
> NoDisplay=true
> _EOF
> /tmp$ xdg-desktop-menu install ./lilypond-invoke-editor.desktop
> /tmp$ xdg-mime default lilypond-invoke-editor.desktop 
> x-scheme-handler/textedit
> /tmp$ cd -
> ~/Workspace/my-lilypond-project$ lilypond main.ly
> ~/Workspace/my-lilypond-project$ xdg-open main.pdf
> ```
>
> From here, clicking on a clickable item in the pdf results in the
> console logging:
>
> ```
> sh: 1: exec: lilypond-invoke-editor: Permission denied
> ```
>
> I found the thread
> [here](https://lists.gnu.org/archive/html/lilypond-user/2019-02/msg00276.html)
> where David Sumbler figured out some required configuration for
> apparmor and evince, so I tried to follow the same process. I already
> had a file at `/etc/apparmor.d/usr.bin.evince`, so I edited the
> `/usr/bin/evince` section of the file like this:
>
> ```
> /usr/bin/evince {
>   ...
>   /usr/local/bin/lilypond-invoke-editor Cx -> sanitized_helper,
> }
> ```
>
> I ran the parser, double-checked that this is the actual location of
> `lilypond-invoke-editor`, and restarted the apparmor service:
>
> ```
> ~$ sudo apparmor_parser -r -T -W /etc/apparmor.d/usr.bin.evince
> ~$ echo $?
> 0
> ~$ which lilypond-invoke-editor
> /usr/local/bin/lilypond-invoke-editor
> ~$ sudo systemctl restart apparmor
> ~$ sudo systemctl status apparmor
> ● apparmor.service - Load AppArmor profiles
>  Loaded: loaded (/lib/systemd/system/apparmor.service; enabled;
> vendor preset: enabled)
>  Active: active (exited) since Fri 2024-03-22 09:12:02 EDT; 1s ago
>Docs: man:apparmor(7)
>  https://gitlab.com/apparmor/apparmor/wikis/home/
> Process: 24362 ExecStart=/lib/apparmor/apparmor.systemd reload
> (code=exited, status=0/SUCCESS)
>Main PID: 24362 (code=exited, status=0/SUCCESS)
> CPU: 161ms
>
> Mar 22 09:12:02 chester systemd[1]: Starting Load

Point and click - permission denied

2024-03-22 Thread Tom Brennan
Hello

(Note: this email uses markdown formatting.)

It's been a while since I've used lilypond, and I had point and click
working on another system, but I can't remember what I did. I do
remember there were hiccups. Also, it was probably Arch Linux and now
the distro I'm using is Ubuntu 22.04, Lilypond version 2.22.2.

I want to set up point and click with VS Code, ultimately, and I open
the pdf from a terminal emulator with xdg-open (I believe the app that
opens it is called "evince" but it just displays "Document Viewer".

First I updated the `LYEDITOR` to point to VS Code with its required
CLI arguments.

```
~/Workspace/my-lilypond-project$ lilypond main.ly
~/Workspace/my-lilypond-project$ xdg-open main.pdf
~/Workspace/my-lilypond-project$ export LYEDITOR="code --goto
%(file)s:%(line)s:%(column)s"
```

>From there I right-clicked a clickable thing and copied its address to
try it out with the CLI:

```
~/Workspace/my-lilypond-project$ lilypond-invoke-editor
textedit:///home/tjb1982/Workspace/my-lilypond-project/./movement-foo/cello.ly:27:107:108
```

And this worked as expected, so then I went to configure xdg-mime to
handle the `x-scheme-handler/textedit` mimetype as per the docs
[here](https://lilypond.org/doc/v2.25/Documentation/usage/using-gnome-for-point-and-click).

```shell
~/Workspace/my-lilypond-project$ cd /tmp
/tmp$ cat <<_EOF > lilypond-invoke-editor.desktop
[Desktop Entry]
Version=1.0
Name=lilypond-invoke-editor
GenericName=Textedit URI handler
Comment=URI handler for textedit:
Exec=lilypond-invoke-editor %u
Terminal=false
Type=Application
MimeType=x-scheme-handler/textedit;
Categories=Editor
NoDisplay=true
_EOF
/tmp$ xdg-desktop-menu install ./lilypond-invoke-editor.desktop
/tmp$ xdg-mime default lilypond-invoke-editor.desktop x-scheme-handler/textedit
/tmp$ cd -
~/Workspace/my-lilypond-project$ lilypond main.ly
~/Workspace/my-lilypond-project$ xdg-open main.pdf
```

>From here, clicking on a clickable item in the pdf results in the
console logging:

```
sh: 1: exec: lilypond-invoke-editor: Permission denied
```

I found the thread
[here](https://lists.gnu.org/archive/html/lilypond-user/2019-02/msg00276.html)
where David Sumbler figured out some required configuration for
apparmor and evince, so I tried to follow the same process. I already
had a file at `/etc/apparmor.d/usr.bin.evince`, so I edited the
`/usr/bin/evince` section of the file like this:

```
/usr/bin/evince {
  ...
  /usr/local/bin/lilypond-invoke-editor Cx -> sanitized_helper,
}
```

I ran the parser, double-checked that this is the actual location of
`lilypond-invoke-editor`, and restarted the apparmor service:

```
~$ sudo apparmor_parser -r -T -W /etc/apparmor.d/usr.bin.evince
~$ echo $?
0
~$ which lilypond-invoke-editor
/usr/local/bin/lilypond-invoke-editor
~$ sudo systemctl restart apparmor
~$ sudo systemctl status apparmor
● apparmor.service - Load AppArmor profiles
 Loaded: loaded (/lib/systemd/system/apparmor.service; enabled;
vendor preset: enabled)
 Active: active (exited) since Fri 2024-03-22 09:12:02 EDT; 1s ago
   Docs: man:apparmor(7)
 https://gitlab.com/apparmor/apparmor/wikis/home/
Process: 24362 ExecStart=/lib/apparmor/apparmor.systemd reload
(code=exited, status=0/SUCCESS)
   Main PID: 24362 (code=exited, status=0/SUCCESS)
CPU: 161ms

Mar 22 09:12:02 chester systemd[1]: Starting Load AppArmor profiles...
Mar 22 09:12:02 chester apparmor.systemd[24362]: Restarting AppArmor
Mar 22 09:12:02 chester apparmor.systemd[24362]: Reloading AppArmor profiles
Mar 22 09:12:02 chester apparmor.systemd[24379]: Skipping profile in
/etc/apparmor.d/disable: usr.sbin.rsyslogd
Mar 22 09:12:02 chester systemd[1]: Finished Load AppArmor profiles.
```

This didn't change anything (still getting the permission denied error
when clicking).

I also tried to stop the apparmor service and then reboot

```
~$ sudo systemctl stop apparmor
~$ sudo systemctl disable apparmor
```

This didn't have any effect. What should I try next?

Thanks,
Tom



Re: LSR 1169 issue: missing point-and-click

2023-06-21 Thread Jean Abou Samra
Le mardi 20 juin 2023 à 11:43 +0200, Simon Albrecht a écrit :
> Hello everyone,
> 
> it’s great to have LSR 1169 and it seems to be working as it should—many 
> thanks to Jean Abou Samra and Werner Lemberg!
> 
> However I’m sorry to write this mail because there is one issue I found 
> ;) Any syllable but the last in a word doesn’t have point-and-click the 
> way it is implemented now. Maybe there’s a way to generate a transparent 
> markup just for point-and-click on the other syllables? I might be able 
> to work on this at some time, but I can’t say when, so in case someone™ 
> wants to pick it up, I make it known here :)



Well...

There is no silver bullet here. In the original snippet I wrote, when two 
syllables are squashed, they would still be typeset separately, and then 
printed adjacently. Werner improved the snippet to
make it typeset the two syllables together as a single run of text instead 
(with \concat), in order to enable font ligatures — and complex text layout, 
for languages where this is applicable — between
the two syllables. But it might be fiddly, after making Pango lay out the 
combined text with ligatures, to extract back the parts. Off the top, I *think* 
it's possible (I'd have to check how to tell
Pango to force an itemization boundary at a given point; I think it can do 
that, since it's also able to render arbitrary parts of the text in a different 
color), but I'm pretty sure it requires new
C++ code.

In the very short term (i.e., what can we do in Scheme that works in 2.24), I'm 
afraid the only available improvement would be to make the whole syllable link 
back to one of the input syllables in the
code, and giving up on having point-and-click separate the syllables.

By the way, this problem is more general, since it also affects properties like 
color and whiteout. (There's a reason it's in LSR and not in LilyPond proper 
yet.)


signature.asc
Description: This is a digitally signed message part


LSR 1169 issue: missing point-and-click

2023-06-20 Thread Simon Albrecht

Hello everyone,

it’s great to have LSR 1169 and it seems to be working as it should—many 
thanks to Jean Abou Samra and Werner Lemberg!


However I’m sorry to write this mail because there is one issue I found 
;) Any syllable but the last in a word doesn’t have point-and-click the 
way it is implemented now. Maybe there’s a way to generate a transparent 
markup just for point-and-click on the other syllables? I might be able 
to work on this at some time, but I can’t say when, so in case someone™ 
wants to pick it up, I make it known here :)


Best regards,
Simon



Re: Sublime Text and point and click

2023-05-05 Thread Kenneth Flak


Cool!

If you want to get autocomplete working though, then you might have to engage 
in some voodoo, depending on which completion engine you're using. I use 
nvim-cmp, which makes it necessary to enlist the cmp-dicitionary source, and 
specify all the dictionary files in the configuration:

require('cmp_dictionary').switcher({
 filetype = {
 lilypond = {
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/grobs",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/keywords",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/musicFunctions",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/articulations",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/grobProperties",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/paperVariables",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/headerVariables",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/contextProperties",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/clefs",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/repeatTypes",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/languageNames",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/accidentalsStyles",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/scales",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/musicCommands",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/markupCommands",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/contextsCmd",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/dynamics",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/contexts",
 
"~/.local/share/nvim/site/pack/packer/start/nvim-lilypond-suite/lilywords/translators",
 }
 }
})

... and setting `dictionary` as a completion source in the cmp.setup function...

I also highly recommend setting up one of the many snippet plugins.

Best,
Kenneth

-- 
Roosna & Flak - Contemporary Dance & Music
Web: roosnaflak.com
Code: {github,gitlab}.com/kflak
Mastodon: @k...@sonomu.club
On  6 May 2023  01:02, Andrew Bernard wrote:
>No - this is great. By no means hijacked. I'll go with that. Thanks! I
>only bring up Sublime Text because I couldn;t find the relevant neovim
>documentation.
>
>Neovim is pretty good.
>
>Andrew
>
>
>On 6/05/2023 12:56 am, Kenneth Flak wrote:
>> As a matter of fact, I tried the neovim-remote version now. It's pretty 
>> straightforward to set up, and it works! Sorry to hijack the sublime text 
>> thread, but since y'all were already going on about gvim, I thought I'd butt 
>> in :-)
>




Re: Sublime Text and point and click

2023-05-05 Thread Andrew Bernard
No - this is great. By no means hijacked. I'll go with that. Thanks! I 
only bring up Sublime Text because I couldn;t find the relevant neovim 
documentation.


Neovim is pretty good.

Andrew


On 6/05/2023 12:56 am, Kenneth Flak wrote:

As a matter of fact, I tried the neovim-remote version now. It's pretty 
straightforward to set up, and it works! Sorry to hijack the sublime text 
thread, but since y'all were already going on about gvim, I thought I'd butt in 
:-)




Re: Sublime Text and point and click

2023-05-05 Thread Andrew Bernard
It's a gvim issue as I have said before on this list. It's been 
outstanding for years despite me mentioning it on their forum. Nothing 
to do with lilypond. It';s obscure as far as gvim is concerned, so it 
won't get fixed.



Andrew


On 6/05/2023 12:40 am, Christ van Willegen wrote:

(Also to the list this time...)

Op vr 5 mei 2023 16:18 schreef Andrew Bernard 
:

Gvim works but is buggy.

Would you mind filing a bug report then?

Christ van Willegen

Re: Sublime Text and point and click

2023-05-05 Thread Kenneth Flak
As a matter of fact, I tried the neovim-remote version now. It's pretty 
straightforward to set up, and it works! Sorry to hijack the sublime text 
thread, but since y'all were already going on about gvim, I thought I'd butt in 
:-)

Best,
Kenneth

-- 
Roosna & Flak - Contemporary Dance & Music
Web: roosnaflak.com
Code: {github,gitlab}.com/kflak
Mastodon: @k...@sonomu.club
On  5 May 2023  14:50, Kenneth Flak wrote:
>
>Haven't tested point and click yet with neovim (using the excellent 
>nvim-lilypond suite), but there's a section in the wiki outlining a couple of 
>strategies on how to make it work: 
>https://github.com/martineausimon/nvim-lilypond-suite/wiki/2.-Configuration#point-and-click
>
>
>--
>Roosna & Flak - Contemporary Dance & Music
>Web: roosnaflak.com
>Code: {github,gitlab}.com/kflak
>Mastodon: @k...@sonomu.club
>On  5 May 2023  16:40, Christ van Willegen wrote:
>>(Also to the list this time...)
>>
>>Op vr 5 mei 2023 16:18 schreef Andrew Bernard :
>>Gvim works but is buggy.
>>
>>Would you mind filing a bug report then?
>>
>>Christ van Willegen
>
>




Re: Sublime Text and point and click

2023-05-05 Thread Kenneth Flak


Haven't tested point and click yet with neovim (using the excellent 
nvim-lilypond suite), but there's a section in the wiki outlining a couple of 
strategies on how to make it work: 
https://github.com/martineausimon/nvim-lilypond-suite/wiki/2.-Configuration#point-and-click


-- 
Roosna & Flak - Contemporary Dance & Music
Web: roosnaflak.com
Code: {github,gitlab}.com/kflak
Mastodon: @k...@sonomu.club
On  5 May 2023  16:40, Christ van Willegen wrote:
>(Also to the list this time...)
>
>Op vr 5 mei 2023 16:18 schreef Andrew Bernard :
>Gvim works but is buggy.
>
>Would you mind filing a bug report then?
>
>Christ van Willegen




Re: Sublime Text and point and click

2023-05-05 Thread Christ van Willegen
(Also to the list this time...)

Op vr 5 mei 2023 16:18 schreef Andrew Bernard :
Gvim works but is buggy.

Would you mind filing a bug report then?

Christ van Willegen


Re: Sublime Text and point and click

2023-05-05 Thread Andrew Bernard
You can use editors with point and click. There's a section on it in the 
NR. The PDF's contains textedit links that editors can respond to in 
order to position the cursor on the line and column. So you have two way 
editing like Frescobaldi, which use the same PDF links. It used to work 
well with Atom, but that is now discontinued. Although I am a long term 
of user of emacs which also works, I don't like the buggy lilypond mode 
(altho nobody is forcing me to use the mode). Gvim works but is buggy. I 
was hoping Sublime Text may be able to work in server mode like these 
other editors and seeking people's experience.


https://lilypond.org/doc/v2.24/Documentation/usage/point-and-click

[Why don't I just use Frescobaldi? It hangs on my very large and complex 
scores, and has done so for years, but that is a different topic.]


[My context is Linux.]

Andrew


On 5/05/2023 11:02 pm, AHF wrote:

I have used Sublime Text for years. It’s my everyday text editor. But I don’t 
understand your question? What are you trying to do?





Re: Sublime Text and point and click

2023-05-05 Thread AHF
Andrew

I have used Sublime Text for years. It’s my everyday text editor. But I don’t 
understand your question? What are you trying to do?

Andrew Culver


> On May 5, 2023, at 5:43 AM, Andrew Bernard  wrote:
> 
> Has anybody been able to use Sublime Text with point and click?
> 
> Their documentation does not seem to mention it, and I have asked on the 
> forum,
> 
> 
> 
> 




Sublime Text and point and click

2023-05-05 Thread Andrew Bernard

Has anybody been able to use Sublime Text with point and click?

Their documentation does not seem to mention it, and I have asked on the 
forum,







Re: Point and click with gvim under Fedora 38

2023-05-02 Thread Andrew Bernard
As said, I have 30-40 include files. And lilypond compiles fines, albeit 
slowly as it is single threaded. It's Frescobaldi that is slow. I can 
live without Frescobaldi, but I do really like two way point and click.


Andrew


On 2/05/2023 11:11 pm, Jeff Kopmanis wrote:
You should look into include files if you've got that much code.  
Lilipond can handle it, and it'll make your project much more managable.






Re: Point and click with gvim under Fedora 38

2023-05-02 Thread Jeff Kopmanis
You should look into include files if you've got that much code.  Lilipond
can handle it, and it'll make your project much more managable.

On Tue, May 2, 2023, 8:58 AM Andrew Bernard 
wrote:

> The work is about 40,000 lines of lilypond code, but split into about ten
> sections. There are only about 30 include files. Frescobaldi is unusable,
> then and still now. Of the order of 30 seconds to do any operation, on a
> linux VM on a very fast computer. I will say that the score is a work of
> the New Complexity School by my colleague and the music is pretty dense,
> and I think this may have something to do with it (altho as I write that it
> sounds stupid).
>
> I'm sorry to say this is why  I had to move over to Dorico. But I need to
> complete this work in Lilypond and hence I am back to looking for a good
> working environment again.
>
> Andrew
>
>
> On 2/05/2023 8:37 pm, Federico Bruni wrote:
>
> This is:
> https://github.com/frescobaldi/frescobaldi/issues/473
>
> ...
>
> I don't have a large score to do a test.
>
>


Re: Point and click with gvim under Fedora 38

2023-05-02 Thread Andrew Bernard
The issue thread does not explain what the output document variable is. 
What is it and how do you set it?


I don't think this issue has been fixed, from what I read. It would be 
nice if it were.


Andrew

On 2/05/2023 8:37 pm, Federico Bruni wrote:
Il giorno mar 2 mag 2023 alle 19:30:46 +1000, Andrew Bernard 
 ha scritto:
Trying to use gvim, due to the problem that Frescobaldi becomes 
unreasonably sluggish with my very large scores, no matter what 
clever tricks I use to chop them up.


This is:
https://github.com/frescobaldi/frescobaldi/issues/473

Wilbert suggested a workaround:

"""
the freeze happens because Frescobaldi looks in all the included 
documents for things like set output-suffix etc. You can avoid this by 
setting the output document variable.

"""

I don't have a large score to do a test.


Re: Point and click with gvim under Fedora 38

2023-05-02 Thread Andrew Bernard
The work is about 40,000 lines of lilypond code, but split into about 
ten sections. There are only about 30 include files. Frescobaldi is 
unusable, then and still now. Of the order of 30 seconds to do any 
operation, on a linux VM on a very fast computer. I will say that the 
score is a work of the New Complexity School by my colleague and the 
music is pretty dense, and I think this may have something to do with it 
(altho as I write that it sounds stupid).


I'm sorry to say this is why  I had to move over to Dorico. But I need 
to complete this work in Lilypond and hence I am back to looking for a 
good working environment again.


Andrew


On 2/05/2023 8:37 pm, Federico Bruni wrote:

This is:
https://github.com/frescobaldi/frescobaldi/issues/473

...

I don't have a large score to do a test.


Re: Point and click with gvim under Fedora 38

2023-05-02 Thread Andrew Bernard
From work on this in the past, it's a gvim issue. Nothing to do with 
lilypond. Don't spend any time on it. When following this a few years 
ago various gvim forums indicated this is a kind of difficulty, not 
exactly a bug.


I just thought I can't be the only one in the world wanting to use gvim 
on Fedora with lilypond pDF point and click. Perhaps I am!


The unwanted junk is unintelligible lines of gvim internal 
program/macro/function code at the status line area.



Andrew


On 2/05/2023 7:57 pm, Jean Abou Samra wrote:


What did you already do, so we can reproduce?

Can you be more specific on your problem? What's the “unwanted junk”?


Re: Point and click with gvim under Fedora 38

2023-05-02 Thread Federico Bruni
Il giorno mar 2 mag 2023 alle 19:30:46 +1000, Andrew Bernard 
 ha scritto:
Trying to use gvim, due to the problem that Frescobaldi becomes 
unreasonably sluggish with my very large scores, no matter what 
clever tricks I use to chop them up.


This is:


Wilbert suggested a workaround:

"""
the freeze happens because Frescobaldi looks in all the included 
documents for things like set output-suffix etc. You can avoid this by 
setting the output document variable.

"""

I don't have a large score to do a test.




Re: Point and click with gvim under Fedora 38

2023-05-02 Thread Jean Abou Samra
Le mardi 02 mai 2023 à 17:44 +1000, Andrew Bernard a écrit :
> A few years ago I penned a guide to getting lilypond PDF point and click 
> going with gvim under Ubuntu.
> 
> Time has moved on and that guide is no longer right for Fedora 38.
> 
> Does anybody have gvim going with Fedora and if so, could they outline 
> some pointers?
> 
> It sort of works but shows unwanted junk at the bottom of the window, 
> worse than it used to in Ubuntu.



What did you already do, so we can reproduce?

Can you be more specific on your problem? What's the “unwanted junk”?



signature.asc
Description: This is a digitally signed message part


Re: Point and click with gvim under Fedora 38

2023-05-02 Thread Andrew Bernard
Fedora 38, Gnome 44, Evince works fine. No problem at all and nothing to 
configure. That's the environment.


Trying to use gvim, due to the problem that Frescobaldi becomes 
unreasonably sluggish with my very large scores, no matter what clever 
tricks I use to chop them up.


I have been using emacs since forever, but as far as I know the lilypond 
mode is _still_ very buggy and I don't know enough to fix it.



Andrew


On 2/05/2023 6:37 pm, Federico Bruni wrote:
IIRC Evince (GNOME) doesn't allow point and click anymore. Maybe 
there's a way to unlock it, but I'm not motivated to investigate.

Which desktop environment and PDF viewer are you using?

Re: Point and click with gvim under Fedora 38

2023-05-02 Thread Federico Bruni



Il giorno mar 2 mag 2023 alle 17:44:04 +1000, Andrew Bernard 
 ha scritto:
A few years ago I penned a guide to getting lilypond PDF point and 
click going with gvim under Ubuntu.


Time has moved on and that guide is no longer right for Fedora 38.

Does anybody have gvim going with Fedora and if so, could they 
outline some pointers?


It sort of works but shows unwanted junk at the bottom of the window, 
worse than it used to in Ubuntu.




IIRC Evince (GNOME) doesn't allow point and click anymore. Maybe 
there's a way to unlock it, but I'm not motivated to investigate.


Which desktop environment and PDF viewer are you using?




Point and click with gvim under Fedora 38

2023-05-02 Thread Andrew Bernard
A few years ago I penned a guide to getting lilypond PDF point and click 
going with gvim under Ubuntu.


Time has moved on and that guide is no longer right for Fedora 38.

Does anybody have gvim going with Fedora and if so, could they outline 
some pointers?


It sort of works but shows unwanted junk at the bottom of the window, 
worse than it used to in Ubuntu.



Andrew





Re: Question about paths in point-and-click

2022-11-01 Thread Jean Abou Samra

Le 01/11/2022 à 05:54, David Wright a écrit :

On Tue 01 Nov 2022 at 02:23:23 (+0100), Paolo Prete wrote:

Neverthless, IMHO this feature should be exposed in the API, because the
lack of control of personal data should not be a trade-off for using an
appealing feature such as the point-and-click one

I'd agree with that.



Yes, looks like a valid request. I've opened an issue about it:

https://gitlab.com/lilypond/lilypond/-/issues/6451

Best,
Jean




Re: Question about paths in point-and-click

2022-10-31 Thread David Wright
On Tue 01 Nov 2022 at 02:23:23 (+0100), Paolo Prete wrote:
> I need to change them.
> More specifically, each:
> 
> xlink:href="textedit:///some/personal/path/file.ly:x:y:z"
> 
> should be changed into
> 
> xlink:href="textedit:///dummy/path/file.ly:x:y:z"
> 
> For all the grobs with such metadata (SVG)
> 
> Anyway, with 4 lines of python postprocess code I did the operation, so,
> never mind: all solved.
> 
> Neverthless, IMHO this feature should be exposed in the API, because the
> lack of control of personal data should not be a trade-off for using an
> appealing feature such as the point-and-click one

I'd agree with that. I run by default with p turned off, to avoid
accidents when distributing scores. But with p on, I just compiled
a score from ~/scores/fragments/random-score.ly, copied the source
and PDF output into /tmp, and then ran:

$ sed -i -e 's+textedit:///home/auser/scores/fragments+textedit://.+' 
/tmp/random-score.pdf 

after which, clicking in random-score.pdf points to the correct
position in random-score.ly as long as both source and PDF are in the
same, arbitrary current working directory. Only the last component
of the path is exposed, ie   textedit://.random-score.ly:99:7:8
(I hadn't tried using a relative path before.)

Cheers,
David.



Re: Question about paths in point-and-click

2022-10-31 Thread Paolo Prete
I need to change them.
More specifically, each:

xlink:href="textedit:///some/personal/path/file.ly:x:y:z"

should be changed into

xlink:href="textedit:///dummy/path/file.ly:x:y:z"

For all the grobs with such metadata (SVG)

Anyway, with 4 lines of python postprocess code I did the operation, so,
never mind: all solved.

Neverthless, IMHO this feature should be exposed in the API, because the
lack of control of personal data should not be a trade-off for using an
appealing feature such as the point-and-click one

Best,
Paolo



On Monday, October 31, 2022, Jean Abou Samra  wrote:

>
>
> Wait — by "clean up", do you mean changing them or removing them?
> If the latter, *that* can be done cleanly; which grobs should
> be affected?
>
> Best,
> Jean
>
>


Re: Question about paths in point-and-click

2022-10-31 Thread Jean Abou Samra

Le 31/10/2022 à 18:35, Paolo Prete a écrit :

BTW,

for unknown reasons your mails always go to the spam folder. I don't 
experience the same issue with other members of the ml, and I don't 
understand if the issue is on my account or on yours...




Unfortunately, some people using GMail get my emails in their
spams because GMail's spam filter seems to be particularly
wary of emails from personal domains (for me, abou-samra.fr)
as opposed to commonly used domains for email addresses like
gmail.com, gmx.com, etc. That is actually the case for a number
of people on this list, but maybe abou-samra.fr has some
configuration that makes my emails more suspicious, I don't
really know and I'm not the admin of the domain. Maybe
I should look into DKIM or such to reduce the probability
that a spam filter classifies my emails as spam.

Best,
Jean






Re: Question about paths in point-and-click

2022-10-31 Thread Jean Abou Samra

Le 31/10/2022 à 18:20, Paolo Prete a écrit :


Thank you as always!

In Spontini-Editor there are examples with generated SVG files that 
rely on point-and-click in order to be edited. Although included paths 
are dummy paths, I would like to clean them without post-processing 
the files. But I think I don't have alternatives, given that the 
functions you use are not part of the API (and I need to make this 
operation any supported LilyPond version). I preview I have to do some 
Python postprocess script with regex




Wait — by "clean up", do you mean changing them or removing them?
If the latter, *that* can be done cleanly; which grobs should
be affected?

Best,
Jean




Re: Question about paths in point-and-click

2022-10-31 Thread Paolo Prete
BTW,

for unknown reasons your mails always go to the spam folder. I don't
experience the same issue with other members of the ml, and I don't
understand if the issue is on my account or on yours...

On Monday, October 31, 2022, Paolo Prete  wrote:

>
> Thank you as always!
>
> In Spontini-Editor there are examples with generated SVG files that rely
> on point-and-click in order to be edited. Although included paths are dummy
> paths, I would like to clean them without post-processing the files. But I
> think I don't have alternatives, given that the functions you use are not
> part of the API (and I need to make this operation any supported LilyPond
> version). I preview I have to do some Python postprocess script with regex
>
>
> Cheers,
> Paolo
>
>
> On Monday, October 31, 2022, Jean Abou Samra  wrote:
>
>> Le 31/10/2022 à 17:56, Jean Abou Samra a écrit :
>>
>>> In general, no.
>>>
>>
>>
>> Well, I spoke too fast. You can do
>>
>> \version "2.23.80"
>>
>> #(set!
>>   (@@ (lily output-ps) stencil-dispatch-alist)
>>   (assq-set!
>>(@@ (lily output-ps) stencil-dispatch-alist)
>>'grob-cause
>>(lambda (offset grob)
>>  (if (ly:get-option 'point-and-click)
>>  (let* ((cause (ly:grob-property grob 'cause))
>>     (music-origin (if (ly:stream-event? cause)
>>   (ly:event-property cause 'origin)))
>>         (point-and-click (ly:get-option 'point-and-click)))
>>(if (and
>> (ly:input-location? music-origin)
>> (cond ((boolean? point-and-click) point-and-click)
>>   ((symbol? point-and-click)
>>    (ly:in-event-class? cause point-and-click))
>>   (else (any (lambda (t)
>>(ly:in-event-class? cause t))
>>  point-and-click
>>(let* ((location (ly:input-file-line-char-column
>> music-origin))
>>   (raw-file (car location))
>>   (file (if (is-absolute? raw-file)
>> raw-file
>> (string-append (ly-getcwd) "/"
>> raw-file)))
>>   (x-ext (ly:grob-extent grob grob X))
>>   (y-ext (ly:grob-extent grob grob Y)))
>>
>>  (if (and (< 0 (interval-length x-ext))
>>   (< 0 (interval-length y-ext)))
>>  (ly:format " ~4f ~4f ~4f ~4f
>> (textedit://~a:~a:~a:~a) mark_URI\n"
>> (+ (car offset) (car x-ext))
>> (+ (cdr offset) (car y-ext))
>> (+ (car offset) (cdr x-ext))
>> (+ (cdr offset) (cdr y-ext))
>>
>> ;; Backslashes are not valid
>> ;; file URI path separators.
>> (ly:string-percent-encode
>>  (ly:string-substitute
>> "\\" "/" file))
>> "foo.ly"
>>
>> (cadr location)
>> (caddr location)
>> (1+ (cadddr location)))
>>  ""))
>>""))
>>  ""
>>
>> { c' }
>>
>>
>>
>>
>> Basically, tamper with the LilyPond function that outputs
>> these textedit:// links. In this example, I'm replacing
>> the file name with "foo.ly".
>>
>> However, this is using undocumented variables that are explicitly
>> not public, so you're at your own risk -- it can and almost
>> certainly will break with some future version of LilyPond,
>> and a replacement will not be guaranteed to exist. Also, it
>> would need different code to work in SVG output.
>>
>> If you can use a different method, that would be really preferable.
>>
>> Best,
>> Jean
>>
>>
>>
>>


Re: Question about paths in point-and-click

2022-10-31 Thread Paolo Prete
Thank you as always!

In Spontini-Editor there are examples with generated SVG files that rely on
point-and-click in order to be edited. Although included paths are dummy
paths, I would like to clean them without post-processing the files. But I
think I don't have alternatives, given that the functions you use are not
part of the API (and I need to make this operation any supported LilyPond
version). I preview I have to do some Python postprocess script with regex


Cheers,
Paolo


On Monday, October 31, 2022, Jean Abou Samra  wrote:

> Le 31/10/2022 à 17:56, Jean Abou Samra a écrit :
>
>> In general, no.
>>
>
>
> Well, I spoke too fast. You can do
>
> \version "2.23.80"
>
> #(set!
>   (@@ (lily output-ps) stencil-dispatch-alist)
>   (assq-set!
>(@@ (lily output-ps) stencil-dispatch-alist)
>'grob-cause
>(lambda (offset grob)
>  (if (ly:get-option 'point-and-click)
>  (let* ((cause (ly:grob-property grob 'cause))
> (music-origin (if (ly:stream-event? cause)
>       (ly:event-property cause 'origin)))
> (point-and-click (ly:get-option 'point-and-click)))
>(if (and
>     (ly:input-location? music-origin)
>     (cond ((boolean? point-and-click) point-and-click)
>       ((symbol? point-and-click)
>(ly:in-event-class? cause point-and-click))
>   (else (any (lambda (t)
>    (ly:in-event-class? cause t))
>  point-and-click
>(let* ((location (ly:input-file-line-char-column
> music-origin))
>   (raw-file (car location))
>   (file (if (is-absolute? raw-file)
> raw-file
> (string-append (ly-getcwd) "/" raw-file)))
>   (x-ext (ly:grob-extent grob grob X))
>   (y-ext (ly:grob-extent grob grob Y)))
>
>  (if (and (< 0 (interval-length x-ext))
>   (< 0 (interval-length y-ext)))
>  (ly:format " ~4f ~4f ~4f ~4f (textedit://~a:~a:~a:~a)
> mark_URI\n"
> (+ (car offset) (car x-ext))
> (+ (cdr offset) (car y-ext))
> (+ (car offset) (cdr x-ext))
> (+ (cdr offset) (cdr y-ext))
>
> ;; Backslashes are not valid
> ;; file URI path separators.
> (ly:string-percent-encode
>  (ly:string-substitute
> "\\" "/" file))
> "foo.ly"
>
> (cadr location)
> (caddr location)
> (1+ (cadddr location)))
>  ""))
>""))
>  ""
>
> { c' }
>
>
>
>
> Basically, tamper with the LilyPond function that outputs
> these textedit:// links. In this example, I'm replacing
> the file name with "foo.ly".
>
> However, this is using undocumented variables that are explicitly
> not public, so you're at your own risk -- it can and almost
> certainly will break with some future version of LilyPond,
> and a replacement will not be guaranteed to exist. Also, it
> would need different code to work in SVG output.
>
> If you can use a different method, that would be really preferable.
>
> Best,
> Jean
>
>
>
>


Re: Question about paths in point-and-click

2022-10-31 Thread Jean Abou Samra

Le 31/10/2022 à 17:56, Jean Abou Samra a écrit :

In general, no.



Well, I spoke too fast. You can do

\version "2.23.80"

#(set!
  (@@ (lily output-ps) stencil-dispatch-alist)
  (assq-set!
   (@@ (lily output-ps) stencil-dispatch-alist)
   'grob-cause
   (lambda (offset grob)
 (if (ly:get-option 'point-and-click)
 (let* ((cause (ly:grob-property grob 'cause))
    (music-origin (if (ly:stream-event? cause)
  (ly:event-property cause 'origin)))
        (point-and-click (ly:get-option 'point-and-click)))
   (if (and
    (ly:input-location? music-origin)
    (cond ((boolean? point-and-click) point-and-click)
  ((symbol? point-and-click)
   (ly:in-event-class? cause point-and-click))
  (else (any (lambda (t)
   (ly:in-event-class? cause t))
     point-and-click
   (let* ((location (ly:input-file-line-char-column 
music-origin))

  (raw-file (car location))
  (file (if (is-absolute? raw-file)
    raw-file
    (string-append (ly-getcwd) "/" raw-file)))
  (x-ext (ly:grob-extent grob grob X))
  (y-ext (ly:grob-extent grob grob Y)))

 (if (and (< 0 (interval-length x-ext))
  (< 0 (interval-length y-ext)))
 (ly:format " ~4f ~4f ~4f ~4f 
(textedit://~a:~a:~a:~a) mark_URI\n"

    (+ (car offset) (car x-ext))
    (+ (cdr offset) (car y-ext))
    (+ (car offset) (cdr x-ext))
    (+ (cdr offset) (cdr y-ext))

    ;; Backslashes are not valid
    ;; file URI path separators.
(ly:string-percent-encode
     (ly:string-substitute 
"\\" "/" file))

    "foo.ly"

    (cadr location)
    (caddr location)
    (1+ (cadddr location)))
 ""))
   ""))
 ""

{ c' }




Basically, tamper with the LilyPond function that outputs
these textedit:// links. In this example, I'm replacing
the file name with "foo.ly".

However, this is using undocumented variables that are explicitly
not public, so you're at your own risk -- it can and almost
certainly will break with some future version of LilyPond,
and a replacement will not be guaranteed to exist. Also, it
would need different code to work in SVG output.

If you can use a different method, that would be really preferable.

Best,
Jean





Re: Question about paths in point-and-click

2022-10-31 Thread Jean Abou Samra

Le 31/10/2022 à 17:44, Paolo Prete a écrit :
Is it possible to set/customize the path information in the 
point-and-click metadata of LilyPond's output?



In general, no. There is no such facility. I guess you could 
post-process the PDF to change the links, though.


What are you trying to achieve?


Best,
Jean




Question about paths in point-and-click

2022-10-31 Thread Paolo Prete
Hello,

Is it possible to set/customize the path information in the point-and-click
metadata of LilyPond's output?

Thanks!


Re: Getting point and click going with gvim on Alma Linux

2022-09-06 Thread Andrew Bernard
An update with a solution re gvim with point and click. This would also 
apply to other Linux distros apart from Alma Linux I think.


It turns out the missing comma for the gvim remote command has been 
submitted as a bug report. But the gobbledygook internal message that 
gvim prints and requires you to acknowledge by pressing enter - totally 
unnecessary to see or do - can be fixed by using a different command to 
execute the remote gvim call.


Hence, in libexec/lilypond-invoke-editor the gvim commands line needs to 
be changed to use a call to cursor() and not use the norm command. This 
fixes the problem, and makes gvim nice to use again in this context.


#   "gvim": [("gvim", "--remote", "+:%(line)s:norm%(column)s", "%(file)s")],

=>

 "gvim": [("gvim", "--remote", "+call cursor(%(line)s,%(column)s)", 
"%(file)s")],


So we go from this situation in the first image attachment to the 
correct one in the second attachment, and no 'press ENTER...'.


It took three days full time to figure this out, including having to 
read the source code for vim!


I'll submit a patch for this fix.

Since gvim supports a lilypond syntax file, this is a good solution for 
Lilypond as an alternative to Frescobaldi. I did look into this a few 
years ago when I 'outgrew' Frescobaldi with some really long and complex 
scores and Frescobaldi's response time blew out to unusable levels. I 
think this is still an issue in Frescobaldi. It may not affect all 
users, but gvim can handle files of any length and provides a solution 
to this problem.


I have not read anything much about gvim point and click on Linux on the 
list. Or maybe people put up with the junk message and keypress and 
don't complain about it. How many people use this setup? Maybe one or two!


[Amusingly I am an emacs user but last time I used that there were still 
bad defects in the lilypond code that I am not experienced enough to 
solve, and I think these have still not been attended to, although I may 
be wrong. Hence my interest in gvim for Lilypond.]


Andrew


On 5/09/2022 9:46 am, Andrew Bernard wrote:
In response to the recent thread on alternatives to Frescobaldi on 
Alma Linux I have prepared this set of instructions. I have tested 
this and there are two points in addition to the notes below.


One, I am unable to get rid of the last line of the extensive status 
message gvim shows at the bottom when invoked with a remote call. This 
is puzzling - I am working on it.


Second, in 2.23.12 at least, there is an error, strangely only for 
gvim, in libexec/lilypond-invoke editor. Line 130 is missing a comma, 
and must be updated to:


    "gvim": [("gvim", "--remote", "+:%(line)s:norm%(column)s", 
"%(file)s")],


I have submitted a bug report request about this.


Re: Getting point and click going with gvim on Alma Linux

2022-09-05 Thread Andrew Bernard
Worse, /usr/bin/vim in Alma Linux will not run the --servername option 
as it is built without it. You'd have to build vim from source. Vim on 
Arch Linux is built with that option, I checked. Once more, a 
disadvantage of Alma Linux.


Also, having originally said to use the flatpack version of Frescobaldi, 
for me it is unusable (though it worked once the first time, and not 
thereafter) as it shows all sorts of strange file paths under /run, and 
not my home directory. For me on Alma Linux that is also a failure.


Do not misinterpret me - I think Alma Linux is really excellent. Just 
not in the context of the Lilypond application area.


Andrew





Re: Getting point and click going with gvim on Alma Linux

2022-09-05 Thread Andrew Bernard
This note was to help out with Alma Linux, so I have not tried on other 
distros as yet, but using vim in server mode is a failure as bad as 
emacs. It prints a message correctly claiming input is not from a 
terminal and hangs, and then, weirdly, it hangs evince as well which has 
to be forced to quit. Not exactly a happy state.


That's on vim compiled from the latest source, version 9.0.381.

Personally I don't use Alma Linux, was just doing this for the OP of the 
thread about Frescobaldi alternatives. But I am getting the impression 
that while Alma Linux is a great enterprise class server system, it may 
not be the optimal choice for Lilypond. Nevertheless, I will continue to 
study the matter.


Andrew





Re: Getting point and click going with gvim on Alma Linux

2022-09-05 Thread David Wright
On Tue 06 Sep 2022 at 03:27:46 (+1000), Andrew Bernard wrote:
> 
> I'll incorporate your suggestions. Note that this was specifically
> about gvim not vim, but I can add in vim as well, since it is so
> closely related. There's still stuff here that is not covered in the
> NR,. such as window focus with the mouse that I think is useful.
> However, looking more closely now at the NR it looks like this file
> was a waste of time, as it is all covered the now. [I wonder if some
> bits came from my original screed? :-)] I'm guilty of not reading the
> current NR closely. Incidentally I use EDITOR for everything, not a
> different editor for lilypond, but that's a valid point re LYEDITOR.
> My notes reflect my bias.

I added the note about vim partly because J Martin Rushton
mentioned running it as part of a non-Frescobaldi workflow.

BTW I was interpreting your NR to refer, sensu stricto, to
notation.pdf, and Usage to refer to usage.pdf. It strikes me
that the distinction might not be obvious in the web docs.

I omitted to add that the lilypond-invoke-editor.desktop that
one creates is a scratch file, which can be deleted once the
xdg-* commands have been run. The official LP docs suggest
creating it in /tmp but without mentioning that that usually
results in it being cleaned out at the next boot.

> The gvim annoying error message and press ENTER to continue is still
> not resolved even in version 9 but I am determined to find an answer
> even it it means patching the source code. Currently it really makes
> gvim much less felicitous than it ought to be for this application.
> 
> I don't know if it is worth mentioning but emacs on Alma Linux at
> least totally carks it when used in this manner with emacs as as
> server. But emacs has the courtesy to print out that this is a known
> bug, then promptly dies!

I have in my notes (written when Debian was two versions back):

  $ emacs
  ESC-x server-start

  (Don't run emacs --daemon as this seems to provoke an error
  (or unusual effect) at the present time which is stretch.)

As is well-known, without setting emacs to server-mode, every
point-and-click will open a new instance. However, you can type
ESC-x server-start   at any time in any one emacs instance
(ie only one server in operation at a time).

> But my notes are really redundant since the NR does cover pretty much
> all, so I guess the recommendation can be changed to RTNR. :-)

The boxed note in Usage (§4.1.1 page 43) should carry a warning
that every time, apart from the first, that you try to start a
new instance of emacs (eg to reply to an email, edit a file,
point-and-click, etc), you'll end up with a split screen and
a 4-line warning message—very tedious.

ISTR that we had fun with apparmor last time around. I'll have
to check whether bullseye has been configured such that you don't
notice it, or whether I just haven't set it up to enforce it.
There are always wrinkles.

Cheers,
David.



Re: Getting point and click going with gvim on Alma Linux

2022-09-05 Thread Andrew Bernard

Thanks David,

I'll incorporate your suggestions. Note that this was specifically about 
gvim not vim, but I can add in vim as well, since it is so closely 
related. There's still stuff here that is not covered in the NR,. such 
as window focus with the mouse that I think is useful. However, looking 
more closely now at the NR it looks like this file was a waste of time, 
as it is all covered the now. [I wonder if some bits came from my 
original screed? :-)] I'm guilty of not reading the current NR closely. 
Incidentally I use EDITOR for everything, not a different editor for 
lilypond, but that's a valid point re LYEDITOR. My notes reflect my bias.


The gvim annoying error message and press ENTER to continue is still not 
resolved even in version 9 but I am determined to find an answer even it 
it means patching the source code. Currently it really makes gvim much 
less felicitous than it ought to be for this application.


I don't know if it is worth mentioning but emacs on Alma Linux at least 
totally carks it when used in this manner with emacs as as server. But 
emacs has the courtesy to print out that this is a known bug, then 
promptly dies!


But my notes are really redundant since the NR does cover pretty much 
all, so I guess the recommendation can be changed to RTNR. :-)


Andrew






Re: Getting point and click going with gvim on Alma Linux

2022-09-05 Thread David Wright
Just some jottings for your consideration.

On Mon 05 Sep 2022 at 09:46:44 (+1000), Andrew Bernard wrote:
> In response to the recent thread on alternatives to Frescobaldi on
> Alma Linux I have prepared this set of instructions. I have tested
> this and there are two points in addition to the notes below.
> 
> One, I am unable to get rid of the last line of the extensive status
> message gvim shows at the bottom when invoked with a remote call. This
> is puzzling - I am working on it.

Yes, I usually see one line of that message. It seems to be less
frequent if the first click takes you a reasonable distance down
the source file, and virtually always seen if the top of the
source is showing. Not being a vi-person, I have no idea how to
eliminated it. (I do have your .vimrc fragment below included.)

> Second, in 2.23.12 at least, there is an error, strangely only for
> gvim, in libexec/lilypond-invoke editor. Line 130 is missing a comma,
> and must be updated to:
> 
>     "gvim": [("gvim", "--remote", "+:%(line)s:norm%(column)s",
> "%(file)s")],
> 
> I have submitted a bug report request about this.

It looks as if this has always been in the new Python version,
so perhaps we can surmise that the developer wasn't a vim-person.

[ … ]

> The Guide to getting Point and Click going with Gvim under Alma Linux 9
> -------
> 
> The NR has no detailed information about Lilypond point and click with
> gvim for
> Alma Linux. This note attempts to remedy that. Some information from
> the NR is
> copied here for ease of reference.

I think point-and-click was covered in Usage since 2.14.

[ … ]

> Setting the EDITOR variable
> ---
> 
> Lilypond uses the environment variable EDITOR to select which editor
> to use to
> display point and click links. For gvim, simply use the value 'gvim':
> 
> export EDITOR=gvim
> 
> Setting LYEDITOR is not required.

For the new, Python, version of lilypond-invoke editor,
the preferred choice of variable is, in order of preference,
LYEDITOR, XEDITOR and EDITOR. Using LYEDITOR is specific to
point-and-click, and so you don't interfere with the usual
system-wide effects of EDITOR (eg with crontab, mutt, less,
more, midnight commander, etc. to name but a few).

> Running Gvim and Evince
> ---
> 
> Run gvim in server mode by doing - exactly nothing! Simply running gvim will
> start the process in a new window. From the terminal this suffixes:
> 
> $ gvim
> 
> By default gvim will respond to remote requests such as from
> lilypond-invoke-editor. There is no need to use the --servername
> option as the
> name defaults to GVIM (and you can see this in the title bar). By default
> lilypond sends point and click requests to the gvim server named GVIM.

If you prefer running a text version of vim (eg, in xterm/terminal/…),
you still need to add   --servername gvim   when you start vi/vim,
so that it captures the point-and-clicks.

This is because the servername "gvim" is hard-coded into
lilypond-invoke-editor as server to seek, but the server's name
defaults to the name by which it was invoked: ie, vi or vim.

Cheers,
David.



Getting point and click going with gvim on Alma Linux

2022-09-04 Thread Andrew Bernard
In response to the recent thread on alternatives to Frescobaldi on Alma 
Linux I have prepared this set of instructions. I have tested this and 
there are two points in addition to the notes below.


One, I am unable to get rid of the last line of the extensive status 
message gvim shows at the bottom when invoked with a remote call. This 
is puzzling - I am working on it.


Second, in 2.23.12 at least, there is an error, strangely only for gvim, 
in libexec/lilypond-invoke editor. Line 130 is missing a comma, and must 
be updated to:


    "gvim": [("gvim", "--remote", "+:%(line)s:norm%(column)s", 
"%(file)s")],


I have submitted a bug report request about this.

This is a variant of the document 'The Guide to getting Point and Click 
going with Gvim under Ubuntu 18' I submitted to the list some years ago, 
and the comments members made there may be useful to read still.


https://mail.gnu.org/archive/html/lilypond-user/2019-02/msg00536.html

These instructions are readily adaptable to other text editors that are 
supported in libexec/lilypond-invoke-editor. I used Alma Linux 9.0 to 
develop these notes.



Andrew




The Guide to getting Point and Click going with Gvim under Alma Linux 9
---

The NR has no detailed information about Lilypond point and click with 
gvim for
Alma Linux. This note attempts to remedy that. Some information from the 
NR is

copied here for ease of reference.

Requirements


Alma Linux 9.0
Document Viewer (evince)
Lilypond
gvim version 8.2 (vim-X11 package)
[assumes bash shell]


Setting the EDITOR variable
---

Lilypond uses the environment variable EDITOR to select which editor to 
use to

display point and click links. For gvim, simply use the value 'gvim':

export EDITOR=gvim

Setting LYEDITOR is not required.

You can start evince from a terminal command to view a PDF. But if you 
want to
click on a PDF in GNOME Nautilus to view it then just exporting this 
variable
from the various bash startup files is inadequate. Gnome is started by 
Xsession
in X11 before terminals and shells. Therefore it is unable to see 
environment

variables set in .bashrc (or .bash_profile, etc). To resolve this matter,
recall that Xsession uses the startup file $HOME/.xsessionrc. For 
environment
variables that are to be shared between GNOME applications and terminal 
shells,
do the following. Create a file for variable declarations, of arbitrary 
name.


Add the EDITOR setting to that file:

 $ echo 'export EDITOR=gvim' > ~/.my_env_vars

Then edit ~/.xsessionrc to contain:

if [ -f ~/.my_env_vars ]; then
    . ~/.my_env_vars
fi

Now also add these same lines to ~/.bashrc. Some like to use 
.bash_profile or

other mechanisms, but the principle is the same. Manage any shared variables
that Nautilus and a bash shell both need in this third file. To make 
this take

effect, logout and login again so that a new Xsession is started.


Installing Gvim
---

Gvim is in the following package, not a package called gvim.

# dnf install vim-X11


Configuring the GNOME 3 Desktop
---

Create the file 'lilypond-invoke-editor.desktop':

[Desktop Entry]
Version=1.0
Name=lilypond-invoke-editor
GenericName=Textedit URI handler
Comment=URI handler for textedit:
Exec=lilypond-invoke-editor %u
Terminal=false
Type=Application
MimeType=x-scheme-handler/textedit;
Categories=Editor
NoDisplay=true

Run:

$ xdg-desktop-menu install ./lilypond-invoke-editor.desktop
$ xdg-mime default lilypond-invoke-editor.desktop x-scheme-handler/textedit

Check that this works. Install the xdg-open program:

# dnf install xdg-utils

Then:

$ xdg-open textedit:///etc/os-release:1:0:0

If all is correct lilypond-invoke-editor will run and display the file.


Configuring Gvim


Not all users see this problem, but if you do, it is hard to solve if 
you don't

know. On a plain new gvim install, every time you click on a lilypond grob
under the setup described here, a rather daunting status message is 
shown, and

you have to press ENTER to continue, each time. This is just an example:

:if !exists('+acd')||!|if haslocaldir()|cd -|lcd -|elseif getcwd() 
==# '/home/andro'|cd -|endif|endif

::1898:norm3|cal foreground()|if |star|en|redr|f

And also 'Press ENTER or type command to continue'.

The solution to this is to change the size of the message display in 
gvim. Add

the following to ~/.gvimrc:

if exists('+cmdheight') && ( < 2)
  set ch=2
endif

You may need to set the height to 3, depending on various sizes.
[As for why some people do not see this issue, I am unclear.]

[n.b. this is from the previous issue of this document for Ubuntu 18 but the
messsage in Alma Linux persists despite this fix. I am currently working on
it.]

A Personal Preference
-

Because gvim comes by default 

Re: point-and-click default

2022-01-05 Thread David Wright
On Sat 01 Jan 2022 at 22:27:31 (+0100), Valentin Petzel wrote:
> May I just fan the fire by saying that on kde this works out of the box?
> 
> That being said, the only really usable pnc implementation is Frescobaldi, as 
> that one will keep track while you’re editing the file and thus always point 
> to 
> the right thing.

Interesting. How precise is the forward indication (ie in the score
display), and how does it point to it. Do you know what mechanism
it's using to keep track?

The way reverse indications work is relatively straightforward (except
for how LP inserts the textedits), but I've never slogged through the
paper that describes SyncTeX, nor installed Okular, which is one
viewer that's supposed to be able to perform forward indications,
but comprises 134 extra packages in Debian.

> And I don’t see much of a problem with disabling pnc by default, but it would 
> not change much as most people would probably activate it somewhere and still 
> forget to deactivate it for sharing.

Of course, many other document formats can also leak information
unless you work around the problem, by sanitising the documents,
naming their source locations carefully, logging in anonymously,
or whatever's most straightforward.

Cheers,
David.



Re: point-and-click default

2022-01-04 Thread Federico Bruni



For the records, I've added an issue on Frescobaldi tracker:
https://github.com/frescobaldi/frescobaldi/issues/1412






Re: point-and-click default

2022-01-01 Thread Valentin Petzel
May I just fan the fire by saying that on kde this works out of the box?

That being said, the only really usable pnc implementation is Frescobaldi, as 
that one will keep track while you’re editing the file and thus always point to 
the right thing.

And I don’t see much of a problem with disabling pnc by default, but it would 
not change much as most people would probably activate it somewhere and still 
forget to deactivate it for sharing.

Cheers,
Valentin

Am Donnerstag, 30. Dezember 2021, 18:22:42 CET schrieb David Zelinsky:
> David Zelinsky  writes:
> > Tom Sgouros  writes:
> >> For those of us just catching up, can someone explain how to see the
> >> metadata? I guess this is more of a PDF question, but while I have some
> >> experts' attention...
> >> 
> >> Thank you,
> >> 
> >>  -Tom
> > 
> > I can only tell you about evince, the pdf reader I use.  But I expect it
> > should be the same in most pdf readers.
> > 
> > If you hover the mouse pointer over a notehead, it displays the URI that
> > 
> > will be looked up when you click there.  It will look like this:
> >   textedit
> > 
> > where  is the absolute path to the lilypond source
> > file, and  and  are the starting and ending
> > positions of the text defining the note in question.
> > 
> > -David
> 
> Sorry, I meant to say also that  is the line number in the source
> file where the note definition appears.
> 
> In evince on my Ubuntu system, clicking on the note elicits an error,
> because evince does not know what to do with a "textedit:..." link.
> Section 4.1 of the Usage Manual (under 4. External Programs) explains
> how to make it work.
> 
> -David

signature.asc
Description: This is a digitally signed message part.


Re: point-and-click default

2022-01-01 Thread Wols Lists

On 30/12/2021 17:22, David Zelinsky wrote:

In evince on my Ubuntu system, clicking on the note elicits an error,
because evince does not know what to do with a "textedit:..." link.
Section 4.1 of the Usage Manual (under 4. External Programs) explains
how to make it work.


Nor does my Windows setup ...

When it works, it's useful, but it's certainly not a novice hack if it 
doesn't work out-of-the-box.


(Yes I know it's bog-standard nix, but my original background was 
minicomputers, and it still feels alien to me.)


Cheers,
Wol



Re: point-and-click default

2021-12-30 Thread David Kastrup
Lukas-Fabian Moser  writes:

> Hi David,
>> I've been using Lilypond for a few years, and only yesterday learned
>> about the point-and-click feature in pdf output.  In particular, I had
>> no idea that by default Lilypond includes absolute pathnames to local
>> source files on my system as metadata in the pdf output files.  So when
>> I uploaded a couple of files to IMSLP recently, that metadata was
>> available for all to see.
>
> The Notation Reference states
> (https://lilypond.org/doc/v2.23/Documentation/usage/configuring-the-system-for-point-and-click):
>
> "Point and click functionality is enabled by default when creating PDF
> or SVG files."
>
> "Note: You should always turn off point and click in any LilyPond
> files to be distributed to avoid including path information about your
> computer in the PDF file, which can pose a security risk."
>
> I agree that these statements make for a gloomy combination by today's
> standards of increased awareness for computer security issues.
>
> Wouldn't it be more reasonable to switch point-and-click off by
> default?

My personal idea would be to use relative links anyway, but that might
possibly not work with the kind of "URL helper" setup that typically
ends up calling lilypond-invoke-editor .

-- 
David Kastrup



Re: point-and-click default

2021-12-30 Thread Lukas-Fabian Moser

Hi David,

I've been using Lilypond for a few years, and only yesterday learned
about the point-and-click feature in pdf output.  In particular, I had
no idea that by default Lilypond includes absolute pathnames to local
source files on my system as metadata in the pdf output files.  So when
I uploaded a couple of files to IMSLP recently, that metadata was
available for all to see.


The Notation Reference states 
(https://lilypond.org/doc/v2.23/Documentation/usage/configuring-the-system-for-point-and-click):


"Point and click functionality is enabled by default when creating PDF 
or SVG files."


"Note: You should always turn off point and click in any LilyPond files 
to be distributed to avoid including path information about your 
computer in the PDF file, which can pose a security risk."


I agree that these statements make for a gloomy combination by today's 
standards of increased awareness for computer security issues.


Wouldn't it be more reasonable to switch point-and-click off by default? 
My argument would be that in Frescobaldi, it's trivial to accommodate 
such a change, and non-Frescobaldi users who are able to set up a 
point-and-click-ready system of their own should also be perfectly able 
to make point-and-click the default on their system if they want to. 
Even more so since there's \pointAndClickOn, making it trivial to enable 
the feature for individual files without having to mess with command 
line parameters.


Lukas




Re: point-and-click default

2021-12-30 Thread David Zelinsky
David Zelinsky  writes:

> Tom Sgouros  writes:
>
>> For those of us just catching up, can someone explain how to see the
>> metadata? I guess this is more of a PDF question, but while I have some
>> experts' attention...
>>
>> Thank you,
>>
>>  -Tom
>
> I can only tell you about evince, the pdf reader I use.  But I expect it
> should be the same in most pdf readers.
>
> If you hover the mouse pointer over a notehead, it displays the URI that
> will be looked up when you click there.  It will look like this:
>
>   textedit
>
> where  is the absolute path to the lilypond source
> file, and  and  are the starting and ending
> positions of the text defining the note in question.
>
> -David

Sorry, I meant to say also that  is the line number in the source
file where the note definition appears.

In evince on my Ubuntu system, clicking on the note elicits an error,
because evince does not know what to do with a "textedit:..." link.
Section 4.1 of the Usage Manual (under 4. External Programs) explains
how to make it work.

-David



Re: point-and-click default

2021-12-30 Thread David Zelinsky
Tom Sgouros  writes:

> For those of us just catching up, can someone explain how to see the
> metadata? I guess this is more of a PDF question, but while I have some
> experts' attention...
>
> Thank you,
>
>  -Tom

I can only tell you about evince, the pdf reader I use.  But I expect it
should be the same in most pdf readers.

If you hover the mouse pointer over a notehead, it displays the URI that
will be looked up when you click there.  It will look like this:

  textedit

where  is the absolute path to the lilypond source
file, and  and  are the starting and ending
positions of the text defining the note in question.

-David



Re: point-and-click default

2021-12-30 Thread David Zelinsky
Knute Snortum  writes:

> On Wed, Dec 29, 2021 at 7:13 PM David Zelinsky  wrote:
> [...]
>> But even if it is configured to work, it seems like a REALLY BAD IDEA to
>> have this feature enabled *by default*.  Or, if it is to be the default,
>> it ought to be mentioned VERY PROMINENTLY, so anyone installing and
>> using Lilypond will see it.  As far as I could tell, it is not even
>> mentioned in the Learning Manual.
>>
>> The reference manual does admonish users to disable the feature when
>> producing pdf output for public distribution.  But that warning is
>> totally useless if a user does not happen to read that (rather obsure)
>> section of the manual.
>
> My vote would be to leave the point-and-click as the default and put a
> mention of how to publish a PDF in the Learning Manual, with any
> necessary warnings.  In Frescobaldi, I use this feature all the time
> and there is an easy way to publish PDFs without point-and-click.  I
> didn't know about the absolute path names in the metadata, but that
> makes sense.  Thanks for pointing that out.

Yes, keeping it the default but including documentation in the Learning
Manual sounds like a reasonable solution.  But there should also be
instructions for setting it up, or a pointer to the part of the
Reference Manual that discusses it.  Although apparently point-and-click
works out of the box in Frescobaldi, not everyone uses Frescobaldi, and
it requires some setup to work with other pdf readers (e.g. evince), at
least in my vanilla Ubuntu distribution.  This is all extensively
documented in the Reference Manual, but not in a place anyone is likely
to see it unless they know to search for point-and-click.

-David



Re: point-and-click default

2021-12-30 Thread Tom Sgouros
For those of us just catching up, can someone explain how to see the
metadata? I guess this is more of a PDF question, but while I have some
experts' attention...

Thank you,

 -Tom

On Thu, Dec 30, 2021 at 10:25 AM Knute Snortum  wrote:

> On Wed, Dec 29, 2021 at 7:13 PM David Zelinsky 
> wrote:
> [...]
> > But even if it is configured to work, it seems like a REALLY BAD IDEA to
> > have this feature enabled *by default*.  Or, if it is to be the default,
> > it ought to be mentioned VERY PROMINENTLY, so anyone installing and
> > using Lilypond will see it.  As far as I could tell, it is not even
> > mentioned in the Learning Manual.
> >
> > The reference manual does admonish users to disable the feature when
> > producing pdf output for public distribution.  But that warning is
> > totally useless if a user does not happen to read that (rather obsure)
> > section of the manual.
>
> My vote would be to leave the point-and-click as the default and put a
> mention of how to publish a PDF in the Learning Manual, with any
> necessary warnings.  In Frescobaldi, I use this feature all the time
> and there is an easy way to publish PDFs without point-and-click.  I
> didn't know about the absolute path names in the metadata, but that
> makes sense.  Thanks for pointing that out.
>
>
> --
> Knute Snortum
>
>


Re: point-and-click default

2021-12-30 Thread Knute Snortum
On Wed, Dec 29, 2021 at 7:13 PM David Zelinsky  wrote:
[...]
> But even if it is configured to work, it seems like a REALLY BAD IDEA to
> have this feature enabled *by default*.  Or, if it is to be the default,
> it ought to be mentioned VERY PROMINENTLY, so anyone installing and
> using Lilypond will see it.  As far as I could tell, it is not even
> mentioned in the Learning Manual.
>
> The reference manual does admonish users to disable the feature when
> producing pdf output for public distribution.  But that warning is
> totally useless if a user does not happen to read that (rather obsure)
> section of the manual.

My vote would be to leave the point-and-click as the default and put a
mention of how to publish a PDF in the Learning Manual, with any
necessary warnings.  In Frescobaldi, I use this feature all the time
and there is an easy way to publish PDFs without point-and-click.  I
didn't know about the absolute path names in the metadata, but that
makes sense.  Thanks for pointing that out.


--
Knute Snortum



Re: point-and-click default

2021-12-30 Thread Kevin Barry
>
>
> This point-and-click seems like a useful feature for editing, *if* it's
> configured to work on your system.  But it apparently is not usually set
> up that way by default, at least on most Linux systems.  (I do
> appreciate the instructions in the manual for configuring it, and plan
> to do that.)
>

I think pretty much everyone uses point-and-click. The most popular editor
(Frescobaldi) is available on Linux (I use it) - often packaged for you by
the distro, so I think you are not correct about how it is typically used
there. If you were in the dark about this until now I think you are an
outlier. Working with LilyPond is much harder without it.

Re the greater point about whether it should be on by default: I personally
like it as is and wouldn't want to have to enable it each time or make new
users do it. And I think that is more important than the potential downside
of someone not knowing to use publish (or forgetting), and then making a
pdf available that reveals their system username. But that is only my
opinion, and I understand your view.

Kevin


point-and-click default

2021-12-29 Thread David Zelinsky
I'm about to rant about an existing Lilyond default.  Really I want to
suggest a change for the developers, but I'm not sure where or how to do
that.  So I'll start with this rant, and I'll be happy to take any more
productive steps if someone can suggest what they should be.  Or, if
this issue has been previosly debated, I'd be interested to have a link
to that discussion.

Here goes...

I've been using Lilypond for a few years, and only yesterday learned
about the point-and-click feature in pdf output.  In particular, I had
no idea that by default Lilypond includes absolute pathnames to local
source files on my system as metadata in the pdf output files.  So when
I uploaded a couple of files to IMSLP recently, that metadata was
available for all to see.

Having learned (from my son!) about this feature, I have now found it in
the manual, and I now know how to disable it.  And I have replaced the
publicly available files with new ones that do not have the
metadata--and are also half the size!

This point-and-click seems like a useful feature for editing, *if* it's
configured to work on your system.  But it apparently is not usually set
up that way by default, at least on most Linux systems.  (I do
appreciate the instructions in the manual for configuring it, and plan
to do that.)

But even if it is configured to work, it seems like a REALLY BAD IDEA to
have this feature enabled *by default*.  Or, if it is to be the default,
it ought to be mentioned VERY PROMINENTLY, so anyone installing and
using Lilypond will see it.  As far as I could tell, it is not even
mentioned in the Learning Manual.

The reference manual does admonish users to disable the feature when
producing pdf output for public distribution.  But that warning is
totally useless if a user does not happen to read that (rather obsure)
section of the manual.


-- 
David  Zelinsky



How can I set LilyPond's “Point and Click” from Skim to VSCode?

2021-03-04 Thread Joshua Mastachi
Hello!

I don’t know if this is the right place to ask, but as far as LilyPond’s web 
page, this seems to be the users mailing list.

I posted this question on Music Stack Exchange and Stack Overflow, but I don’t 
seem to get any answer so I hope someone can help me here (or there as well).

I'm working on on MacOS High Sierra, and I'm trying to use Point and Click so 
that Skim (PDF viewer) redirects to a specific 
file/line/column/character/letter/whatever on VSCode.

I've found a couple of useful resources at the LilyPond's public mailing list 
conversation and some other places, but I haven't got to where I want.

Mailing list thread: 
https://lists.libreplanet.org/archive/html/lilypond-user/2018-07/msg00039.html 
<https://lists.libreplanet.org/archive/html/lilypond-user/2018-07/msg00039.html>

I don’t seem to understand everything that is being explained.

Usually when clicking on a URI element on the PDF it opens LilyPond.app, but I 
need it to work with VSCode.

I tried some things with SwiftDefaultApps, but nothing seems to change too much.

Someone explains something about using Platypus, but it’s quite confusing for 
me, and they’re talking more specifically about Emacs.

The furthest I could get was to set LilyPond and other scripts (like 
lilypond-book and convert-ly) to be run from the command line. In the process I 
learnt the basics of the usage of the command line and some things about the 
files .bash_profile and .profile. Then I switched to ZSH shell, and now instead 
I use the file .zshrc.

I'm trying to get this to work, but I'm not sure what to do. If I have to 
change something in a .json file on VSCode or anything else, please tell me 
step-by-step, I don't have any experience with programming, in case this is 
needed.

Does anyone know how to do this?

Re: point and click vim (not gvim) xfce4

2020-12-14 Thread David Wright
On Mon 14 Dec 2020 at 14:10:41 (-), damianlegassick wrote:
> 
> Short-ish answer: I still can't get point and click to work in Xfce4 with 
> *any* editor. Invoking the clicked pdf links from a GUI seems blocked in some 
> way: the embedded links open correctly from the terminal with Geany and 
> Gvim/Vim.

To be fair, your last clause exonerates the *editors* if it's saying
that xdg-open … works.

What you appear not to have revealed is the PDF viewers you have
tried, beyond mentioning "a.n.other", and also what you actually
observe when you write "seems blocked".

One possibility is that particular browsers may be configured to check
with apparmor whether they're authorised to open the link. This might
be revealed in syslog by typing

$ zgrep apparmor /var/log/syslog* | less

where you would see lines containing apparmor="DENIED". (You might
need some sort of privilege to read the logs.) These lines help you
craft the correct contents for the configuration modification that
might be necessary. (Apparmor is still being introduced into some
distributions as security tightens up.)

> However, the exact same instructions work under Gnome. I'm not wedded to Xfce 
> so I gave up and built a new Gnome VM.
[…]
> the Vim bundled with Arch was not complied with server option, but their Gvim 
> package includes a Vim binary which is. So...

[…]

> xpdf4 opens the embedded :textedit links correctly in Gnome via xdg-open, so 
> it doesn't need version 3's urlCommand option.

So it looks as if the Usage manual ought to be modified:

"Xpdf" → "Xpdf v.3"

Xpdf v.4 should direct to Gnome3 section.

IMO I'd like a rewrite of the terminology used in §4.1.1 of Usage.
I'm now counting three PDF viewers which need to use the xdg-open
mechanism for point-and-click: Xpdf4, evince and zathura, and this is
irrespective of whether or not you're running Gnome as your Desktop.
The requirement comes with the applications; I don't run any Desktop.

And, of course, gnome-open → xdg-open.

Cheers,
David.



Re: point and click vim (not gvim) xfce4

2020-12-14 Thread damianlegassick

Thanks David


Short-ish answer: I still can't get point and click to work in Xfce4 with *any* 
editor. Invoking the clicked pdf links from a GUI seems blocked in some way: 
the embedded links open correctly from the terminal with Geany and Gvim/Vim.


However, the exact same instructions work under Gnome. I'm not wedded to Xfce 
so I gave up and built a new Gnome VM.

On 14 December 2020 at 3:33, David Wright  wrote:

That's good. I assume you've managed to set LYEDITOR as a global
environment variable,


thanks for the heads-up there - that helps
 
If and when you get it running, check that it's compiled with the
server option by running vim -h (not always so).


the Vim bundled with Arch was not complied with server option, but their Gvim 
package includes a Vim binary which is. So...
 
Invoke vim with

$ vim --servername gvim



now works
 
From the link you posted, xpdf v4 seems a dead duck for handling
textedit URLs. 


xpdf4 opens the embedded :textedit links correctly in Gnome via xdg-open, so it 
doesn't need version 3's urlCommand option.


Thanks again for wading through all this, it's a lot clearer now.


Damian

Re:  point and click vim (not gvim) xfce4

2020-12-13 Thread David Wright
On Sat 12 Dec 2020 at 11:20:27 (-), damianlegassick wrote:
> On 12 December 2020 at 3:29, David Wright  wrote:
> 
> > Sorry, I can't keep up. 
> 
> lol. yes I'm flailing a bit. This all stems from the fact that I don't have 
> my mac atm and I've decided that I do want point and click after all. I've 
> various VMs, distros, desktops etc, WSL...just for lilypond.
> 
> with the gnome3 instructions from Usage Manual
> exo-open textedit:///etc/issue:1:0:0
> and
> xdg-open textedit:///etc/issue:1:0:0 
> both correctly invoke lilypond-invoke-editor with LYEDITOR=geany or 
> LYEDITOR=atom.

That's good. I assume you've managed to set LYEDITOR as a global
environment variable, rather than locally by using

 $ LYEDITOR=geany xdg-open textedit:///etc/issue:1:0:0

because with Desktop Environments, I'm not sure that

 $ LYEDITOR=geany your-PDF-viewer pdf-file.pdf

would work, because AIUI xdg-open is always a child of the
DE and not the process that invoked it. (But that might
only apply to Gnome—I don't know as I don't use DEs.)

> two problems remain
> 
> LYEDITOR=gvim only works with the gvim package installed. I can't get plain 
> vim in the terminal launched

Do you actually have a vim binary, rather than a link to gvim?

Is it in your PATH when in the terminal?

If and when you get it running, check that it's compiled with the
server option by running   vim -h   (not always so).

Invoke vim with

 $ vim --servername gvim

and check the vim server is running by typing

 :echo v:servername

which should reflect its name, GVIM. (The first colon has to be typed,
the rest of that line can be pasted.)

Note that you only invoke the program as vim, but everywhere else
should be GVIM, because that's the name built into LP.

> clicking the links in either xpdf or foxit still does nothing.

>From the link you posted, xpdf v4 seems a dead duck for handling
textedit URLs. (If that's not true, storms of protest may ensue.)
I know nothing about foxit, either the company or its software.

I assume you've checked that the PDF actually contains URLs. You can do
that with an editor, or use   less the-pdf.pdf   and then   /textedit
to search. If your less command preprocesses files, like mine, you may
need to avoid that with

 $ LESSOPEN=  less the-pdf.pdf

Do you see any indication that your PDF viewer recognises that there
are links in the file? The cursor should change when hovering over a
notehead, and the text of the link might be displayed on the status
line (if there is one) or in a help bubble.

BTW clicking a link might not be enough: for example zathura requires
point and double click.

Cheers,
David.



Re: point and click vim (not gvim) xfce4

2020-12-12 Thread damianlegassick




On 12 December 2020 at 3:29, David Wright  wrote:


On Fri 11 Dec 2020 at 15:09:38 (-), damianlegassick wrote:

On 11 December 2020 at 14:38, David Wright  wrote:
On Fri 11 Dec 2020 at 12:59:41 (-), damianlegassick wrote:
On 11 December 2020 at 12:41, damianlegassick  wrote:
Hi (and sorry to those weary of the point and click questions)
can anybody share their method for:
vim (not gvim)
a.n.other pdf viewer
xfce4
thanks
one thing is that 
https://lilypond.org/doc/v2.20/Documentation/usage/configuring-the-system-for-point-and-click
 is wrong re xpdf in that urlCommand is obsolete and does nothing (since 2017 
apparently)


Are we to assume that your email address is saying something about the
platform you're running on?


My experience with vim is that, by default, the server name was still
GVIM, rather than VIM.


I've not used xfce4, nor a.n.other, but the way in which a viewer
invokes point-and-click varies from browser to browser.


Xpdf here still uses the line
urlCommand "lilypond-invoke-editor %s"
to invoke the editor (in ~/.xpdfrc).


Evince and zathura required the Gnome approach outlined in the guide.
AIUI that goes through MIME (xdg-mime), rather than a direct call.


This system is Arch in Virtualbox on Windows 10.


looking online urlCommand has been deprecated in xpdf for some time. 
https://forum.xpdfreader.com/viewtopic.php?t=27
If I run xpdf from the terminal with that line in .xpdfrc I get 'Unknown config 
file command 'urlCommand'.

It appears that Archlinux has moved to Xpdf version 4, whereas Debian
uses version 3. I don't know why urlCommand has been removed, but
maybe the Arch lists/forums/wiki might help. Nor do I know how or
whether LP's textedit URL's would be workable with "launch"-type
links mentioned in that forum and in xpdf's documentation.


The problem seems more with xfce, where a textedit: click invokes both exo-open 
and xdg-open. I can't figure out how either of them handle URLs

Then it sounds as if XFCE's browser honours LP's URLs. I read that
exo-open is specific to XFCE, so you'd presumably configure that
one, and leave the other unconfigured. OTOH if you can't find
exo-open's documentation, then at least LP documents xdg-open in
the Usage manual.


setting LYEDITOR to geary or atom doesn't help.

I don't remember the outcome in the atom discussion (concerning the
line/column arguments). You can study the invocations about 90% through
lilypond/usr/share/lilypond/current/scm/editor.scm (substitute your
path elements). But the problem seems to be morphing.


I'll try Gnome if I'm on my own with xfce4

Sorry, I can't keep up. The last iteration of my experience is given in
these posts. Their references and follow-ups have other experiences that
might differ from mine, and even be more applicable to your case(s).
Just pick and choose what information you need.

https://lists.gnu.org/archive/html/lilypond-user/2020-10/msg00639.html
https://lists.gnu.org/archive/html/lilypond-user/2020-11/msg00037.html
https://lists.gnu.org/archive/html/lilypond-user/2020-11/msg00038.html
https://lists.gnu.org/archive/html/lilypond-user/2020-11/msg00062.html

And there was also a thread in March 2019, which IIRC concerned itself
mainly with the interaction of point-and-click with apparmor.

Cheers,
David.


Hi David, thanks for the patient reply


 
Sorry, I can't keep up. 


lol. yes I'm flailing a bit. This all stems from the fact that I don't have my 
mac atm and I've decided that I do want point and click after all. I've various 
VMs, distros, desktops etc, WSL...just for lilypond.


with the gnome3 instructions from Usage Manual
exo-open textedit:///etc/issue:1:0:0
and
xdg-open textedit:///etc/issue:1:0:0 
both correctly invoke lilypond-invoke-editor with LYEDITOR=geany or 
LYEDITOR=atom.


two problems remain


LYEDITOR=gvim only works with the gvim package installed. I can't get plain vim 
in the terminal launched


clicking the links in either xpdf or foxit still does nothing.


I did read those earlier threads thanks.


I'll keep chipping away


Damian


 

Re:  point and click vim (not gvim) xfce4

2020-12-11 Thread David Wright
On Fri 11 Dec 2020 at 15:09:38 (-), damianlegassick wrote:
> On 11 December 2020 at 14:38, David Wright  wrote:
> On Fri 11 Dec 2020 at 12:59:41 (-), damianlegassick wrote:
> On 11 December 2020 at 12:41, damianlegassick  wrote:
> Hi (and sorry to those weary of the point and click questions)
> can anybody share their method for:
> vim (not gvim)
> a.n.other pdf viewer
> xfce4
> thanks
> one thing is that 
> https://lilypond.org/doc/v2.20/Documentation/usage/configuring-the-system-for-point-and-click
>  is wrong re xpdf in that urlCommand is obsolete and does nothing (since 2017 
> apparently)
> 
> Are we to assume that your email address is saying something about the
> platform you're running on?
> 
> My experience with vim is that, by default, the server name was still
> GVIM, rather than VIM.
> 
> I've not used xfce4, nor a.n.other, but the way in which a viewer
> invokes point-and-click varies from browser to browser.
> 
> Xpdf here still uses the line
> urlCommand "lilypond-invoke-editor %s"
> to invoke the editor (in ~/.xpdfrc).
> 
> Evince and zathura required the Gnome approach outlined in the guide.
> AIUI that goes through MIME (xdg-mime), rather than a direct call.
> 
> This system is Arch in Virtualbox on Windows 10.
> 
> looking online urlCommand has been deprecated in xpdf for some time. 
> https://forum.xpdfreader.com/viewtopic.php?t=27
> If I run xpdf from the terminal with that line in .xpdfrc I get 'Unknown 
> config file command 'urlCommand'.

It appears that Archlinux has moved to Xpdf version 4, whereas Debian
uses version 3. I don't know why urlCommand has been removed, but
maybe the Arch lists/forums/wiki might help. Nor do I know how or
whether LP's textedit URL's would be workable with "launch"-type
links mentioned in that forum and in xpdf's documentation.

> The problem seems more with xfce, where a textedit: click invokes both 
> exo-open and xdg-open. I can't figure out how either of them handle URLs

Then it sounds as if XFCE's browser honours LP's URLs. I read that
exo-open is specific to XFCE, so you'd presumably configure that
one, and leave the other unconfigured. OTOH if you can't find
exo-open's documentation, then at least LP documents xdg-open in
the Usage manual.

> setting LYEDITOR to geary or atom doesn't help.

I don't remember the outcome in the atom discussion (concerning the
line/column arguments). You can study the invocations about 90% through
lilypond/usr/share/lilypond/current/scm/editor.scm (substitute your
path elements). But the problem seems to be morphing.

> I'll try Gnome if I'm on my own with xfce4

Sorry, I can't keep up. The last iteration of my experience is given in
these posts. Their references and follow-ups have other experiences that
might differ from mine, and even be more applicable to your case(s).
Just pick and choose what information you need.

https://lists.gnu.org/archive/html/lilypond-user/2020-10/msg00639.html
https://lists.gnu.org/archive/html/lilypond-user/2020-11/msg00037.html
https://lists.gnu.org/archive/html/lilypond-user/2020-11/msg00038.html
https://lists.gnu.org/archive/html/lilypond-user/2020-11/msg00062.html

And there was also a thread in March 2019, which IIRC concerned itself
mainly with the interaction of point-and-click with apparmor.

Cheers,
David.



Re: point and click vim (not gvim) xfce4

2020-12-11 Thread damianlegassick




On 11 December 2020 at 14:38, David Wright  wrote:


On Fri 11 Dec 2020 at 12:59:41 (-), damianlegassick wrote:

On 11 December 2020 at 12:41, damianlegassick  wrote:
Hi (and sorry to those weary of the point and click questions)
can anybody share their method for:
vim (not gvim)
a.n.other pdf viewer
xfce4
thanks
one thing is that 
https://lilypond.org/doc/v2.20/Documentation/usage/configuring-the-system-for-point-and-click
 is wrong re xpdf in that urlCommand is obsolete and does nothing (since 2017 
apparently)

Are we to assume that your email address is saying something about the
platform you're running on?

My experience with vim is that, by default, the server name was still
GVIM, rather than VIM.

I've not used xfce4, nor a.n.other, but the way in which a viewer
invokes point-and-click varies from browser to browser.

Xpdf here still uses the line
urlCommand "lilypond-invoke-editor %s"
to invoke the editor (in ~/.xpdfrc).

Evince and zathura required the Gnome approach outlined in the guide.
AIUI that goes through MIME (xdg-mime), rather than a direct call.

Cheers,
David.


 Hi David


This system is Arch in Virtualbox on Windows 10.


looking online urlCommand has been deprecated in xpdf for some time. 
https://forum.xpdfreader.com/viewtopic.php?t=27


If I run xpdf from the terminal with that line in .xpdfrc I get 'Unknown config 
file command 'urlCommand'.


The problem seems more with xfce, where a textedit: click invokes both exo-open 
and xdg-open. I can't figure out how either of them handle URLs


setting LYEDITOR to geary or atom doesn't help.


I'll try Gnome if I'm on my own with xfce4


thanks


Damian



Re:  point and click vim (not gvim) xfce4

2020-12-11 Thread David Wright
On Fri 11 Dec 2020 at 12:59:41 (-), damianlegassick wrote:
> On 11 December 2020 at 12:41, damianlegassick  wrote:
> Hi (and sorry to those weary of the point and click questions)
> can anybody share their method for:
> vim (not gvim)
> a.n.other pdf viewer
> xfce4
> thanks
> one thing is that 
> https://lilypond.org/doc/v2.20/Documentation/usage/configuring-the-system-for-point-and-click
>  is wrong re xpdf in that urlCommand is obsolete and does nothing (since 2017 
> apparently)

Are we to assume that your email address is saying something about the
platform you're running on?

My experience with vim is that, by default, the server name was still
GVIM, rather than VIM.

I've not used xfce4, nor a.n.other, but the way in which a viewer
invokes point-and-click varies from browser to browser.

Xpdf here still uses the line
urlCommand  "lilypond-invoke-editor %s"
to invoke the editor (in ~/.xpdfrc).

Evince and zathura required the Gnome approach outlined in the guide.
AIUI that goes through MIME (xdg-mime), rather than a direct call.

Cheers,
David.



Re: point and click vim (not gvim) xfce4

2020-12-11 Thread damianlegassick




On 11 December 2020 at 12:41, damianlegassick  wrote:


Hi (and sorry to those weary of the point and click questions)


can anybody share their method for:


vim (not gvim)
a.n.other pdf viewer

xfce4


thanks


one thing is that 
https://lilypond.org/doc/v2.20/Documentation/usage/configuring-the-system-for-point-and-click
 is wrong re xpdf in that urlCommand is obsolete and does nothing (since 2017 
apparently)
 

point and click vim (not gvim) xfce4

2020-12-11 Thread damianlegassick

Hi (and sorry to those weary of the point and click questions)


can anybody share their method for:


vim (not gvim)
a.n.other pdf viewer

xfce4


thanks

Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2020-11-02 Thread David Wright
On Mon 02 Nov 2020 at 09:59:45 (+0100), Martín Rincón Botero wrote:

> […] Out of curiosity, do Mac and Windows users have to stick to Frescobaldi 
> for Point & Click? They’re not even mentioned in the Usage Manual.

The code in the footnote of my reply to Andrew implies that, in the
absence of a *EDITOR environment variable, the Windows platform
chooses lilypad, and any other platform chooses emacs. That would
suggest that P works on them too.

> > Debian 10/buster with Xpdf and emacs running on a 2000-vintage
> > Pentium III at 650MHz in 512MB memory took less than a second to
> > open the source at the first click, and thereafter serviced each
> > click in 0.5 secs, just so long as the new target position is in
> > the displayed window
> 
> Wow, that’s old hardware! In my Asus laptop from 2017, Atom takes a while to 
> open the first time. After that, each click takes around 0.5 secs or less I 
> would say. It’s not something of great concern to me, but it’s noticeable, 
> especially after being used to Frescobaldi’s immediate reposition of the 
> cursor. Perhaps it has to do with Atom (not the lightest editor around). Were 
> Atom not so pleasing to the eye, I would probably try with another one to 
> compare speed ;-).

I'm guessing that there are three places where a delay could occur,
and on linux it should be easy to distinguish them. With two xterms,
I started gvim on one (and you'd use atom):

$ strace -f gvim

and on the other I started Xpdf:

$ LYEDITOR=gvim strace -f xpdf my-grand-opera.pdf

When the dust settles, you should see an outpouring of text on
each xterm when the moused is moved over either window.

So hold the mouse steady over a note, then click the button slowly,
and you should see more text appear with ButtonDown and more again
with ButtonUp. As far as P is concerned, it's ButtonUp that's
important, so the first delay is in how fast your finger twitches.¹

So to see where the delay is occurring, move the xterms close
together, then hold the button down over a note and, when all
activitiy has ceased, release it. You can see roughly how long
the communication takes by how quickly atom's xterm reacts
after xpdf's xterm.

Similarly, you can move atom and its xterm close together, and
observe the time difference between atom's xterm reacting and
its cursor moving. With 0.5 secs delay, you should be able to
resolve that somewhere in the chain.

If the delay is between the two xterms' output, I would guess
that changing editor won't make much difference.

¹ I can cheat here, as I have the PrintScreen key defined as a
  25 msec left button press, which is faster than I can click
  with the mouse.

Cheers,
David.



Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2020-11-02 Thread Martín Rincón Botero
Hi David,
> I see the problem, but I think that solution is unwise as it leaves
> a redundant file in the user's home directory, which they may fear
> removing.

Oh, I see. I didn’t know that file could be safely removed.
> This script then has to be maintained, and it also makes it less obvious
> how to adjust the process for any differences between systems. I think
> the process is mysterious enough without hiding it any more

Right. I forgot that the steps for Fedora are slightly different. Out of 
curiosity, do Mac and Windows users have to stick to Frescobaldi for Point & 
Click? They’re not even mentioned in the Usage Manual.
> Debian 10/buster with Xpdf and emacs running on a 2000-vintage
> Pentium III at 650MHz in 512MB memory took less than a second to
> open the source at the first click, and thereafter serviced each
> click in 0.5 secs, just so long as the new target position is in
> the displayed window

Wow, that’s old hardware! In my Asus laptop from 2017, Atom takes a while to 
open the first time. After that, each click takes around 0.5 secs or less I 
would say. It’s not something of great concern to me, but it’s noticeable, 
especially after being used to Frescobaldi’s immediate reposition of the 
cursor. Perhaps it has to do with Atom (not the lightest editor around). Were 
Atom not so pleasing to the eye, I would probably try with another one to 
compare speed ;-).

www.martinrinconbotero.com
On 2. Nov 2020, 03:28 +0100, lilypond-user@gnu.org, wrote:
>
> I see the problem, but I think that solution is unwise as it leaves
> a redundant file in the user's home directory, which they may fear
> removing.


Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2020-11-01 Thread David Wright
On Sun 01 Nov 2020 at 15:12:56 (+1100), Andrew Bernard wrote:
> [A slightly older screed. Stil works for Ubunto 20. Using Atom is
> matter of simple substitution.]
> 
> The Guide to getting Point and Click going with Gvim under Ubuntu 18

Yes, this one's the longer one, so I'll comment on this.

> Setting the EDITOR variable
> ---
> 
> Lilypond uses the environment variable EDITOR to select which editor
> to use to
> display point and click links. For gvim, simply use the value 'gvim':
> 
> export EDITOR=gvim
> 
> Setting LYEDITOR is not required.

I'm not sure why EDITOR is preferred to LYEDITOR. As far as
point-and-click is concerned, they have the same effect¹. But
exporting EDITOR has the consequence that it overrides all
other places where EDITOR is used.

The intention behind having the three variables LYEDITOR/XEDITOR/
EDITOR is that LYEDITOR can specify one editor for LilyPond's
point-and-click, XEDITOR can specify another (say, graphical one)
for any time that X is running, and EDITOR can specify a text-based
backstop for when X is not running.

> Check that this works. Install the gnome-open program:
> 
> $ sudo apt install libgnome2-bin
> 
> Then:
> 
> $ gnome-open textedit:///etc/issue:1:0:0
> 
> If all is correct lilypond-invoke-editor will run and display the file.

I think Federico Bruni pointed out that libgnome2-bin/gnome-open is
rather historical, in favour of xdg-open (usually in xdg-utils).
I guess that might be something worth changing in the Usage manual.

> Next, edit '/etc/apparmor.d/usr.bin.evince' and uncomment the line:
> 
>   # Site-specific additions and overrides. See local/README for details.
>   include 

This is the step you were going to edit out of your crib,
the reason being

> […] The local files provide for extending and adding
> information to the base apparmor files without interfering with them, and
> making system upgrades easier.

and /etc/apparmor.d/usr.bin.evince is such a base file.

But I think your earlier comment on the trailing comma would be
worth adding to the Usage manual.

> Run gvim in server mode by doing - exactly nothing! Simply running gvim will
> start the process in a new window. From the terminal this suffixes:
> 
> $ gvim
> 
> By default gvim will respond to remote requests such as from
> lilypond-invoke-editor. There is no need to use the --servername
> option as the
> name defaults to GVIM (and you can see this in the title bar). By default
> lilypond sends point and click requests to the gvim server named GVIM.

Interestingly, on Debian² you don't even have to bother to start gvim
at all *unless* you want to edit with vim, in which case

$ vim --servername gvim

will start a text server version wherever desired. Otherwise,
(graphical) gvim will start automatically. (I'm assuming that
vim/gvim are both installed, as would be usual.)

¹ from 
lilypond-2.21.0-1.linux-64/lilypond/usr/share/lilypond/current/scm/editor.scm

(define (get-editor)
  (or (getenv "LYEDITOR")
  (getenv "XEDITOR")
  (getenv "EDITOR")

  ;; FIXME: how are default/preferred editors specified on
  ;; different platforms?
  (case PLATFORM
((windows) "lilypad")
(else
 "emacs"

² What about other distributions?

Cheers,
David.



Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2020-11-01 Thread David Wright
On Sun 01 Nov 2020 at 14:25:07 (+0100), Martín Rincón Botero wrote:
> Thank you very much, Andrew, for this guide! It works! My pdf viewer is
> Foxit Reader so after installing the gnome-open program and checking it
> works, I didn't have to follow any other steps. I wish this guide can be
> merged with the current guide in the Usage Manual. Just one small
> suggestion to make this guide even more idiot-proof (at least for the steps
> I did) would be to make this step a bit more verbose: "Create the file
> 'lilypond-invoke-editor.desktop' *f. ex. in your home folder*". The next
> command assumes that you created the file via terminal and you moved to
> that location with the terminal. In the case that you created that file
> using GEdit (like I did) and followed the instructions in the Usage Manual
> (where it mentions /tmp as folder), the next command won't really work
> unless you're already there in the terminal (where I wasn't, since a
> terminal opens by default with the home directory). This might be obvious
> for people who do everything via terminal, but not for people who prefer
> using graphical applications like GEdit.

I see the problem, but I think that solution is unwise as it leaves
a redundant file in the user's home directory, which they may fear
removing. Better would be to improve the Usage manual in a way such as:

--✄--
  and then execute the commands

xdg-desktop-menu install /tmp/lilypond-invoke-editor.desktop
xdg-mime default lilypond-invoke-editor.desktop x-scheme-handler/textedit

  where /tmp is the directory that was chosen for the file.
--✄--

At present, the Usage manual switches from /tmp/ to ./ without
explanation. The idea of using /tmp for the scratch file is of course
that it's automatically emptied when you reboot.

> Is it maybe possible to create a
> script that automates all this? Perhaps the Gvim and Evince parts can be
> left out of it, but I have the feeling that what I just had to do can be
> made into a script. I already can do some scripting in Python, but such a
> script would need the user to have Python installed. So a Bash script from
> someone acquainted with Bash would be very welcome.

This script then has to be maintained, and it also makes it less obvious
how to adjust the process for any differences between systems. I think
the process is mysterious enough without hiding it any more.

> Atom works very well even with large files, however there's a small lag
> with point & click (even with small files). Since Frescobaldi doesn't have
> this Point & Click problem even with large files, I assume this small lag
> has more to do with the fact that there are two applications involved (Atom
> and Foxit) rather than one (Frescobaldi). Am I right? This Point & Click
> penalty is something that I'm willing to trade for the moment: it's less
> than Frescobaldi hanging while trying to move the cursor, let alone for
> trying to edit a large file. I hope this performance issue can be fixed in
> Frescobaldi eventually (although Atom has other advantages like Column
> Selection...).

So what sort of lag are you talking about? And is it different on the
first click (ie when the source file has to be opened)? You must be
running on reasonable hardware, so a noticeable lag does not seem
at all reasonable. A data point for you:

Debian 10/buster with Xpdf and emacs running on a 2000-vintage
Pentium III at 650MHz in 512MB memory took less than a second to
open the source at the first click, and thereafter serviced each
click in 0.5 secs, just so long as the new target position is in
the displayed window. (Obviously this machine takes at least a
second or two to scroll any distance in the editor, and at least
a second just to turn a page in a simple image-free PDF file.)

Cheers,
David.



Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2020-11-01 Thread Martín Rincón Botero
Thank you very much, Andrew, for this guide! It works! My pdf viewer is
Foxit Reader so after installing the gnome-open program and checking it
works, I didn't have to follow any other steps. I wish this guide can be
merged with the current guide in the Usage Manual. Just one small
suggestion to make this guide even more idiot-proof (at least for the steps
I did) would be to make this step a bit more verbose: "Create the file
'lilypond-invoke-editor.desktop' *f. ex. in your home folder*". The next
command assumes that you created the file via terminal and you moved to
that location with the terminal. In the case that you created that file
using GEdit (like I did) and followed the instructions in the Usage Manual
(where it mentions /tmp as folder), the next command won't really work
unless you're already there in the terminal (where I wasn't, since a
terminal opens by default with the home directory). This might be obvious
for people who do everything via terminal, but not for people who prefer
using graphical applications like GEdit. Is it maybe possible to create a
script that automates all this? Perhaps the Gvim and Evince parts can be
left out of it, but I have the feeling that what I just had to do can be
made into a script. I already can do some scripting in Python, but such a
script would need the user to have Python installed. So a Bash script from
someone acquainted with Bash would be very welcome.

Atom works very well even with large files, however there's a small lag
with point & click (even with small files). Since Frescobaldi doesn't have
this Point & Click problem even with large files, I assume this small lag
has more to do with the fact that there are two applications involved (Atom
and Foxit) rather than one (Frescobaldi). Am I right? This Point & Click
penalty is something that I'm willing to trade for the moment: it's less
than Frescobaldi hanging while trying to move the cursor, let alone for
trying to edit a large file. I hope this performance issue can be fixed in
Frescobaldi eventually (although Atom has other advantages like Column
Selection...).

Cheers,
Martín.

Am So., 1. Nov. 2020 um 05:13 Uhr schrieb Andrew Bernard <
andrew.bern...@gmail.com>:

> [A slightly older screed. Stil works for Ubunto 20. Using Atom is matter
> of simple substitution.]
>
>
>
> The Guide to getting Point and Click going with Gvim under Ubuntu 18
>
> --
>
> The NR leaves out some important information about how to configure a
> Ubuntu
> system to use Gvim for point and click from Lilypond PDF files. Where
> the NR is
> substantially correct, that information is copied here.
>
>
> Requirements
> 
>
> Ubuntu 18.10
> Document Viewer (evince)
> gvim version 8.0 (vim-gtk3 package)
> [assumes bash shell]
>
>
> Setting the EDITOR variable
> -------
>
> Lilypond uses the environment variable EDITOR to select which editor to
> use to
> display point and click links. For gvim, simply use the value 'gvim':
>
> export EDITOR=gvim
>
> Setting LYEDITOR is not required.
>
> You can start evince from a terminal command to view a PDF. But if you
> want to
> click on a PDF in GNOME Nautilus to view it then just exporting this
> variable
> from the various bash startup files is inadequate. Gnome is started by
> Xsession
> in X11 before terminals and shells. Therefore it is unable to see
> environment
> variables set in .bashrc (or .bash_profile, etc). To resolve this matter,
> recall that Xsession uses the startup file $HOME/.xsessionrc. For
> environment
> variables that are to be shared between GNOME applications and terminal
> shells,
> do the following. Create a file for variable declarations, of arbitrary
> name.
> Add the EDITOR setting to that file:
>
>   $ echo 'export EDITOR=gvim' > ~/.my_env_vars
>
> Then edit ~/.xsessionrc to contain:
>
> if [ -f ~/.my_env_vars ]; then
>  . ~/.my_env_vars
> fi
>
> Now also add these same lines to ~/.bashrc. Some like to use
> .bash_profile or
> other mechanisms, but the principle is the same. Manage any shared
> variables
> that Nautilus and a bash shell both need in this third file. To make
> this take
> effect, logout and login again so that a new Xsession is started.
>
>
> Installing Gvim
> ---
>
> Gvim is in the following package, not a package called gvim.
>
> # apt install vim-gtk3
>
>
> Configuring the GNOME 3 Desktop
> ---
>
> Create the file 'lilypond-invoke-editor.desktop':
>
> [Desktop Entry]
> Version=1.0
> Name=lilypond-invoke-editor
> GenericName=Textedit URI handler
> Comment=URI handler for textedit:

Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2020-11-01 Thread Ralph Palmer
On Sun, Nov 1, 2020 at 12:13 AM Andrew Bernard 
wrote:

> [A slightly older screed. Stil works for Ubunto 20. Using Atom is matter
> of simple substitution.]
>
>
>
> The Guide to getting Point and Click going with Gvim under Ubuntu 18
>
> --
>
> The NR leaves out some important information about how to configure a
> Ubuntu
> system to use Gvim for point and click from Lilypond PDF files. Where
> the NR is
> substantially correct, that information is copied here.
>

Thanks, Andrew, for both of these sets of instructions. Helpful and very
generous.

Be well,

Ralph


-- 
Ralph Palmer
Brattleboro, VT
USA
(he, him, his)
palmer.r.vio...@gmail.com


The Guide to getting Point and Click going with Gvim under Ubuntu 18

2020-10-31 Thread Andrew Bernard
[A slightly older screed. Stil works for Ubunto 20. Using Atom is matter 
of simple substitution.]




The Guide to getting Point and Click going with Gvim under Ubuntu 18
--

The NR leaves out some important information about how to configure a Ubuntu
system to use Gvim for point and click from Lilypond PDF files. Where 
the NR is

substantially correct, that information is copied here.


Requirements


Ubuntu 18.10
Document Viewer (evince)
gvim version 8.0 (vim-gtk3 package)
[assumes bash shell]


Setting the EDITOR variable
---

Lilypond uses the environment variable EDITOR to select which editor to 
use to

display point and click links. For gvim, simply use the value 'gvim':

export EDITOR=gvim

Setting LYEDITOR is not required.

You can start evince from a terminal command to view a PDF. But if you 
want to
click on a PDF in GNOME Nautilus to view it then just exporting this 
variable
from the various bash startup files is inadequate. Gnome is started by 
Xsession
in X11 before terminals and shells. Therefore it is unable to see 
environment

variables set in .bashrc (or .bash_profile, etc). To resolve this matter,
recall that Xsession uses the startup file $HOME/.xsessionrc. For 
environment
variables that are to be shared between GNOME applications and terminal 
shells,
do the following. Create a file for variable declarations, of arbitrary 
name.

Add the EDITOR setting to that file:

 $ echo 'export EDITOR=gvim' > ~/.my_env_vars

Then edit ~/.xsessionrc to contain:

if [ -f ~/.my_env_vars ]; then
    . ~/.my_env_vars
fi

Now also add these same lines to ~/.bashrc. Some like to use 
.bash_profile or

other mechanisms, but the principle is the same. Manage any shared variables
that Nautilus and a bash shell both need in this third file. To make 
this take

effect, logout and login again so that a new Xsession is started.


Installing Gvim
---

Gvim is in the following package, not a package called gvim.

# apt install vim-gtk3


Configuring the GNOME 3 Desktop
---

Create the file 'lilypond-invoke-editor.desktop':

[Desktop Entry]
Version=1.0
Name=lilypond-invoke-editor
GenericName=Textedit URI handler
Comment=URI handler for textedit:
Exec=lilypond-invoke-editor %u
Terminal=false
Type=Application
MimeType=x-scheme-handler/textedit;
Categories=Editor
NoDisplay=true

Run:

$ xdg-desktop-menu install ./lilypond-invoke-editor.desktop
$ xdg-mime default lilypond-invoke-editor.desktop x-scheme-handler/textedit

Check that this works. Install the gnome-open program:

$ sudo apt install libgnome2-bin

Then:

$ gnome-open textedit:///etc/issue:1:0:0

If all is correct lilypond-invoke-editor will run and display the file.


Configuring Ubuntu Apparmor for Evince
--

The Ubuntu mandatory access control system called Apparmor particular gaurds
with some ferocity the actions of Evince, so as to prevent malicious 
PDF's from
causing damage to the system. The apparmor configuration file for evince 
needs

to be modified. [The NR is lacking some crucial information here, which can
waste a lot of time as most people are not au fait with apparmor.]

As root, edit '/etc/apparmor.d/local/usr.bin.evince' to have the following
lines (it will most likely be an empty file):

# For Textedit links
#/usr/local/bin/lilypond-invoke-editor Cx -> sanitized_helper,
/home/andro/bin/lilypond-invoke-editor Cx -> sanitized_helper,

Note the comma on the end - this is not an error. Adjust the path as per the
exmaples to where your lilypond is installed.

Next, edit '/etc/apparmor.d/usr.bin.evince' and uncomment the line:

  # Site-specific additions and overrides. See local/README for details.
  include 

[It's right at the end.] The local files provide for extending and adding
information to the base apparmor files without interfering with them, and
making system upgrades easier.

Reconfigure evince apparmor:

# apparmor_parser -r -T -W /etc/apparmor.d/usr.bin.evince

To update apparmor:

# systemctl reload apparmor

Many people are confused by this step so it's important to get it exactly
right, and be aware of which apparmor file is which - there are two files
involved.


Configuring Gvim


Not all users see this problem, but if you do, it is hard to solve if 
you don't

know. On a plain new gvim install, every time you click on a lilypond grob
under the setup described here, the following rather daunting error 
message is

shown, and you have to press ENTER to continue, each time.

:if !exists('+acd')||!|if haslocaldir()|cd -|lcd -|elseif getcwd() 
==# '/home/andro'|cd -|endif|endif

::1898:norm3|cal foreground()|if |star|en|redr|f

And also 'Press ENTER or type command to continue'.

The solution to this is to change the size of the message display in 
gvim. Add

the following to ~/.gvimrc:


The Guide to getting LilyPond Point and Click going with Atom under Fedora 33

2020-10-31 Thread Andrew Bernard
The Guide to getting LilyPond Point and Click going with Atom under 
Fedora 33

--

The NR leaves out some important information about how to configure a Ubuntu
system to use Gvim for point and click from Lilypond PDF files. Where 
the NR is

substantially correct, that information is copied here.


Requirements


Fedora 33
Document Viewer (evince)
Atom 1.52.0
[assumes bash shell]


Setting the EDITOR variable
---

Lilypond uses the environment variable EDITOR to select which editor to 
use to

display point and click links. For Atom, simply use the value 'atom':

export EDITOR=gvim

Setting LYEDITOR is not required.

You can start evince from a terminal command to view a PDF. But if you 
want to
click on a PDF in GNOME Nautilus to view it then just exporting this 
variable
from the various bash startup files is inadequate. Gnome is started by 
Xsession
in X11 before terminals and shells. Therefore it is unable to see 
environment

variables set in .bashrc (or .bash_profile, etc). To resolve this matter,
recall that Xsession uses the startup file $HOME/.xsessionrc. For 
environment
variables that are to be shared between GNOME applications and terminal 
shells,
do the following. Create a file for variable declarations, of arbitrary 
name.

Add the EDITOR setting to that file:

 $ echo 'export EDITOR=atom' > ~/.my_env_vars

Then edit ~/.xsessionrc to contain:

if [ -f ~/.my_env_vars ]; then
    . ~/.my_env_vars
fi

Now also add these same lines to ~/.bashrc. Some like to use 
.bash_profile or

other mechanisms, but the principle is the same. Manage any shared variables
that Nautilus and a bash shell both need in this third file. To make 
this take

effect, logout and login again so that a new Xsession is started.


Installing Atom
---
Atom is not in the standard repository for Fedora.

# dnf install $(curl -sL 
"https://api.github.com/repos/atom/atom/releases/latest; | grep 
"https.*atom.x86_64.rpm" | cut -d '"' -f 4)




Configuring the GNOME 3 Desktop
---

Create the file 'lilypond-invoke-editor.desktop':

[Desktop Entry]
Version=1.0
Name=lilypond-invoke-editor
GenericName=Textedit URI handler
Comment=URI handler for textedit:
Exec=lilypond-invoke-editor %u
Terminal=false
Type=Application
MimeType=x-scheme-handler/textedit;
Categories=Editor
NoDisplay=true

Run:

$ xdg-desktop-menu install ./lilypond-invoke-editor.desktop
$ xdg-mime default lilypond-invoke-editor.desktop x-scheme-handler/textedit

Check that this works using xdg-open.

$ xdg-open textedit:///etc/issue:1:0:0

If all is correct lilypond-invoke-editor will run and display the file 
in Atom, with the cursor

at the right point.





Re: WSL - Visual Studio Code - point and click

2020-10-30 Thread damianlegassick

Hi Andrew


I agree completely about registry changes but this one's easily undo-able.


I'm just experimenting really - I've got Arch Linux working well now in 
Virtualbox and Lilypond/Frescobaldi also running well.


Damian

On 30 October 2020 at 15:15, Andrew Bernard  wrote:


Hi Damian,

I know this may not be the answer you are wanting, but given that you
have such a lot of heavy machinery on Windows to run LilyPond under
Linux, why not simply run Debian or distro of your choice in
Virtualbox, and you can even get VSC for Linux if you must. It's very
easy to get point and click going in Linux. I am deeply averse to
messing with the Windows 10 registry, no matter how clever the hack
may be. But my feelings about the registry are not shared by all. I do
all my professional work in Virtualbox Linux with Lilypond happily
pointing and clicking away for years. On this list some time ago I
posted a HOWTO for Ubuntu in this area, and the NR of course has some
other useful info for Linux.

Andrew




On Sat, 31 Oct 2020 at 01:33, damianlegassick  wrote:


I've got WSL running fine with a Debian distro, Lilypond working fine, Visual 
Studio Code doing it's remote thing and Sumatra picking up all the changes in 
pdf back on the Windows side.


but no point and click.



Re: WSL - Visual Studio Code - point and click

2020-10-30 Thread Andrew Bernard
Hi Damian,

I know this may not be the answer you are wanting, but given that you
have such a lot of heavy machinery on Windows to run LilyPond under
Linux, why not simply run Debian or distro of your choice in
Virtualbox, and you can even get VSC for Linux if you must. It's very
easy to get point and click going in Linux. I am deeply averse to
messing with the Windows 10 registry, no matter how clever the hack
may be. But my feelings about the registry are not shared by all. I do
all my professional work in Virtualbox Linux with Lilypond happily
pointing and clicking away for years. On this list some time ago I
posted a HOWTO for Ubuntu in this area, and the NR of course has some
other useful info for Linux.

Andrew




On Sat, 31 Oct 2020 at 01:33, damianlegassick  wrote:

> I've got WSL running fine with a Debian distro, Lilypond working fine, Visual 
> Studio Code doing it's remote thing and Sumatra picking up all the changes in 
> pdf back on the Windows side.
>
> but no point and click.
>



Re: WSL - Visual Studio Code - point and click

2020-10-30 Thread damianlegassick




On 30 October 2020 at 14:34, damianlegassick  wrote:


Hi


I've got WSL running fine with a Debian distro, Lilypond working fine, Visual 
Studio Code doing it's remote thing and Sumatra picking up all the changes in 
pdf back on the Windows side.


but no point and click.


I tried to hack Aaron Hill's answer from a couple of years ago


https://www.mail-archive.com/lilypond-user@gnu.org/msg129393.html


but no joy (it could be me of course)


Anyone out there got a method for Windows 10 64bit and current VSC/WSL2 etc?


thanks


Damian


This is how far I've got:


textedit.reg:

 Windows Registry Editor Version 5.00

 [HKEY_CURRENT_USER\Software\Classes\textedit]
 "URL Protocol"=""
 @="URL:textedit"

 [HKEY_CURRENT_USER\Software\Classes\textedit\shell]

 [HKEY_CURRENT_USER\Software\Classes\textedit\shell\open]

 [HKEY_CURRENT_USER\Software\Classes\textedit\shell\open\command]
 @="C:\\Tools\\textedit\\textedit.cmd %1"





textedit.cmd:

 @ECHO OFF
SETLOCAL
SET CODE=/mnt/c/Users/damia/AppData/Local/Programs/Microsoft\ VS\ Code/bin/code
SET URL=vscode://file/`/bin/wslpath -m %%(file)s`:%%(line)s:%%(column)s
SET ENV=/usr/bin/env -i LYEDITOR='%CODE% --open-url %URL%'
SET CMD=/usr/local/bin/lilypond-invoke-editor %*
C:\Windows\System32\wsl.exe %ENV% %CMD%

 

WSL - Visual Studio Code - point and click

2020-10-30 Thread damianlegassick

Hi


I've got WSL running fine with a Debian distro, Lilypond working fine, Visual 
Studio Code doing it's remote thing and Sumatra picking up all the changes in 
pdf back on the Windows side.


but no point and click.


I tried to hack Aaron Hill's answer from a couple of years ago


https://www.mail-archive.com/lilypond-user@gnu.org/msg129393.html


but no joy (it could be me of course)


Anyone out there got a method for Windows 10 64bit and current VSC/WSL2 etc?


thanks


Damian

crossplatform Python script for point-and-click

2019-08-21 Thread Federico Bruni

Hi folks

I remember that some time ago a user in this list shared a Python 
script to get point-and-click working on Windows and probably other 
operating systems. I can't remember his name, as I think he writes very 
seldomly in this list. I've searched the archive but I cannot find it.


I found only a Python script shared by Mark Knoop, but that's for Linux 
only:

https://github.com/markk/textedit-ly

I'm asking because I've struggled a lot to make point-and-click work on 
Windows and Mac while writing a blog post for lilypondblog.org, but 
eventually gave up because the Scheme script works only with certain 
settings. I can't remember now, but I think system variables worked 
only if defined in the OS and not within the script, at least in 
Windows. Details don't matter here. In general I think that a Python 
script would probably work better crossplatform and that would be 
consistent with the rest of the lilypond utility scripts.


Thanks in advance
Federico




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2019-03-17 Thread David Wright
On Sat 16 Mar 2019 at 18:25:45 (+1100), Andrew Bernard wrote:
> Hi David,
> 
> I made a mistake here - total lack of comprehension on my part. Not taking
> the time to study the format of the apparmor profile files, I misunderstood
> that the '#" in the '#include' was a comment character that had to be
> removed to activate the line. The comment character is '#' but '#include'
> is a single unit. Indeed the standard usr.bin.evince contains:
> 
> #include 
> 
> and has no need of modification.
> 
> My apologies for misleading readers - I am a complete idiot!
> 
> The curious thing is that on my system where the '#' is removed the file
> appears to be included and works just fine, so maybe that's a peculiarity
> of the grammar? Or maybe I am totally mixed up.
> 
> Thanks for pointing this out.

No problem.

I think this is because, by chance maybe, Ubuntu managed to put
  # Site-specific additions and overrides. See local/README for details.
  #include 
in two places, usr.bin.evince and abstractions/evince, instead of just one.

Cheers,
David.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2019-03-16 Thread Andrew Bernard
Hello All,

I do once more apologize for my silly mistake about apparmor. As
repentance, I have looked into all the issues Federico mention and solved
the issue. In short, you have to create an apparmor profile for
lilypond-wrapper.guile (it's not very hard to do - there are utilties to
assist.)

I'll get all my thoughts in order and take down notes on how to do this,
and update the Guide I wrote.

Here I was claiming it all worked fine and it turns out I had disabled the
profile for evince and forgotten about it. I think I deserve a punishment.
Perhaps I should be Transported to Australia for Life. Hold on, I am in
Australia. :-)

Anyway, issue solved.

Andrew
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2019-03-16 Thread Andrew Bernard
Hi David,

I made a mistake here - total lack of comprehension on my part. Not taking
the time to study the format of the apparmor profile files, I misunderstood
that the '#" in the '#include' was a comment character that had to be
removed to activate the line. The comment character is '#' but '#include'
is a single unit. Indeed the standard usr.bin.evince contains:

#include 

and has no need of modification.

My apologies for misleading readers - I am a complete idiot!

The curious thing is that on my system where the '#' is removed the file
appears to be included and works just fine, so maybe that's a peculiarity
of the grammar? Or maybe I am totally mixed up.

Thanks for pointing this out.

Andrew



On Sat, 16 Mar 2019 at 14:17, David Wright 
wrote:

> On Sat 16 Mar 2019 at 00:31:16 (+1100), Andrew Bernard wrote:
> > Hi Federico,
> >
> > Well, the '#' issue was a simple typo, not a vast conceptual error.
> >
> > I developed this on my pristine Ubuntu 18.10 and it all works swimmingly.
>
> Then I don't understand why you were altering the line at all.
> AFAICT both Ubuntu's and Debian's /etc/apparmor.d/usr.bin.evince
> files will include the local/usr.bin.evince file automatically.
> Editing /etc/apparmor.d/usr.bin.evince is only needed for making
> major changes to the configuration.
>
> Cheers,
> David.
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2019-03-15 Thread David Wright
On Sat 16 Mar 2019 at 00:31:16 (+1100), Andrew Bernard wrote:
> Hi Federico,
> 
> Well, the '#' issue was a simple typo, not a vast conceptual error.
> 
> I developed this on my pristine Ubuntu 18.10 and it all works swimmingly.

Then I don't understand why you were altering the line at all.
AFAICT both Ubuntu's and Debian's /etc/apparmor.d/usr.bin.evince
files will include the local/usr.bin.evince file automatically.
Editing /etc/apparmor.d/usr.bin.evince is only needed for making
major changes to the configuration.

Cheers,
David.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2019-03-15 Thread Federico Bruni




Il giorno ven 15 mar 2019 alle 14:31, Andrew Bernard 
 ha scritto:

Hi Federico,

Well, the '#' issue was a simple typo, not a vast conceptual error.

I developed this on my pristine Ubuntu 18.10 and it all works 
swimmingly.


I am puzzled by your statement about need to be aware of different 
paths for apparmor. This is system software and the location does not 
vary, and it's not something a user optionally installs. What's going 
on here?




I was talking about different _paths for lilypond* scripts_ set in 
apparmor conf files.
Usage manual uses /usr/local, but this is not necessarily true for 
everybody; and it's easy to forget what the actual path is in your 
system.


It's very late here and I will take a look at this more closely 
tomorrow. I saw the error about guile but there's a trivial fix for 
it - sorry, I post tomorrow when I have a minute. Don't have people 
searching around for some complex solution to that.




OK, I look forward to it.
Thanks
Federico




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2019-03-15 Thread Andrew Bernard
Hi Federico,

Well, the '#' issue was a simple typo, not a vast conceptual error.

I developed this on my pristine Ubuntu 18.10 and it all works swimmingly.

I am puzzled by your statement about need to be aware of different paths
for apparmor. This is system software and the location does not vary, and
it's not something a user optionally installs. What's going on here?

It's very late here and I will take a look at this more closely tomorrow. I
saw the error about guile but there's a trivial fix for it - sorry, I post
tomorrow when I have a minute. Don't have people searching around for some
complex solution to that.

This screed was intended purely for Ubuntu 18.10, and purely for gvim. I
became discouraged after people wanted it to be for all distros of Linux
and all different editors, a major undertaking. It was never intended to be
that, but more a response to a thread where one user was having difficulty
with this combination, and the Usage manual does fall a little short. But
if people consider it worthwhile I'd be happy to take corrections on board
and polish it.

I think the best spot is on the Scores of Beauty blog.

Andrew
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2019-03-15 Thread Federico Bruni
Il giorno ven 1 mar 2019 alle 21:14, David Wright 
 ha scritto:

Actually, I think there's an error in your reasoning in the apparmor
section, but I'm unable to test it because I have nothing installed
(that I know of) using these files. You wrote:

   Next, edit '/etc/apparmor.d/usr.bin.evince' and uncomment the line:

   # Site-specific additions and overrides. See local/README for 
details.

  include 

   [It's right at the end.] The local files provide for extending and 
adding
   information to the base apparmor files without interfering with 
them, and

   making system upgrades easier.

But I think you've removed a # that should be left in. AIUI in these
apparmor files:

 # Site-specific additions and overrides. See local/README for 
details.

 ↑↑ introduced an ordinary comment

 #include 
  this is an active include line (think C 
pragma)


David, finally I had the chance to test it on a vanilla Ubuntu 18.10.
You are right about the #include syntax. More details here:
http://manpages.ubuntu.com/manpages/cosmic/en/man5/apparmor.d.5.html

I've also verified it, just to be sure.
So the guide by Andrew is incorrect in this part. And also with 
reloading configuration: reloading apparmor systemd service is not 
necessary; AFAICT apparmor_parser is enough.



The main issues to be fixed (for Usage manual) are:

a. The Usage manual should point out that the lilypond full path in 
/etc/apparmor.d/local/usr.bin.evince should be changed according to 
your own installation (it's obvious, but you can easily forget it when 
you follow detailed instructions which make you "lazy"..).


b. Looking at `journalctl -xe|less` I see that the problem seems to be 
the fact that lilypond-invoke-editor is actually a symlink to a script, 
which then calls the guile executable distributed in lilypond package. 
So we have three files here.


My findings:

1. with Usage manual current configuration I get this error:

mar 15 13:32:01 ubuntu-18 audit[3121]: AVC apparmor="DENIED" 
operation="exec" profile="/usr/bin/evince" 
name="/home/fede/.local/bin/lilypond-wrapper.guile" pid=3121 
comm="gio-launch-desk" requested_mask="x" denied_mask="x" fsuid=1000 
ouid=1000
mar 15 13:32:01 ubuntu-18 kernel: audit: type=1400 
audit(1552653121.550:40): apparmor="DENIED" operation="exec" 
profile="/usr/bin/evince" 
name="/home/fede/.local/bin/lilypond-wrapper.guile" pid=3121 
comm="gio-launch-desk" requested_mask="x" denied_mask="x" fsuid=1000 
ouid=1000



2. Ok, let's try adding lilypond-wrapper.guile (see end of this email). 
And I get this:


mar 15 13:55:18 ubuntu-18 audit[3647]: AVC apparmor="DENIED" 
operation="exec" profile="/usr/bin/evince//sanitized_helper" 
name="/home/fede/.local/lilypond/usr/bin/guile" pid=3647 
comm="lilypond-invoke" requested_mask="x" denied_mask="x" fsuid=1000 
ouid=1000
mar 15 13:55:18 ubuntu-18 org.gnome.Evince.desktop[1702]: 
/home/fede/.local/bin/lilypond-invoke-editor: 6: exec: 
/home/fede/.local/lilypond/usr/bin/guile: Permission denied
mar 15 13:55:18 ubuntu-18 kernel: audit: type=1400 
audit(1552654518.540:118): apparmor="DENIED" operation="exec" 
profile="/usr/bin/evince//sanitized_helper" 
name="/home/fede/.local/lilypond/usr/bin/guile" pid=3647 
comm="lilypond-invoke" requested_mask="x" denied_mask="x" fsuid=1000 
ouid=1000



3. Ok, let's add also ...usr/bin/guile and I get this:

mar 15 13:57:49 ubuntu-18 audit[3678]: AVC apparmor="DENIED" 
operation="exec" profile="/usr/bin/evince//sanitized_helper" 
name="/home/fede/.local/lilypond/usr/bin/guile" pid=3678 
comm="lilypond-invoke" requested_mask="x" denied_mask="x" fsuid=1000 
ouid=1000
mar 15 13:57:49 ubuntu-18 org.gnome.Evince.desktop[1702]: 
/home/fede/.local/bin/lilypond-invoke-editor: 6: exec: 
/home/fede/.local/lilypond/usr/bin/guile: Permission denied
mar 15 13:57:49 ubuntu-18 kernel: audit: type=1400 
audit(1552654669.399:124): apparmor="DENIED" operation="exec" 
profile="/usr/bin/evince//sanitized_helper" 
name="/home/fede/.local/lilypond/usr/bin/guile" pid=3678 
comm="lilypond-invoke" requested_mask="x" denied_mask="x" fsuid=1000 
ouid=1000


Same error as in point 2.
Perhaps there's another way usr/bin/guile should be enabled.
Hopefully Ubuntu or OpenSUSE users (where Apparmor is enabled by 
default) can shed some light on this.


This is my current configuration:

fede@ubuntu-18:~$ which lilypond
/home/fede/.local/bin/lilypond

fede@ubuntu-18:~$ cat /etc/apparmor.d/local/usr.bin.evince
# For Textedit links
/home/fede/.local/bin/lilypond-invoke-editor Cx -> sanitized_helper,
/home/fede/.local/bin/lilypond-wrapper.guile Cx -> sanitized_helper,
/home/fede/.local/lilypond/usr/bin/guile Cx -> sanitized_helper,




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2019-03-01 Thread David Wright
On Fri 01 Mar 2019 at 17:04:37 (+1100), Andrew Bernard wrote:
> Hi David and Federico and All,
> 
> All these commentaries are great. But my aim was to document gvim (and not
> even vim) on Ubuntu. I am well aware that there are a dozen editors and
> tens of major Linux distros. I was never intending to write a thick book on
> point and click in general, just trying to clarify one use case that I
> thought applied to me and perhaps others. But I now get the feeling that no
> two people on this list use the same combination of anything, and the idea
> of trying to modify my screed to comprehend every single combination is
> giving me a large headache. I rather regret posting anything at all now.

I think it's useful to get these details out there.

But I wasn't trying to help construct a HOWTO for Debian users here.
Rather, I was trying to look beneath the surface to see what the
essential cogs and levers are that have to be present. If you run
evince, zathura, etc, you might not want to install a gnome DE and,
of course, it's not necessary. You have to know that those xdg-…
procedures are what's really required for gnome3-style apps, but
they're introduced by a paragraph that's less clear than that for gnome2.
Both the headings might say "Using Gnome X-style PDF viewers".

> The main rationale for it is that the Usage manual is lacking important
> info (e.g. environment variable usage for Ubuntu) and factually in error
> about apparmor files, and others seemed to be struggling currently with
> similar setup, albeit on Windows. And that's another thing, although I run
> Windows 10 and also Mac, I am not prepared to write all this for those
> environments as well (because I am not a Windows expert).

Actually, I think there's an error in your reasoning in the apparmor
section, but I'm unable to test it because I have nothing installed
(that I know of) using these files. You wrote:

   Next, edit '/etc/apparmor.d/usr.bin.evince' and uncomment the line:

   # Site-specific additions and overrides. See local/README for details.
  include 

   [It's right at the end.] The local files provide for extending and adding
   information to the base apparmor files without interfering with them, and
   making system upgrades easier.

But I think you've removed a # that should be left in. AIUI in these
apparmor files:

 # Site-specific additions and overrides. See local/README for details.
 ↑↑ introduced an ordinary comment

 #include 
  this is an active include line (think C pragma)

So the file as installed on Debian already includes the #include for
the local file. If yours is similar, you might find just above here
some perhaps confusing lines which *are* commented out:

 ##include 
 ↑↑ this is a commented-out include line

 #owner @{HOME}/.mozilla/**/*Cache/* r,
 ↑↑ this is a commented-out apparmor "instruction", like deny, 
capability etc.

> In conclusion, I think an informal blog post on Scores of Beauty would be
> useful, and the simplest way to preserve this information, and others may
> want to add posts for other environmental setups.

Wherever, as long as there are cross-references.

I suppose my view is that specifics tied to each viewer (or class
of app, like gnome3's evince/zathura bucket), editor and security
system would be more succinct than opaque narratives on Ubuntu version
this and version that, Debian, Fedore, Suse, Archlinux, bla, bla, bla.
Each critical factor only needs explaining once.

And setting environment variables is on a different axis, based
on the X startup method (as you pointed out). This could be pointed
to from sections like Usage §1.2 Environment variables.

Cheers,
David.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2019-03-01 Thread foxfanfare
Federico Bruni-2 wrote
> The main part about point and click in general and the configuration in 
> Linux is basically ready. I just have to make a final review.
> I'll split the Windows part in a new post and probably pass the Mac 
> post to Davide, if he has time to finalize a draft he sent to me some 
> weeks ago.
> 
> I'll try to do it next weekend (9-10 March).

Great! Let us know when you'll upload it :)




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2019-03-01 Thread Federico Bruni
Il giorno ven 1 mar 2019 alle 15:16, foxfanfare  ha 
scritto:

Andrew Bernard wrote
 In conclusion, I think an informal blog post on Scores of Beauty 
would be
 useful, and the simplest way to preserve this information, and 
others may

 want to add posts for other environmental setups.


I remembered Frederico talked in a previous post about having written 
a

draft on this subject, almost ready for lilypondblog. It would be
interesting to know where the project is by now? Maybe this would be 
a good
idea in order to solve the lack of information of the manual, without 
the

need to be exhaustive.


The main part about point and click in general and the configuration in 
Linux is basically ready. I just have to make a final review.
I'll split the Windows part in a new post and probably pass the Mac 
post to Davide, if he has time to finalize a draft he sent to me some 
weeks ago.


I'll try to do it next weekend (9-10 March).




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2019-03-01 Thread foxfanfare
I tend to agree with Andrew on that, it may be impossible to set-up a guide
that could work in all cases, due to the variety of environments. Maybe it
is the reason the original guide is lacking so much of information...

>From my perspective in trying to figure out how to make a set-up with VIM, I
think the main information that was missing from the manual was a good
example of how LYEDITOR should be configured and also more explanations on
VIM servermode.


Andrew Bernard wrote
> In conclusion, I think an informal blog post on Scores of Beauty would be
> useful, and the simplest way to preserve this information, and others may
> want to add posts for other environmental setups.

I remembered Frederico talked in a previous post about having written a
draft on this subject, almost ready for lilypondblog. It would be
interesting to know where the project is by now? Maybe this would be a good
idea in order to solve the lack of information of the manual, without the
need to be exhaustive.



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2019-02-28 Thread Andrew Bernard
Hi David and Federico and All,

All these commentaries are great. But my aim was to document gvim (and not
even vim) on Ubuntu. I am well aware that there are a dozen editors and
tens of major Linux distros. I was never intending to write a thick book on
point and click in general, just trying to clarify one use case that I
thought applied to me and perhaps others. But I now get the feeling that no
two people on this list use the same combination of anything, and the idea
of trying to modify my screed to comprehend every single combination is
giving me a large headache. I rather regret posting anything at all now.

The main rationale for it is that the Usage manual is lacking important
info (e.g. environment variable usage for Ubuntu) and factually in error
about apparmor files, and others seemed to be struggling currently with
similar setup, albeit on Windows. And that's another thing, although I run
Windows 10 and also Mac, I am not prepared to write all this for those
environments as well (because I am not a Windows expert).

In conclusion, I think an informal blog post on Scores of Beauty would be
useful, and the simplest way to preserve this information, and others may
want to add posts for other environmental setups.

Andrew


On Fri, 1 Mar 2019 at 08:42, David Wright  wrote:

> On Wed 27 Feb 2019 at 10:36:49 (+0100), Federico Bruni wrote:
> > First review after trying your tutorial in Fedora (for the purpose of
> > adapting these instructions for the Usage manual).
> > Fedora doesn't use AppArmor. I don't have SELinux enabled, so I'm not
> > sure if that might be a problem.
>
> A few comments from the point of view of Debian (stretch) with no
> gnome or other desktop, just fvwm. No SELinux or apparmor either.
>
> > Il giorno lun 25 feb 2019 alle 8:56, Andrew Bernard <
> andrew.bern...@gmail.com> ha scritto:
>
> > > I hope this may be able to be incorporated into the NR. If not,
> > > it's here now in the archives for future reference.
>
> > > The Guide to getting Point and Click going with Gvim under Ubuntu 18
> > > 
> > >
> > > The NR leaves out some important information about how to configure a
> Ubuntu
> > > system to use Gvim for point and click from Lilypond PDF files.
> > > Where the NR is substantially correct, that information is copied here.
> > >
> > > Requirements
> > > 
> > >
> > > Ubuntu 18.10
> > > Document Viewer (evince)
>
> My observations apply to both evince and zathura in equal measure.
>
> > > gvim version 8.0 (vim-gtk3 package)
> > > [assumes bash shell]
> > >
> > > Setting the EDITOR variable
> > > ---
> > >
> > > Lilypond uses the environment variable EDITOR to select which editor
> to use to
> > > display point and click links. For gvim, simply use the value 'gvim':
> > >
> > > export EDITOR=gvim
>
> Use this even where you are using vim as the actual editor.
>
> > > Setting LYEDITOR is not required.
>
> I too have found no use for LYEDITOR, but see further below.
>
> > > You can start evince from a terminal command to view a PDF. But if you
> want to
> > > click on a PDF in GNOME Nautilus to view it then just exporting this
> variable
> > > from the various bash startup files is inadequate. Gnome is started by
> Xsession
> > > in X11 before terminals and shells. Therefore it is unable to see
> environment
> > > variables set in .bashrc (or .bash_profile, etc). To resolve this
> matter,
> > > recall that Xsession uses the startup file $HOME/.xsessionrc. For
> environment
> > > variables that are to be shared between GNOME applications and
> terminal shells,
> > > do the following. Create a file for variable declarations, of
> arbitrary name.
> > > Add the EDITOR setting to that file:
> > >
> > >  $ echo 'export EDITOR=gvim' > ~/.my_env_vars
> > >
> > > Then edit ~/.xsessionrc to contain:
> > >
> > > if [ -f ~/.my_env_vars ]; then
> > > . ~/.my_env_vars
> > > fi
> > >
> > > Now also add these same lines to ~/.bashrc. Some like to use
> .bash_profile or
> > > other mechanisms, but the principle is the same. Manage any shared
> variables
> > > that Nautilus and a bash shell both need in this third file. To make
> this take
> > > effect, logout and login again so that a new Xsession is started.
> > >
> >
> > In Fedora GNOME is able to read environment variables defined in
> > .bashrc or .bash_profile.

Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2019-02-28 Thread David Wright
On Wed 27 Feb 2019 at 10:36:49 (+0100), Federico Bruni wrote:
> First review after trying your tutorial in Fedora (for the purpose of
> adapting these instructions for the Usage manual).
> Fedora doesn't use AppArmor. I don't have SELinux enabled, so I'm not
> sure if that might be a problem.

A few comments from the point of view of Debian (stretch) with no
gnome or other desktop, just fvwm. No SELinux or apparmor either.

> Il giorno lun 25 feb 2019 alle 8:56, Andrew Bernard 
>  ha scritto:

> > I hope this may be able to be incorporated into the NR. If not,
> > it's here now in the archives for future reference.

> > The Guide to getting Point and Click going with Gvim under Ubuntu 18
> > 
> > 
> > The NR leaves out some important information about how to configure a Ubuntu
> > system to use Gvim for point and click from Lilypond PDF files.
> > Where the NR is substantially correct, that information is copied here.
> > 
> > Requirements
> > 
> > 
> > Ubuntu 18.10
> > Document Viewer (evince)

My observations apply to both evince and zathura in equal measure.

> > gvim version 8.0 (vim-gtk3 package)
> > [assumes bash shell]
> > 
> > Setting the EDITOR variable
> > -------
> > 
> > Lilypond uses the environment variable EDITOR to select which editor to use 
> > to
> > display point and click links. For gvim, simply use the value 'gvim':
> > 
> > export EDITOR=gvim

Use this even where you are using vim as the actual editor.

> > Setting LYEDITOR is not required.

I too have found no use for LYEDITOR, but see further below.

> > You can start evince from a terminal command to view a PDF. But if you want 
> > to
> > click on a PDF in GNOME Nautilus to view it then just exporting this 
> > variable
> > from the various bash startup files is inadequate. Gnome is started by 
> > Xsession
> > in X11 before terminals and shells. Therefore it is unable to see 
> > environment
> > variables set in .bashrc (or .bash_profile, etc). To resolve this matter,
> > recall that Xsession uses the startup file $HOME/.xsessionrc. For 
> > environment
> > variables that are to be shared between GNOME applications and terminal 
> > shells,
> > do the following. Create a file for variable declarations, of arbitrary 
> > name.
> > Add the EDITOR setting to that file:
> > 
> >  $ echo 'export EDITOR=gvim' > ~/.my_env_vars
> > 
> > Then edit ~/.xsessionrc to contain:
> > 
> > if [ -f ~/.my_env_vars ]; then
> > . ~/.my_env_vars
> > fi
> > 
> > Now also add these same lines to ~/.bashrc. Some like to use .bash_profile 
> > or
> > other mechanisms, but the principle is the same. Manage any shared variables
> > that Nautilus and a bash shell both need in this third file. To make this 
> > take
> > effect, logout and login again so that a new Xsession is started.
> > 
> 
> In Fedora GNOME is able to read environment variables defined in
> .bashrc or .bash_profile.
> You just need to logout and login again.

Yes, this is something that really comes down to the distribution
you're using, and needs sorting out regardless of point-and-click,
LilyPond and anything else.

And if you have control over command invocations, as I do, you can
just specify EDITOR=foo at the beginning of the commandline.
Aliasing this also works.

> > Installing Gvim
> > ---
> > 
> > Gvim is in the following package, not a package called gvim.
> > 
> > # apt install vim-gtk3
> > 
> In Fedora it's called vim-X11.

vim-gtk in Debian.

> > Configuring the GNOME 3 Desktop
> > ---

This step is required to make evince and zathura call the editor,
and has nothing to do with whether you actually run gnome or a DE.

> > Create the file 'lilypond-invoke-editor.desktop':

This file will likely be installed in at least two locations, so to
save having yet another copy lying around, you can use /tmp as the
working directory.

> > [Desktop Entry]
> > Version=1.0
> > Name=lilypond-invoke-editor
> > GenericName=Textedit URI handler
> > Comment=URI handler for textedit:
> > Exec=lilypond-invoke-editor %u
> > Terminal=false
> > Type=Application
> > MimeType=x-scheme-handler/textedit;
> > Categories=Editor
> > NoDisplay=true
> > 
> > Run:
> > 
> > $ xdg-desktop-menu install ./lilypond-invoke-editor.desktop
> > $ xdg-mime default lilypond-invoke-editor.desktop x-scheme-handler/textedit

On Debian, that creat

Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2019-02-28 Thread Gianmaria Lari
Ciao Andrew,

if I remember correctly you decided to use gvim instead of frescobaldi
because of some performance problem, isn't it?
Anyway, in case you didn't yet do it, could you mention the pros and cons
of both choice?

Thank you Andrew!
g.


On Mon, 25 Feb 2019 at 08:57, Andrew Bernard 
wrote:

> Hi All,
>
> Federico has pointed out that it seems to be the season for people wanting
> to get point and click going (for some reason!). In the spirit of the
> season I offer the fruit of my work on this, trying to get it all going
> over the last week.
>
> I hope this may be able to be incorporated into the NR. If not, it's here
> now in the archives for future reference.
>
> Andrew
>
> The Guide to getting Point and Click going with Gvim under Ubuntu 18
> 
>
> The NR leaves out some important information about how to configure a
> Ubuntu
> system to use Gvim for point and click from Lilypond PDF files. Where the
> NR is
> substantially correct, that information is copied here.
>
>
> Requirements
> 
>
> Ubuntu 18.10
> Document Viewer (evince)
> gvim version 8.0 (vim-gtk3 package)
> [assumes bash shell]
>
>
> Setting the EDITOR variable
> ---
>
> Lilypond uses the environment variable EDITOR to select which editor to
> use to
> display point and click links. For gvim, simply use the value 'gvim':
>
> export EDITOR=gvim
>
> Setting LYEDITOR is not required.
>
> You can start evince from a terminal command to view a PDF. But if you
> want to
> click on a PDF in GNOME Nautilus to view it then just exporting this
> variable
> from the various bash startup files is inadequate. Gnome is started by
> Xsession
> in X11 before terminals and shells. Therefore it is unable to see
> environment
> variables set in .bashrc (or .bash_profile, etc). To resolve this matter,
> recall that Xsession uses the startup file $HOME/.xsessionrc. For
> environment
> variables that are to be shared between GNOME applications and terminal
> shells,
> do the following. Create a file for variable declarations, of arbitrary
> name.
> Add the EDITOR setting to that file:
>
>  $ echo 'export EDITOR=gvim' > ~/.my_env_vars
>
> Then edit ~/.xsessionrc to contain:
>
> if [ -f ~/.my_env_vars ]; then
> . ~/.my_env_vars
> fi
>
> Now also add these same lines to ~/.bashrc. Some like to use .bash_profile
> or
> other mechanisms, but the principle is the same. Manage any shared
> variables
> that Nautilus and a bash shell both need in this third file. To make this
> take
> effect, logout and login again so that a new Xsession is started.
>
>
> Installing Gvim
> ---
>
> Gvim is in the following package, not a package called gvim.
>
> # apt install vim-gtk3
>
>
> Configuring the GNOME 3 Desktop
> ---
>
> Create the file 'lilypond-invoke-editor.desktop':
>
> [Desktop Entry]
> Version=1.0
> Name=lilypond-invoke-editor
> GenericName=Textedit URI handler
> Comment=URI handler for textedit:
> Exec=lilypond-invoke-editor %u
> Terminal=false
> Type=Application
> MimeType=x-scheme-handler/textedit;
> Categories=Editor
> NoDisplay=true
>
> Run:
>
> $ xdg-desktop-menu install ./lilypond-invoke-editor.desktop
> $ xdg-mime default lilypond-invoke-editor.desktop x-scheme-handler/textedit
>
> Check that this works. Install the gnome-open program:
>
> $ sudo apt install libgnome2-bin
>
> Then:
>
> $ gnome-open textedit:///etc/issue:1:0:0
>
> If all is correct lilypond-invoke-editor will run and display the file.
>
>
> Configuring Ubuntu Apparmor for Evince
> --
>
> The Ubuntu mandatory access control system called Apparmor particular
> gaurds
> with some ferocity the actions of Evince, so as to prevent malicious PDF's
> from
> causing damage to the system. The apparmor configuration file for evince
> needs
> to be modified. [The NR is lacking some crucial information here, which can
> waste a lot of time as most people are not au fait with apparmor.]
>
> As root, edit '/etc/apparmor.d/local/usr.bin.evince' to have the following
> lines (it will most likely be an empty file):
>
> # For Textedit links
> #/usr/local/bin/lilypond-invoke-editor Cx -> sanitized_helper,
> /home/andro/bin/lilypond-invoke-editor Cx -> sanitized_helper,
>
> Note the comma on the end - this is not an error. Adjust the path as per
> the
> exmaples to where your lilypond is installed.
>
> Next, edit '/etc/apparmor.d/usr.bin.evince' and uncomment the line:
>
>   # Site-specific additions

Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2019-02-28 Thread Federico Bruni



Hi Andrew

Il giorno gio 28 feb 2019 alle 3:05, Andrew Bernard 
 ha scritto:

Hi Federico,

Hmm. This is becoming somewhat problematical. Fedora is clearly 
significantly different to Ubuntu, in relation to the behaviour of 
GNOME. At this rate, there will need to be a section for every major 
distro of Linux, due to variations. It will be infeasible to make 
this generic. I also run Debian and it has its differences also. I 
suppose this is the nature of Linux distros.




Personally I'm against making the documentation too detailed and 
specific as it will become hard to maintain. I think a trade-off is 
possible..



The Lilypond Usage section is in fact incorrect regarding Apparmor on 
Ubuntu and should be corrected, as this is one of the most difficult 
part, that few people understand. Not many users customise Apparmor - 
it's quite arcane.


While I am happy to learn the development submission process, it's 
true that this page is somewhat more tutorial than reference. That's 
in fact the idea. So now I am favouring a blog post at Scores of 
Beauty. But I will reflect on it.




Then go for the blog post. Scores of Beauty's last post was published 
last year... we need new articles!
I have two drafts in Scores of Beauty which I could not complete yet. 
One is about point and click configuration in all operating systems. I 
was stuck because of some problems I got with Windows and especially 
Mac. Now I'm convinced I should split the post in three and publish the 
Linux part soon. The rest will follow...



I run virtual Linux machines and I am happy to run up all the major 
distros and to account for all the differences, but this seems like a 
large amount of work for something that people don't necessarily even 
want anyway. And there is no way I am going to write anything for 
Windows, or Mac.




I'm happy to make a few tests and write a Doc patch on this subject. It 
was in my TODO list since I sent the last patch for the Usage manual.





___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2019-02-27 Thread Andrew Bernard
Hi Federico,

Hmm. This is becoming somewhat problematical. Fedora is clearly
significantly different to Ubuntu, in relation to the behaviour of GNOME.
At this rate, there will need to be a section for every major distro of
Linux, due to variations. It will be infeasible to make this generic. I
also run Debian and it has its differences also. I suppose this is the
nature of Linux distros.

The Lilypond Usage section is in fact incorrect regarding Apparmor on
Ubuntu and should be corrected, as this is one of the most difficult part,
that few people understand. Not many users customise Apparmor - it's quite
arcane.

While I am happy to learn the development submission process, it's true
that this page is somewhat more tutorial than reference. That's in fact the
idea. So now I am favouring a blog post at Scores of Beauty. But I will
reflect on it.

I run virtual Linux machines and I am happy to run up all the major distros
and to account for all the differences, but this seems like a large amount
of work for something that people don't necessarily even want anyway. And
there is no way I am going to write anything for Windows, or Mac.

Andrew
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: The Guide to getting Point and Click going with Gvim under Ubuntu 18

2019-02-27 Thread Federico Bruni

Hi Andrew

First review after trying your tutorial in Fedora (for the purpose of 
adapting these instructions for the Usage manual).
Fedora doesn't use AppArmor. I don't have SELinux enabled, so I'm not 
sure if that might be a problem.



Il giorno lun 25 feb 2019 alle 8:56, Andrew Bernard 
 ha scritto:

Hi All,

Federico has pointed out that it seems to be the season for people 
wanting to get point and click going (for some reason!). In the 
spirit of the season I offer the fruit of my work on this, trying to 
get it all going over the last week.


I hope this may be able to be incorporated into the NR. If not, it's 
here now in the archives for future reference.


Andrew

The Guide to getting Point and Click going with Gvim under Ubuntu 18


The NR leaves out some important information about how to configure a 
Ubuntu
system to use Gvim for point and click from Lilypond PDF files. Where 
the NR is

substantially correct, that information is copied here.


Requirements


Ubuntu 18.10
Document Viewer (evince)
gvim version 8.0 (vim-gtk3 package)
[assumes bash shell]


Setting the EDITOR variable
---

Lilypond uses the environment variable EDITOR to select which editor 
to use to

display point and click links. For gvim, simply use the value 'gvim':

export EDITOR=gvim

Setting LYEDITOR is not required.

You can start evince from a terminal command to view a PDF. But if 
you want to
click on a PDF in GNOME Nautilus to view it then just exporting this 
variable
from the various bash startup files is inadequate. Gnome is started 
by Xsession
in X11 before terminals and shells. Therefore it is unable to see 
environment
variables set in .bashrc (or .bash_profile, etc). To resolve this 
matter,
recall that Xsession uses the startup file $HOME/.xsessionrc. For 
environment
variables that are to be shared between GNOME applications and 
terminal shells,
do the following. Create a file for variable declarations, of 
arbitrary name.

Add the EDITOR setting to that file:

 $ echo 'export EDITOR=gvim' > ~/.my_env_vars

Then edit ~/.xsessionrc to contain:

if [ -f ~/.my_env_vars ]; then
. ~/.my_env_vars
fi

Now also add these same lines to ~/.bashrc. Some like to use 
.bash_profile or
other mechanisms, but the principle is the same. Manage any shared 
variables
that Nautilus and a bash shell both need in this third file. To make 
this take

effect, logout and login again so that a new Xsession is started.



In Fedora GNOME is able to read environment variables defined in 
.bashrc or .bash_profile.

You just need to logout and login again.




Installing Gvim
---

Gvim is in the following package, not a package called gvim.

# apt install vim-gtk3



In Fedora it's called vim-X11.




Configuring the GNOME 3 Desktop
---

Create the file 'lilypond-invoke-editor.desktop':

[Desktop Entry]
Version=1.0
Name=lilypond-invoke-editor
GenericName=Textedit URI handler
Comment=URI handler for textedit:
Exec=lilypond-invoke-editor %u
Terminal=false
Type=Application
MimeType=x-scheme-handler/textedit;
Categories=Editor
NoDisplay=true

Run:

$ xdg-desktop-menu install ./lilypond-invoke-editor.desktop
$ xdg-mime default lilypond-invoke-editor.desktop 
x-scheme-handler/textedit


Check that this works. Install the gnome-open program:

$ sudo apt install libgnome2-bin

Then:

$ gnome-open textedit:///etc/issue:1:0:0

If all is correct lilypond-invoke-editor will run and display the 
file.




No need to install libgnome2-bin. You should use xdg-open, which 
_should_ be available in all modern Linux installations. (package 
xdg-utils, at least in Fedora)





Configuring Gvim


Not all users see this problem, but if you do, it is hard to solve if 
you don't
know. On a plain new gvim install, every time you click on a lilypond 
grob
under the setup described here, the following rather daunting error 
message is

shown, and you have to press ENTER to continue, each time.

:if !exists('+acd')||!|if haslocaldir()|cd -|lcd -|elseif 
getcwd() ==# '/home/andro'|cd -|endif|endif

::1898:norm3|cal foreground()|if |star|en|redr|f

And also 'Press ENTER or type command to continue'.



Yep, I see this problem.

The solution to this is to change the size of the message display in 
gvim. Add

the following to ~/.gvimrc:

if exists('+cmdheight') && ( < 2)
  set ch=2
endif

You may need to set the height to 3, depending on various sizes.

[As for why some people do not see this issue, I am unclear.]


A Personal Preference
-

Because gvim comes by default with mouse enabled, and this is a 
useful feature,
if you click in the window after lilypond-invoke-editgor has set the 
cursor
position in the file, the cursor will move to the mouse click. You 
can either
disable mouse in gvim, or do what I prefer which is to use the GNOME 
Tweaks
tool in Ubu

  1   2   3   4   >