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&C 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&C 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-edi

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')||!&acd|if haslocaldir()|cd -|lcd -|elseif getcwd() 
==# '/home/andro'|cd -|endif|endif

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

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

Th

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 d

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-edi

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.evin

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')||!&acd|if haslocaldir()|cd -|lcd -|elseif 
getcwd() ==# '/home/andro'|cd -|endif|endif

::1898:norm3|cal foreground()|if &im|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') && (&ch < 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 th

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

2019-02-24 Thread Andrew Bernard
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 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')||!&a