point-and-click (was: Re: vim pointing to pdf-viewer and reverse)

2014-11-03 Thread Rutger Hofman

One more step needed nowadays

Edit /etc/apparmor.d/abstractions/evince to add the following 2 lines
(replace /usr/ with the prefix of your Lilypond installation):

/usr/bin/lilypond-invoke-editor Ux,
/usr/bin/lilypond-wrapper.guile Ux,

# ln -s /etc/apparmor.d/usr.bin.evince 
/etc/apparmor.d/disable/usr.bin.evince

# /etc/init.d/apparmor restart

On 03/07/2012 11:26 AM, Rutger Hofman wrote:

On 03/07/2012 11:09 AM, Rutger Hofman wrote:

On 03/07/2012 09:12 AM, David Kastrup wrote:

Stjepan Horvat writes:


On Tue, Mar 6, 2012 at 5:48 PM, David Kastrup wrote:

Stjepan Horvat writes:


Hello..can somebody please tell me how to get vim and a pdf viewer
(xpdf or evince of zathura) to work with vim lilypond-invoke-editor

[snip]


Evince appears to have its own set of obstacles. Some Ubuntu pages seem
to suggest the problem (Permission denied) is related to apparmor.d but
I have no clue how to make that behave as desired.


I got it to work after all on Ubuntu Lucid:

