]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/point-and-click.itely
019d9238625c43df2bc0c068970aa15590744591
[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 @cindex source specials
6 @cindex specials, source
7
8 Point and click lets you find notes in the input by clicking on them in
9 the Xdvi window.  This makes it easier to find input that causes some
10 error in the sheet music.
11
12 To use it, you need the following software:
13
14 @itemize @bullet
15 @item a dvi viewer that supports src specials.
16
17 The most obvious choice is Xdvi@footnote{KDVI also provides src
18 @cindex Xdvi
19 @cindex KDVI
20 @cindex KDE
21 specials, but does not use the kpathsea library, so it cannot find
22 LilyPond font and PostScript library files.}, version 22.36 or newer.
23 It is available from
24 @uref{ftp://@/ftp@/.math@/.berkeley@/.edu/@/pub/@/Software/@/TeX/@/xdvi@/.tar@/.gz,
25 ftp@/.math@/.berkeley@/.edu}.
26
27 Most @TeX{} distributions ship with @command{xdvik}, which is always a few
28 versions behind the official Xdvi.  To find out which Xdvi you are
29 running, try @code{xdvi -version} or @code{xdvi.bin -version}.
30
31 @item an editor with a client/@/server interface (or a lightweight GUI
32 editor):
33
34
35 @cindex editor
36
37 @itemize @minus
38 @item
39 Emacs.  Emacs is an extendable text editor.  It is available from
40 @uref{http://@/www@/.gnu@/.org/@/software/@/emacs/}.  You need version 21
41 to use column location.
42
43 @c move this elsewhere?
44
45
46 @cindex Emacs
47 @cindex Emacs mode
48 @cindex lilypond-mode for Emacs
49 @cindex syntax coloring
50
51 @item
52 XEmacs.  XEmacs is very similar to Emacs.
53
54 @cindex XEmacs
55
56 @item
57 NEdit.  NEdit runs under Windows and Unix.
58 It is available from @uref{http://@/www@/.nedit@/.org}.
59
60 @cindex NEdit
61
62 @item
63 GVim.  GVim is a GUI variant of VIM, the popular VI
64 clone.  It is available from @uref{http://@/www@/.vim@/.org}.
65
66 @cindex GVim
67 @cindex Vim
68
69
70 @item
71 jEdit.  jEdit is an editor written in Java with extensive plug-in
72 support.  The LilyPond plugin for jEdit comes with an DVI 
73 viewer, which is preconfigured for point-and-click. 
74
75 @cindex jEdit
76
77 @end itemize
78 @end itemize
79
80
81 Xdvi must be configured to find the @TeX{} fonts and music
82 fonts.  Refer to the Xdvi documentation for more information.
83
84 To use point-and-click, add one of these lines to the top of your @file{.ly}
85 file:
86
87 @example
88 #(ly:set-point-and-click 'line)
89 @end example
90 @cindex line-location
91
92 When viewing, Control-Mousebutton@tie{}1 will take you to the originating
93 spot in the @file{.ly} file.  Control-Mousebutton@tie{}2 will show all
94 clickable boxes.
95
96 If you correct large files with point-and-click, be sure to start
97 correcting at the end of the file.  When you start at the top, and
98 insert one line, all following locations will be off by a line.
99
100 @cindex Emacs
101 For using point-and-click with Emacs, add the following
102 In your Emacs startup file (usually @file{~/@/.emacs}):
103 @example
104 (server-start)
105 @end example
106
107 Make sure that the environment variable @var{XEDITOR} is set to
108 @example
109 emacsclient --no-wait +%l %f
110 @end example
111 @cindex @var{XEDITOR}
112 If you use XEmacs instead of Emacs, insert @code{(gnuserve-start)} in
113 your @file{.emacs} file, and set @code{XEDITOR} to
114 @code{gnuclient -q +%l %f}.
115
116 For using Vim, set @code{XEDITOR} to @code{gvim --remote +%l %f}, or
117 use this argument with Xdvi's @code{-editor} option.
118
119 @cindex NEdit
120 For using NEdit, set @code{XEDITOR} to @code{nc -noask +%l %f}, or
121 use this argument with Xdvi's @code{-editor} option.
122
123 It can also make your editor jump to the exact location of the note
124 you clicked.  This is only supported on Emacs and VIM.  Users of Emacs version
125 20 must apply the patch @file{emacsclient.patch}.  Users of version 21
126 must apply @file{server.el.patch} (version 21.2 and earlier).  At the
127 top of the @code{.ly} file, replace the @code{set-point-and-click} line
128 with the following line:
129 @example
130 #(ly:set-point-and-click 'line-column)
131 @end example
132 @cindex line-column-location
133 and set @code{XEDITOR} to @code{emacsclient --no-wait +%l:%c %f}.  Vim
134 users can set @code{XEDITOR} to @code{gvim --remote +:%l:norm%c| %f}.