]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/point-and-click.itely
Trivial edit that I forgot to upload last time.
[lilypond.git] / Documentation / user / point-and-click.itely
1 @node Point and click
2 @appendix Point and click
3 @cindex point and click
4
5
6 Point and click lets you find notes in the input by clicking on them
7 in the PDF viewer.  This makes it easier to find input that causes
8 some error in the sheet music.
9
10 When this functionality is active, LilyPond adds hyperlinks to the PDF
11 file. These hyperlinks are sent to the web-browser, which opens a
12 text-editor with the cursor in the right place. 
13
14 To make this chain work, the following should done:
15
16 @itemize @bullet
17
18 @item
19 The PDF viewer must be configured for following hyperlinks, preferably
20 using Mozilla Firefox.
21
22 For Xpdf on Unix, the following should be present in
23 @file{xpdfrc}@footnote{On unix, this file is found either in
24 @file{/etc/xpdfrc} or as @file{.xpdfrc} in your home directory.}
25
26 @example
27 urlCommand     "firefox -remote 'OpenURL(%s)'"
28 @end example
29
30 @item Your web-browser must be configured for the @code{textedit}
31 protocol,
32
33 For Mozilla and Mozilla Firefox, this is done by adding following
34 lines to the @file{prefs.js}@footnote{On a typical unix system, this
35 file is found in your home-directory under
36 @file{.mozilla/firefox/default.trn/prefs.js}.}  
37
38 @ignore
39 mozilla wants us do store this in user.js:
40 http://www.mozilla.org/support/firefox/edit#user
41
42 location on different systems:
43 http://www.mozilla.org/support/firefox/edit#profile
44
45 @end ignore
46
47 @example
48 user_pref("network.protocol-handler.app.textedit", "lilypond-pdfpc-helper");
49 user_pref("network.protocol-handler.warn-external.textedit", false);
50 @end example
51
52 @end itemize
53
54 The program @file{lilypond-pdfpc-helper} is a small helper program.
55 It tests the environment variable @code{EDITOR} for the following
56 patterns,
57
58 @table @code
59 @item emacs
60   this will invoke
61 @example
62 emacsclient --no-wait +@var{line}:@var{column} @var{file}
63 @end example
64 @item vim
65   this will invoke
66 @example
67 gvim --remote +:@var{line}:norm@var{column} @var{file}
68 @end example
69
70 @item nedit
71 this will invoke
72 @example
73   nc -noask +@var{line} @var{file}'
74 @end example
75 @end table
76
77 The environment variable @code{LYEDITOR} is used to override this. It
78 contains the command line to start the editor, where @code{%(file)s},
79 @code{%(column)s}, @code{%(line)s} is replaced with the file, column
80 and line respectively. The  setting
81
82 @example
83 emacsclient --no-wait +%(line)s:%(column)s %(file)s
84 @end example
85
86 @noindent
87 for @code{LYEDITOR} is equivalent to the standard emacsclient
88 invocation.
89
90
91 @cindex file size, output
92
93 The point and click links enlarge the output files significantly. For
94 reducing the size of PDF and PS files, point and click may be switched
95 off by issuing
96
97 @example
98 #(ly:set-option 'point-and-click #f)
99 @end example
100
101 @noindent
102 in a @file{.ly} file.  Alternately, you may pass this as an command-line
103 option
104
105 @example
106 lilypond -e "(ly:set-option 'point-and-click #f)" file.ly
107 @end example
108