lilypond-user
[Top][All Lists]
Advanced

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

Re: Getting point-and-click working


From: Federico Bruni
Subject: Re: Getting point-and-click working
Date: Sat, 09 Feb 2019 11:05:35 +0100



Il giorno ven 8 feb 2019 alle 18:16, David Sumbler <address@hidden> ha scritto:
I put off trying to get point-and-click for several years (!) until
now, because the instructions in the Usage Manual seemed rather
cryptic. But point-and-click would be massively useful, so I thought I
would try to set it up.  I followed the instructions to the best of my
limited ability and, rather as I expected, it didn't work for me.

I am running Ubuntu 18.04 with emacs 25.2. and the Unity desktop.


I don't think it's important if you are using Unity or Gnome 3. In both cases you should probably follow the instructions for GNOME 3 in the Usage manual.


I have LYEDITOR set to "emacsclient --no-wait +%(line)s:%(column)s %" file)s".
I don't have EDITOR set to anything at the moment.


The file variable is called incorrectly. I guess it's a typo in your email? Anyway, you don't need to use this long form, as the command should be already defined in lilypond source.
You can check it with these commands:

[~]$ which lilypond-invoke-editor
~/.local/bin/lilypond-invoke-editor
[~]$ grep emacs .local/lilypond/usr/share/lilypond/current/scm/editor.scm
        "emacs"))))
'(("emacs" . "emacsclient --no-wait +%(line)s:%(column)s %(file)s || (emacs +%(line)s:%(column)s %(file)s&)")

So you can use:

export LYEDITOR=emacs

This is all I have to do to make it work on Fedora 29, GNOME 3.30.2.

I also have this line in ~/.emacs:

(server-start)

This is explained in current master Documentation. Unfortunately LilyPond releases have been blocked for the last seven months so you have to build it yourself or check the sources on Savannah.



I couldn't seem to find whether I was running gnome 2 or 3, so I
carried out the steps documented for gnome 2, but running

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

produced an error saying that the URL could not be found.


When I find some time I'll improve the documentation.

So I tried the gnome 3 steps.  I created a file
        ~/tmp/lilypond-invoke-editor.desktop
containing the material specified in the UM, i.e.:

        [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

I then executed:

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

Now when I start emacs, run the command server-start and then issue the
command

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

the file /etc/issue does indeed open in emacs.  It contains the single
line

        Ubuntu 18.04.1 LTS \n \l

This seemed promising, to me.


So far so good.
By the way, it opens once or twice? If you are using a LilyPond installer released before October 2018 (today the answer is yes), you might get two windows. If you are using a version provided by your distro, you won't probably have this bug. See this PR:
https://github.com/gperciva/gub/pull/48


The PDF viewer I use is evince, so I added the lines

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

to the file /etc/apparmor.d/local/usr.bin.evince (which was previously
empty), and then ran

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

as instructed in the UM.


However, when I open a lilypond PDF file in evince and click on a note,
I get an error message:

        Unable to open external link.
Failed to execute child process “lilypond-invoke-editor” (Permission denied)

Yet I can run lilypond-invoke-editor from a command line without any
parameters, and I get the expected usage help.

Can anyone suggest what I have done wrong or omitted to do?


I never had this problem since Fedora doesn't use AppArmor (nor Debian, wich I used previously).
Have you tried logging out the session or restarting?
Or just restart apparmor:

sudo /etc/init.d/apparmor restart

If it doesn't help, try disabling AppArmor for Evince:

https://askubuntu.com/questions/344834/evince-document-viewer-failed-to-execute-child-process-nemo-permission-deni






reply via email to

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