Point and click: HELP ME PLEASE...

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Point and click: HELP ME PLEASE...

Marco-102
I use Lilypond to write music. The manual says that there exist a funcion called point and click that allows clicking on the .pdf file to find the line in the .ly file.
It is not clear how to set the parameters. I use:
emacs as editor,
evince as pdf viewer,
xdvi as dvi viewer,
but even I looked for solution I have never succeeded.
Please help me (I'm a beginner of both Lilypond and Linux),
Marco.
_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Point and click: HELP ME PLEASE...

Mark Knoop-4
Marco wrote:

> I use Lilypond to write music. The manual says that there exist a funcion
> called point and click that allows clicking on the .pdf file to find the
> line in the .ly file.
> It is not clear how to set the parameters. I use:
> emacs as editor,
> evince as pdf viewer,
> xdvi as dvi viewer,
> but even I looked for solution I have never succeeded.
> Please help me (I'm a beginner of both Lilypond and Linux),
> Marco.
Evince ignores the embedded textedit:// urls by default, but you can
tell it via gconf to pass them to whatever you like.

Apply the attached gconf schema file with:

gconftool-2 --install-schema-file=textedit.schemas

And save the attached script in ~/bin/ (don't forget to make it
executable. I use gvim as my editor, so you'll have to make some changes
to use it with emacs. It should be fairly self-explanatory - let me know
if you need any help. Emacs users might have some tips too...

If you uncomment the lines with 'logfile', the script will record your
clicks to a log - useful for debugging.

Cheers,

Mark

--
Mark Knoop

<gconfschemafile>
    <schemalist>    
      <schema>
        <key>/schemas/desktop/gnome/url-handlers/textedit/command</key>
        <applyto>/desktop/gnome/url-handlers/textedit/command</applyto>
        <type>string</type>
        <default>~/bin/textedit_url.sh %s</default>
        <locale name="C">
          <short>The handler for textedit urls</short>
          <long>The command used to handle textedit URLs, if enabled.</long>
        </locale>
      </schema>
      <schema>
        <key>/schemas/desktop/gnome/url-handlers/textedit/enabled</key>
        <applyto>/desktop/gnome/url-handlers/textedit/enabled</applyto>
        <type>bool</type>
        <default>true</default>
        <locale name="C">
          <short>Whether the specified command should handle textedit URLs</short>
          <long>True if the command specified in the "command" key should handle textedit URLs.</long>
        </locale>
      </schema>
  </schemalist>
</gconfschemafile>

_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user

textedit_url.sh (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Point and click: HELP ME PLEASE...

Mark Knoop-4
Marco wrote:
> I thank you for your help, but I'm not so expert to do all what you said...

Hi Marco,

Firstly, make sure you keep replying to the list - other people may have
ideas to help you, and others may be helped by this thread.

Secondly, please don't top-post.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Top-posting

More below...

> I'm a Ubuntu user and I'm not very able working in the command line:
> for example what is gconf and what have I to do  (and where: command line,
> emacs, elsewhere....?),
> what is the logfile I have to uncomment?
> what have I to do with the code you have written (<gconfschemafile>) and
> the file you attached ?

OK, firstly I'll describe the two files in a bit more detail. The first
is an XML file (your email client may just display it in the message,
not as an attachment). Save it somewhere (on your desktop will be fine)
as '/home/<username>/textedit-url-handler.schemas' where <username> is
your linux username.

The second file is a Bash shell script which accepts the point-and-click
url from Evince and turns it into a form that is usable by a text editor
- in my case gvim. Save this file as
'/home/<username>/bin/textedit_url.sh'. You may need to create the 'bin'
directory.

Then open a terminal (command-line) and enter the command:

gconftool-2 --install-schema-file=~/textedit-url-handler.schemas

Then open the Bash script for editing in emacs. The # character
designates comments in bash - lines starting with # are ignored. Remove
the # from the start of the lines which include the word 'logfile', i.e.
lines 7, 8, 26, 52. Then go to line 47 - comment out (i.e. insert a # at
the beginning of) the next three lines:

#KEYS="<Esc>:${LINENUM}<Return>${STARTPOS}|"
#gvim --remote $FILENAME
#gvim --remote-send $KEYS

and add this line:

emacsclient --no-wait +${LINENUM}:${STARTPOS} $FILENAME

Save the file. In your terminal window, enter the following:

touch ~/textedit_url.log
tail -f ~/textedit_url.log

Then open a lilypond pdf in evince, and try clicking on one of the
notes. There should be some output in the terminal window which is
logging the script, and hopefully emacs should open. Let us know how you go.

(An excellent introduction to Bash scripting is here:
http://www.faqs.org/docs/abs/HTML/index.html)

--
Mark Knoop


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Point and click: HELP ME PLEASE...

Bertalan Fodor (LilyPondTool)
If you are new to lilypond I strongly recommend using LilyPondTool (http://lilypondtool.organum.hu), while it is mainly aimed at Windows users (because the installation of java is the most simple on that platform), it works perfectly well on Linux.

Bert

ps For me please do top-post if you like, because I mainly read email on a mobile connection, getting only the first 4K of mails :-)
pps There are strong arguments for and against top-posting, so I don't want to start a flame.

Mark Knoop írta:
Marco wrote:
  
I thank you for your help, but I'm not so expert to do all what you said...
    

Hi Marco,

Firstly, make sure you keep replying to the list - other people may have
ideas to help you, and others may be helped by this thread.

Secondly, please don't top-post.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Top-posting

More below...

  
I'm a Ubuntu user and I'm not very able working in the command line:
for example what is gconf and what have I to do  (and where: command line,
emacs, elsewhere....?),
what is the logfile I have to uncomment?
what have I to do with the code you have written (<gconfschemafile>) and
the file you attached ?
    


_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Point and click: HELP ME PLEASE...

John Mandereau-2
In reply to this post by Mark Knoop-4
Le mardi 12 juin 2007 à 13:48 +0100, Mark Knoop a écrit :
> Marco wrote:
[snip]

> > I'm a Ubuntu user and I'm not very able working in the command line:
> > for example what is gconf and what have I to do  (and where: command line,
> > emacs, elsewhere....?),
> > what is the logfile I have to uncomment?
> > what have I to do with the code you have written (<gconfschemafile>) and
> > the file you attached ?
>
> OK, firstly I'll describe the two files in a bit more detail. The first
> is an XML file (your email client may just display it in the message,
> not as an attachment). Save it somewhere (on your desktop will be fine)
> as '/home/<username>/textedit-url-handler.schemas' where <username> is
> your linux username.
>
> The second file is a Bash shell script which accepts the point-and-click
> url from Evince and turns it into a form that is usable by a text editor
> - in my case gvim. Save this file as
> '/home/<username>/bin/textedit_url.sh'. You may need to create the 'bin'
> directory.
>
> Then open a terminal (command-line) and enter the command:
>
> gconftool-2 --install-schema-file=~/textedit-url-handler.schemas
>
> Then open the Bash script for editing in emacs. The # character
> designates comments in bash - lines starting with # are ignored. Remove
> the # from the start of the lines which include the word 'logfile', i.e.
> lines 7, 8, 26, 52. Then go to line 47 - comment out (i.e. insert a # at
> the beginning of) the next three lines:
>
> #KEYS="<Esc>:${LINENUM}<Return>${STARTPOS}|"
> #gvim --remote $FILENAME
> #gvim --remote-send $KEYS
>
> and add this line:
>
> emacsclient --no-wait +${LINENUM}:${STARTPOS} $FILENAME
>
> Save the file. In your terminal window, enter the following:
>
> touch ~/textedit_url.log
> tail -f ~/textedit_url.log
>
> Then open a lilypond pdf in evince, and try clicking on one of the
> notes. There should be some output in the terminal window which is
> logging the script, and hopefully emacs should open. Let us know how you go.
Hi Mark,
Thanks for your script and GConf schema!  I've tested it and I have some
comments.

First, textedit_url.sh is actually started only if I remove '~/bin/'
from the command in the schema (of course, ~/bin is in my PATH).  Maybe
lda expansion is not performed here?

On my Fedora 7 box with Gnome 2.18, Evince (or Gnome) doesn't convert
colons to '%3A' in URLs, so textedit_url.sh should be modified a little.

Here's attached the .sh script which works for me.  I've modified it to
use Emacs.  The most straightforward way to start Emacs as a server is

emacs -f server-start [YOURFILE.ly]


Cheers
--
John Mandereau <[hidden email]>

_______________________________________________
lilypond-user mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-user

textedit_url.sh (1K) Download Attachment