I followed instructions in
http://lists.gnu.org/archive/html/lilypond-user/2007-06/msg00185.html
(and Mark Knoop's follow-up at a lower speed). IFAIU, this configures
Gnome apps to handle 'textedit' commands by invoking
lilypond-invoke-editor.

The apparmor.d stuff:

Edit /etc/apparmor.d/abstractions/evince to add the following 2 lines
(replace /usr/ with the prefix of your Lilypond installation):

/usr/bin/lilypond-invoke-editor Ux,
/usr/bin/lilypond-wrapper.guile Ux,

The second line appears necessary because lilypond-invoke-editor is a
symlink to lilypond-wrapper.guile which is actually executed.

Then

$ sudo /etc/init.d/apparmor reload

Rutger



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


Re: vim pointing to pdf-viewer and reverse

2012-09-06 Thread Stjepan Horvat
Hi guys..it is an old post..but i got it working right now..so i want to
share it with you..

I made a script vim-lilypond.sh

#!/bin/bash
FILENAME=`echo $1 | cut -d ":" -f 2`
LINE=`echo $1 | cut -d ":" -f 3`
CHAR=`echo $1 | cut -d ":" -f 4`
COLUMN=`echo $1 | cut -d ":" -f 5`
vim --servername lilypond --remote-silent "+call cursor($LINE, $CHAR+1)"
$FILENAME

then i started vim with server called lilypond:

vim --servername lilypond file.ly

and in xpdf or epdfview changed the urlCommand to "~./vim-lilypond.sh %s"
or whereever you put it..

it also works with gvim..

what i didnt understand is how lilypond-invoke-editor works and what it is
for..and..
what is the diference between LINE CHAR and COLUMN couse url comand has 3
numbers..

..am happy...

On Wed, Mar 7, 2012 at 11:32 AM, Rutger Hofman  wrote:

> On 03/07/2012 11:09 AM, Rutger Hofman wrote:
>
>> On 03/07/2012 09:12 AM, David Kastrup wrote:
>>
>>> Stjepan Horvat writes:
>>>
>>>  On Tue, Mar 6, 2012 at 5:48 PM, David Kastrup wrote:

> Stjepan Horvat writes:
>
>  Hello..can somebody please tell me how to get vim and a pdf viewer
>> (xpdf or evince of zathura) to work with vim lilypond-invoke-editor
>> function..i read everything that is on the web
>>
> [snip]
>
>
>>> Have you set up your EDITOR environment variable? I quote:
>>>
>>> The program 'lilypond-invoke-editor' is a small helper program. It
>>> will invoke an editor for the special textedit URIs, and run a web
>>> browser for others. It tests the environment variable EDITOR for the
>>> following patterns,
>>>
>>> emacs
>>>
>>> this will invoke
>>>
>>> emacsclient --no-wait +line:column file
>>>
>>> gvim
>>>
>>> this will invoke
>>>
>>> gvim --remote +:line:normcolumn file
>>>
>>> nedit
>>>
>>> this will invoke
>>>
>>> nc -noask +line file'
>>>
>>> The environment variable LYEDITOR is used to override this. It
>>> contains the command line to start the editor, where %(file)s,
>>> %(column)s, %(line)s is replaced with the file, column and line
>>> respectively. The setting
>>>
>>> emacsclient --no-wait +%(line)s:%(column)s %(file)s
>>>
>>> for LYEDITOR is equivalent to the standard emacsclient invocation.
>>>
>>>
>>>
>>>
>>  From gvim's man page, I understand how one can position the cursor at
>> startup on a line (+line or +:line), but I do /not/ grasp how it is put
>> on a column. Indeed, gvim gives me an error if I follow the
>> lilypond-invoke-editor example: the +:line:column syntax is wrong.
>>
>
> Oops, sorry, I was wrong here. I cut out the 'norm' thingy in my test.
> Wrong. It puts the cursor on the column. Sorry for the noise.
>
>
> Rutger
>
> __**_
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/**listinfo/lilypond-user
>



-- 
*Nesmotren govori kao da mačem probada, a jezik je mudrih iscjeljenje.
Izreke 12:18*
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: vim pointing to pdf-viewer and reverse

2012-03-07 Thread Rutger Hofman

On 03/07/2012 11:09 AM, Rutger Hofman wrote:

On 03/07/2012 09:12 AM, David Kastrup wrote:

Stjepan Horvat writes:


On Tue, Mar 6, 2012 at 5:48 PM, David Kastrup wrote:

Stjepan Horvat writes:


Hello..can somebody please tell me how to get vim and a pdf viewer
(xpdf or evince of zathura) to work with vim lilypond-invoke-editor
function..i read everything that is on the web

[snip]


Have you set up your EDITOR environment variable? I quote:

The program ‘lilypond-invoke-editor’ is a small helper program. It
will invoke an editor for the special textedit URIs, and run a web
browser for others. It tests the environment variable EDITOR for the
following patterns,

emacs

this will invoke

emacsclient --no-wait +line:column file

gvim

this will invoke

gvim --remote +:line:normcolumn file

nedit

this will invoke

nc -noask +line file'

The environment variable LYEDITOR is used to override this. It
contains the command line to start the editor, where %(file)s,
%(column)s, %(line)s is replaced with the file, column and line
respectively. The setting

emacsclient --no-wait +%(line)s:%(column)s %(file)s

for LYEDITOR is equivalent to the standard emacsclient invocation.





 From gvim's man page, I understand how one can position the cursor at
startup on a line (+line or +:line), but I do /not/ grasp how it is put
on a column. Indeed, gvim gives me an error if I follow the
lilypond-invoke-editor example: the +:line:column syntax is wrong.


Oops, sorry, I was wrong here. I cut out the 'norm' thingy in my test. 
Wrong. It puts the cursor on the column. Sorry for the noise.


Rutger

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


Re: vim pointing to pdf-viewer and reverse

2012-03-07 Thread Rutger Hofman

On 03/07/2012 09:12 AM, David Kastrup wrote:

Stjepan Horvat  writes:


On Tue, Mar 6, 2012 at 5:48 PM, David Kastrup  wrote:

Stjepan Horvat  writes:


Hello..can somebody please tell me how to get vim and a pdf viewer
(xpdf or evince of zathura) to work with vim lilypond-invoke-editor
function..i read everything that is on the web


An impressive feat.


and couldn't figure it out..thank you.


What is unclear with
http://lilypond.org/doc/v2.15/Documentation/usage/point-and-click>?



I put the command 'urlCommand "lilypond-invoke-editor %s"' at the end
of /etc/xpdfrc (i use archlinux)..and then when i tryed to hit a note
in xpdf it tryes to open emacs..the secend thing that i tryed is to
start gvim with options 'gvim --remote +:line:normcolumn myfile.ly'
and i get an error like this in gvim 'E492: Not an editor command:
:line:normcolumn|cal foreground()|if&im|star|en|redr|f' and this
'E247: no registered server named "GVIM": Send failed. Trying to
execute locally' in terminal..

I tought it is simple as that..but from mail-archive i saw that it is
more complicated than i tought..but still did not understand how to
set it up..


Have you set up your EDITOR environment variable?  I quote:

The program ‘lilypond-invoke-editor’ is a small helper program. It will invoke 
an editor for the special textedit URIs, and run a web browser for others. It 
tests the environment variable EDITOR for the following patterns,

emacs

 this will invoke

 emacsclient --no-wait +line:column file

gvim

 this will invoke

 gvim --remote +:line:normcolumn file

nedit

 this will invoke

   nc -noask +line file'

The environment variable LYEDITOR is used to override this. It contains the 
command line to start the editor, where %(file)s, %(column)s, %(line)s is 
replaced with the file, column and line respectively. The setting

 emacsclient --no-wait +%(line)s:%(column)s %(file)s

for LYEDITOR is equivalent to the standard emacsclient invocation.





From gvim's man page, I understand how one can position the cursor at 
startup on a line (+line or +:line), but I do /not/ grasp how it is put 
on a column. Indeed, gvim gives me an error if I follow the 
lilypond-invoke-editor example: the +:line:column syntax is wrong.
The gvim/GVIM stuff on 'no registered server' (I think caused be the 
--remote flag) can be ignored, gvim starts up stand-alone anyway after that.


Evince appears to have its own set of obstacles. Some Ubuntu pages seem 
to suggest the problem (Permission denied) is related to apparmor.d but 
I have no clue how to make that behave as desired.


Rutger


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


Re: vim pointing to pdf-viewer and reverse

2012-03-07 Thread Rutger Hofman

On 03/07/2012 11:09 AM, Rutger Hofman wrote:

On 03/07/2012 09:12 AM, David Kastrup wrote:

Stjepan Horvat writes:


On Tue, Mar 6, 2012 at 5:48 PM, David Kastrup wrote:

Stjepan Horvat writes:


Hello..can somebody please tell me how to get vim and a pdf viewer
(xpdf or evince of zathura) to work with vim lilypond-invoke-editor

[snip]


Evince appears to have its own set of obstacles. Some Ubuntu pages seem
to suggest the problem (Permission denied) is related to apparmor.d but
I have no clue how to make that behave as desired.


I got it to work after all on Ubuntu Lucid:

I followed instructions in 
http://lists.gnu.org/archive/html/lilypond-user/2007-06/msg00185.html 
(and Mark Knoop's follow-up at a lower speed). IFAIU, this configures 
Gnome apps to handle 'textedit' commands by invoking lilypond-invoke-editor.


The apparmor.d stuff:

Edit /etc/apparmor.d/abstractions/evince to add the following 2 lines 
(replace /usr/ with the prefix of your Lilypond installation):


/usr/bin/lilypond-invoke-editor Ux,
/usr/bin/lilypond-wrapper.guile Ux,

The second line appears necessary because lilypond-invoke-editor is a 
symlink to lilypond-wrapper.guile which is actually executed.


Then

$ sudo /etc/init.d/apparmor reload

Rutger

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


Re: vim pointing to pdf-viewer and reverse

2012-03-07 Thread Stjepan Horvat
Frescobaldi is very good and i like it..the only lack of it is that it
doesn't have vim mode..and intergrated midi player..10/10..i'm very
used to work without mouse..selecting whole line is simple as
shift+v..y for yank and p for paste..:)

I will try to understand it..and get it to work this afternoon..

On Wed, Mar 7, 2012 at 9:12 AM, David Kastrup  wrote:
> Stjepan Horvat  writes:
>
>> On Tue, Mar 6, 2012 at 5:48 PM, David Kastrup  wrote:
>>> Stjepan Horvat  writes:
>>>
 Hello..can somebody please tell me how to get vim and a pdf viewer
 (xpdf or evince of zathura) to work with vim lilypond-invoke-editor
 function..i read everything that is on the web
>>>
>>> An impressive feat.
>>>
 and couldn't figure it out..thank you.
>>>
>>> What is unclear with
>>> http://lilypond.org/doc/v2.15/Documentation/usage/point-and-click>?
>
>> I put the command 'urlCommand "lilypond-invoke-editor %s"' at the end
>> of /etc/xpdfrc (i use archlinux)..and then when i tryed to hit a note
>> in xpdf it tryes to open emacs..the secend thing that i tryed is to
>> start gvim with options 'gvim --remote +:line:normcolumn myfile.ly'
>> and i get an error like this in gvim 'E492: Not an editor command:
>> :line:normcolumn|cal foreground()|if &im|star|en|redr|f' and this
>> 'E247: no registered server named "GVIM": Send failed. Trying to
>> execute locally' in terminal..
>>
>> I tought it is simple as that..but from mail-archive i saw that it is
>> more complicated than i tought..but still did not understand how to
>> set it up..
>
> Have you set up your EDITOR environment variable?  I quote:
>
> The program 'lilypond-invoke-editor' is a small helper program. It will 
> invoke an editor for the special textedit URIs, and run a web browser for 
> others. It tests the environment variable EDITOR for the following patterns,
>
> emacs
>
>this will invoke
>
>emacsclient --no-wait +line:column file
>
> gvim
>
>this will invoke
>
>gvim --remote +:line:normcolumn file
>
> nedit
>
>this will invoke
>
>  nc -noask +line file'
>
> The environment variable LYEDITOR is used to override this. It contains the 
> command line to start the editor, where %(file)s, %(column)s, %(line)s is 
> replaced with the file, column and line respectively. The setting
>
>emacsclient --no-wait +%(line)s:%(column)s %(file)s
>
> for LYEDITOR is equivalent to the standard emacsclient invocation.
>
>
>
> --
> David Kastrup



-- 
Nesmotren govori kao da mačem probada, a jezik je mudrih iscjeljenje.
Izreke 12:18

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


Re: vim pointing to pdf-viewer and reverse

2012-03-07 Thread David Kastrup
Stjepan Horvat  writes:

> On Tue, Mar 6, 2012 at 5:48 PM, David Kastrup  wrote:
>> Stjepan Horvat  writes:
>>
>>> Hello..can somebody please tell me how to get vim and a pdf viewer
>>> (xpdf or evince of zathura) to work with vim lilypond-invoke-editor
>>> function..i read everything that is on the web
>>
>> An impressive feat.
>>
>>> and couldn't figure it out..thank you.
>>
>> What is unclear with
>> http://lilypond.org/doc/v2.15/Documentation/usage/point-and-click>?

> I put the command 'urlCommand "lilypond-invoke-editor %s"' at the end
> of /etc/xpdfrc (i use archlinux)..and then when i tryed to hit a note
> in xpdf it tryes to open emacs..the secend thing that i tryed is to
> start gvim with options 'gvim --remote +:line:normcolumn myfile.ly'
> and i get an error like this in gvim 'E492: Not an editor command:
> :line:normcolumn|cal foreground()|if &im|star|en|redr|f' and this
> 'E247: no registered server named "GVIM": Send failed. Trying to
> execute locally' in terminal..
>
> I tought it is simple as that..but from mail-archive i saw that it is
> more complicated than i tought..but still did not understand how to
> set it up..

Have you set up your EDITOR environment variable?  I quote:

The program ‘lilypond-invoke-editor’ is a small helper program. It will invoke 
an editor for the special textedit URIs, and run a web browser for others. It 
tests the environment variable EDITOR for the following patterns,

emacs

this will invoke

emacsclient --no-wait +line:column file

gvim

this will invoke

gvim --remote +:line:normcolumn file

nedit

this will invoke

  nc -noask +line file'

The environment variable LYEDITOR is used to override this. It contains the 
command line to start the editor, where %(file)s, %(column)s, %(line)s is 
replaced with the file, column and line respectively. The setting

emacsclient --no-wait +%(line)s:%(column)s %(file)s

for LYEDITOR is equivalent to the standard emacsclient invocation.



-- 
David Kastrup

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


Re: vim pointing to pdf-viewer and reverse

2012-03-07 Thread Martin Tarenskeen



On Wed, 7 Mar 2012, Stjepan Horvat wrote:


I put the command 'urlCommand "lilypond-invoke-editor %s"' at the end
of /etc/xpdfrc (i use archlinux)..and then when i tryed to hit a note
in xpdf it tryes to open emacs..the secend thing that i tryed is to
start gvim with options 'gvim --remote +:line:normcolumn myfile.ly'
and i get an error like this in gvim 'E492: Not an editor command:
:line:normcolumn|cal foreground()|if &im|star|en|redr|f' and this
'E247: no registered server named "GVIM": Send failed. Trying to
execute locally' in terminal..

I tought it is simple as that..but from mail-archive i saw that it is
more complicated than i tought..but still did not understand how to
set it up..


I once tried to set something like that up with vim. Did have a little bit 
of luck with xpdf but I never succeeded setting it up with evince.


The easiest way to be able to benifit from this cool point-and-click 
feature is installing the newest Frescobaldi. Then it just works 
out-of-the-box. Even in both ways: you can click in the Lilypond source 
and see where it is in the pdf-viewer and vice-versa! That's what I have 
done and it works great. I still also use vim to quickly edit Lilypond 
files, but without point-and-click functionality.


--

MT


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


Re: vim pointing to pdf-viewer and reverse

2012-03-07 Thread Stjepan Horvat
I put the command 'urlCommand "lilypond-invoke-editor %s"' at the end
of /etc/xpdfrc (i use archlinux)..and then when i tryed to hit a note
in xpdf it tryes to open emacs..the secend thing that i tryed is to
start gvim with options 'gvim --remote +:line:normcolumn myfile.ly'
and i get an error like this in gvim 'E492: Not an editor command:
:line:normcolumn|cal foreground()|if &im|star|en|redr|f' and this
'E247: no registered server named "GVIM": Send failed. Trying to
execute locally' in terminal..

I tought it is simple as that..but from mail-archive i saw that it is
more complicated than i tought..but still did not understand how to
set it up..

On Tue, Mar 6, 2012 at 5:48 PM, David Kastrup  wrote:
> Stjepan Horvat  writes:
>
>> Hello..can somebody please tell me how to get vim and a pdf viewer
>> (xpdf or evince of zathura) to work with vim lilypond-invoke-editor
>> function..i read everything that is on the web
>
> An impressive feat.
>
>> and couldn't figure it out..thank you.
>
> What is unclear with
> http://lilypond.org/doc/v2.15/Documentation/usage/point-and-click>?
>
> --
> David Kastrup
>
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user



-- 
Nesmotren govori kao da mačem probada, a jezik je mudrih iscjeljenje.
Izreke 12:18

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


Re: vim pointing to pdf-viewer and reverse

2012-03-06 Thread David Kastrup
Stjepan Horvat  writes:

> Hello..can somebody please tell me how to get vim and a pdf viewer
> (xpdf or evince of zathura) to work with vim lilypond-invoke-editor
> function..i read everything that is on the web

An impressive feat.

> and couldn't figure it out..thank you.

What is unclear with
http://lilypond.org/doc/v2.15/Documentation/usage/point-and-click>?

-- 
David Kastrup


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


vim pointing to pdf-viewer and reverse

2012-03-06 Thread Stjepan Horvat
Hello..can somebody please tell me how to get vim and a pdf viewer
(xpdf or evince of zathura) to work with vim lilypond-invoke-editor
function..i read everything that is on the web and couldn't figure it
out..thank you.

-- 
Nesmotren govori kao da mačem probada, a jezik je mudrih iscjeljenje.
Izreke 12:18

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