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