]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/application/running.itely
Doc: clarify FDL vs. public domain.
[lilypond.git] / Documentation / application / running.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2
3 @ignore
4     Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5
6     When revising a translation, copy the HEAD committish of the
7     version that you are working on.  See TRANSLATION for details.
8 @end ignore
9
10 @c \version "2.12.0"
11
12
13 @node Running lilypond
14 @chapter Running @command{lilypond}
15
16 This chapter details the technicalities of running LilyPond.
17
18 @menu
19 * Normal usage::                
20 * Command-line usage::          
21 * Error messages::              
22 * Common errors::               
23 * Point and click::             
24 * Text editor support::         
25 @end menu
26
27
28 @node Normal usage
29 @section Normal usage
30
31 Most users run LilyPond through a GUI; if you have not done so
32 already, read @rlearning{Introduction}.  If you use an alternate
33 editor to write lilypond files, see the documentation for that
34 program.
35
36
37 @node Command-line usage
38 @section Command-line usage
39
40 This section contains extra information about using LilyPond on the
41 command-line.  This may be desirable to pass extra options to the
42 program.  In addition, there are certain extra @q{helper} programs (such
43 as @code{midi2ly}) which are only available on the command-line.
44
45 By @q{command-line}, we mean the command line in the operating system.
46 Windows users might be more familiar with the terms @q{DOS shell} or
47 @q{command shell}.  MacOS@tie{}X users might be more familiar with the terms
48 @q{terminal} or @q{console}.  Some additional setup is required
49 for MacOS@tie{}X users; please see @rgeneral{MacOS X}.
50
51 Describing how to use this part of an operating system is outside the
52 scope of this manual; please consult other documentation on this topic
53 if you are unfamiliar with the command-line.
54
55 @menu
56 * Invoking lilypond::           
57 * Command line options for lilypond::  
58 * Environment variables::       
59 @end menu
60
61 @node Invoking lilypond
62 @unnumberedsubsec Invoking @command{lilypond}
63
64 The @command{lilypond} executable may be called as follows from
65 the command line.
66
67 @example
68 lilypond [@var{option}]@dots{} @var{file}@dots{}
69 @end example
70
71
72 When invoked with a filename that has no extension, the @file{.ly}
73 extension is tried first.  To read input from stdin, use a
74 dash (@code{-}) for @var{file}.
75
76 When @file{filename.ly} is processed it will produce @file{filename.ps}
77 and @file{filename.pdf} as output.  Several files can be specified;
78 they will each be processed independently.  @footnote{The status of
79 GUILE is not reset after processing a @code{.ly} file, so be careful
80 not to change any system defaults from within Scheme.}
81
82 If @file{filename.ly} contains more than one @code{\book}
83 block, then the rest of the scores will be output in numbered files,
84 starting with @file{filename-1.pdf}.  In addition, the value of
85 @code{output-suffix} will be inserted between the basename and the
86 number.  An input file containing
87
88 @example
89 #(define output-suffix "violin")
90 \score @{ @dots{} @}
91 #(define output-suffix "cello")
92 \score @{ @dots{} @}
93 @end example
94
95 @noindent
96 will output @var{base}@file{-violin.pdf} and
97 @var{base}@file{-cello-1.pdf}.
98
99
100 @node Command line options for lilypond
101 @unnumberedsubsec Command line options for @command{lilypond}
102
103 @cindex Invoking @command{lilypond}
104 @cindex command line options for @command{lilypond}
105 @cindex options, command line
106 @cindex switches
107
108 The following options are supported:
109
110 @table @code
111
112 @item -e,--evaluate=@var{expr}
113 Evaluate the Scheme @var{expr} before parsing any @file{.ly} files.
114 Multiple @code{-e} options may be given, they will be evaluated
115 sequentially.
116
117 The expression will be evaluated in the @code{guile-user} module, so
118 if you want to use definitions in @var{expr}, use
119
120 @example
121 lilypond -e '(define-public a 42)'
122 @end example
123
124 @noindent
125 on the command-line, and include
126
127 @example
128 #(use-modules (guile-user))
129 @end example
130
131 @noindent
132 at the top of the @code{.ly} file.
133
134 @item -f,--format=@var{format}
135 which formats should be written.  Choices for @code{format} are
136 @code{svg}, @code{ps}, @code{pdf}, and @code{png}.
137
138 Example: @code{lilypond -fpng @var{filename}.ly}
139
140
141
142 @item -d,--define-default=@var{var}=@var{val}
143 This sets the internal program option @var{var} to the Scheme value
144 @var{val}.  If @var{val} is not supplied, then @var{#t} is used.  To
145 switch off an option, @code{no-} may be prefixed to @var{var}, e.g.
146
147 @cindex point and click, command line
148
149 @example
150 -dno-point-and-click
151 @end example
152
153 @noindent
154 is the same as
155 @example
156 -dpoint-and-click='#f'
157 @end example
158
159 Here are a few interesting options.
160
161 @cindex help, command line
162
163 @table @samp
164 @item help
165 Running @code{lilypond -dhelp} will print all of the @code{-d} options
166 available.
167
168 @cindex paper-size, command line
169
170 @item paper-size
171 This option sets the default paper-size,
172 @example
173 -dpaper-size=\"letter\"
174 @end example
175
176 @noindent
177 Note that the string must be enclosed in escaped quotes ( @code{\"} ).
178 @c Match " in previous line to help context-sensitive editors
179
180 @cindex safe, command line
181
182 @item safe
183 Do not trust the @code{.ly} input.
184
185 When LilyPond formatting is available through a web server, either the
186 @code{--safe} or the @code{--jail} option @b{MUST} be passed.  The
187 @code{--safe} option will prevent inline Scheme code from wreaking
188 havoc, for example
189
190 @quotation
191 @verbatim
192 #(system "rm -rf /")
193 {
194   c4^#(ly:export (ly:gulp-file "/etc/passwd"))
195 }
196 @end verbatim
197 @end quotation
198
199 The @code{-dsafe} option works by evaluating in-line Scheme
200 expressions in a special safe module.  This safe module is derived from
201 GUILE @file{safe-r5rs} module, but adds a number of functions of the
202 LilyPond API.  These functions are listed in @file{scm/@/safe@/-lily@/.scm}.
203
204 In addition, safe mode disallows @code{\include} directives and
205 disables the use of backslashes in @TeX{} strings.
206
207 In safe mode, it is not possible to import LilyPond variables
208 into Scheme.
209
210 @code{-dsafe} does @emph{not} detect resource overuse.  It is still possible to
211 make the program hang indefinitely, for example by feeding cyclic data
212 structures into the backend.  Therefore, if using LilyPond on a
213 publicly accessible webserver, the process should be limited in both
214 CPU and memory usage.
215
216 The safe mode will prevent many useful LilyPond snippets from being
217 compiled.  The @code{--jail} is a more secure alternative, but
218 requires more work to set up.
219
220 @cindex output format, setting
221 @item backend
222 the output format to use for the back-end.  Choices for @code{format} are
223 @table @code
224 @item ps
225 @cindex PostScript output
226  for PostScript.
227
228   Postscript files include TTF, Type1 and OTF fonts.  No subsetting of
229   these fonts is done.  When using oriental character sets, this can
230   lead to huge files.
231
232 @item eps
233
234 @cindex Postscript, encapulated
235 @cindex EPS (Encapsulated PostScript)
236
237  for encapsulated PostScript.  This dumps every page (system) as a separate
238 @file{EPS} file, without fonts, and as one collated @file{EPS} file with
239 all pages (systems) including fonts.
240
241 This mode is used by default by @command{lilypond-book}.
242
243 @item svg
244
245 @cindex SVG (Scalable Vector Graphics)
246
247  for SVG (Scalable Vector Graphics).
248
249  This creates a single SVG file, without embedded fonts, for every
250  page of output.  It is recommended to install the Century
251  Schoolbook fonts, included with your LilyPond installation, for
252  optimal rendering.  Under UNIX, simply copy these fonts from the
253  LilyPond directory (typically
254  @file{/usr/share/lilypond/VERSION/fonts/otf/}) to
255  @file{~/.fonts/}.  The SVG output should be compatible with any
256  SVG editor or user agent.
257
258 @item scm
259
260 @cindex Scheme dump
261
262  for a dump of the raw, internal Scheme-based drawing commands.
263
264 @item null
265  do not output a printed score; has the same effect as @code{-dno-print-pages}.
266 @end table
267
268 Example: @code{lilypond -dbackend=svg @var{filename}.ly}
269
270 @item preview
271 @cindex preview, command line
272 Generate an output file containing the titles and the first system
273
274 @item print-pages
275 Generate the full pages, the default.  @code{-dno-print-pages} is
276 useful in combination with @code{-dpreview}.
277
278 @end table
279
280
281
282 @item -h,--help
283 Show a summary of usage.
284
285 @item -H,--header=@var{FIELD}
286 Dump a header field to file @file{BASENAME.@var{FIELD}}.
287
288 @item --include, -I=@var{directory}
289 Add @var{directory} to the search path for input files.
290 @cindex file searching
291 @cindex search path
292
293 @item -i,--init=@var{file}
294 Set init file to @var{file} (default: @file{init.ly}).
295
296 @item -o,--output=@var{FILE}
297 Set the default output file to @var{FILE}.  The appropriate
298 suffix will be added (e.g. @code{.pdf} for pdf)
299
300 @cindex PostScript output
301
302 @item --ps
303 Generate PostScript.
304
305 @cindex Portable Network Graphics (PNG) output
306
307 @item --png
308 Generate pictures of each page, in PNG format.  This implies
309 @code{--ps}.  The resolution in DPI of the image may be set with
310 @example
311 -dresolution=110
312 @end example
313
314 @cindex Portable Document Format (PDF) output
315
316 @item --pdf
317 Generate PDF.  This implies @code{--ps}.
318
319
320
321 @item -j,--jail=@var{user},@var{group},@var{jail},@var{dir}
322 Run @command{lilypond} in a chroot jail.
323
324 The @code{--jail} option provides a more flexible alternative to
325 @code{--safe} when LilyPond formatting is available through a web
326 server or whenever LilyPond executes externally provided
327 sources.
328
329 The @code{--jail} option works by changing the root of @command{lilypond} to
330 @var{jail} just before starting the actual compilation process.  The user
331 and group are then changed to match those provided, and the current
332 directory is changed to @var{dir}.  This setup guarantees that it is not
333 possible (at least in theory) to escape from the jail.  Note that for
334 @code{--jail} to work @command{lilypond} must be run as root, which is usually
335 accomplished in a safe way using @command{sudo}.
336
337 Setting up a jail is a slightly delicate matter, as we must be sure that
338 LilyPond is able to find whatever it needs to compile the source
339 @emph{inside the jail}.  A typical setup comprises the following items:
340
341 @table @asis
342 @item Setting up a separate filesystem
343 A separate filesystem should be created for LilyPond, so that it can be
344 mounted with safe options such as @code{noexec}, @code{nodev}, and
345 @code{nosuid}.  In this way, it is impossible to run executables or to
346 write directly to a device from LilyPond.  If you do not want to create a
347 separate partition, just create a file of reasonable size and use it to
348 mount a loop device.  A separate filesystem also guarantees that LilyPond
349 cannot write more space than it is allowed.
350
351 @item Setting up a separate user
352 A separate user and group (say, @code{lily}/@code{lily}) with low
353 privileges should be used to run LilyPond inside the jail.  There should
354 be a single directory writable by this user, which should be passed in
355 @var{dir}.
356
357 @item Preparing the jail
358 LilyPond needs to read a number of files while running.  All these files
359 are to be copied into the jail, under the same path they appear in the
360 real root filesystem.  The entire content of the LilyPond installation
361 (e.g., @file{/usr/share/lilypond})
362 should be copied.
363
364 If problems arise, the simplest way to trace them down is to run
365 LilyPond using @command{strace}, which will allow you to determine which
366 files are missing.
367
368 @item Running LilyPond
369 In a jail mounted with @code{noexec} it is impossible to execute any external
370 program.  Therefore LilyPond must be run with a backend that does not
371 require any such program.  As we already mentioned, it must be also run
372 with superuser privileges (which, of course, it will lose immediately),
373 possibly using @command{sudo}.  It is a good idea to limit the number of
374 seconds of CPU time LilyPond can use (e.g., using @command{ulimit
375 -t}), and, if your operating system supports it, the amount of memory
376 that can be allocated.
377 @end table
378
379
380 @item -v,--version
381 Show version information.
382
383 @item -V,--verbose
384 Be verbose: show full paths of all files read, and give timing
385 information.
386
387 @item -w,--warranty
388 Show the warranty with which GNU LilyPond comes. (It comes with
389 @strong{NO WARRANTY}!)
390 @end table
391
392 @node Environment variables
393 @unnumberedsubsec Environment variables
394
395
396 @cindex LANG
397 @cindex LILYPOND_DATADIR
398
399 @command{lilypond} recognizes the following environment variables:
400 @table @code
401 @item LILYPOND_DATADIR
402 This specifies a directory where locale messages and
403 data files will be looked up by default.  The directory should contain
404 subdirectories called @file{ly/}, @file{ps/}, @file{tex/}, etc.
405
406 @item LANG
407 This selects the language for the warning messages.
408
409 @item LILYPOND_GC_YIELD
410 With this variable the memory footprint and performance can be
411 adjusted.  It is a percentage tunes memory management behavior.  With
412 higher values, the program uses more memory, with smaller values, it
413 uses more CPU time.  The default value is @code{70}.
414
415 @end table
416
417
418 @node Error messages
419 @section Error messages
420
421 @cindex error messages
422 Different error messages can appear while compiling a file:
423
424 @table @emph
425
426 @item Warning
427 @cindex warning
428 Something looks suspect.  If you are requesting something out of the
429 ordinary then you will understand the message, and can ignore it.
430 However, warnings usually indicate that something is wrong with the
431 input file.
432
433 @item Error
434 @cindex error
435 Something is definitely wrong.  The current processing step (parsing,
436 interpreting, or formatting) will be finished, but the next step will
437 be skipped.
438
439 @item Fatal error
440 @cindex fatal error
441 Something is definitely wrong, and LilyPond cannot continue.  This
442 happens rarely.  The most usual cause is misinstalled fonts.
443
444 @item Scheme error
445 @cindex trace, Scheme
446 @cindex call trace
447 @cindex Scheme error
448 Errors that occur while executing Scheme code are caught by the Scheme
449 interpreter.  If running with the verbose option (@code{-V} or
450 @code{--verbose}) then a call trace of the offending
451 function call is printed.
452
453 @item Programming error
454 @cindex Programming error
455 There was some internal inconsistency.  These error messages are
456 intended to help the programmers and debuggers.  Usually, they can be
457 ignored.  Sometimes, they come in such big quantities that they obscure
458 other output.
459
460 @item Aborted (core dumped)
461 @cindex Aborted (core dumped)
462 This signals a serious programming error that caused the program to
463 crash.  Such errors are considered critical.  If you stumble on one,
464 send a bug-report.
465 @end table
466
467 @cindex errors, message format
468 If warnings and errors can
469 be linked to some part of the input file, then error messages have the
470 following form
471
472 @example
473 @var{filename}:@var{lineno}:@var{columnno}: @var{message}
474 @var{offending input line}
475 @end example
476
477 A line-break is inserted in the offending line to indicate the column
478 where the error was found.  For example,
479
480 @example
481 test.ly:2:19: error: not a duration: 5
482   @{ c'4 e'
483            5 g' @}
484 @end example
485
486 These locations are LilyPond's best guess about where the warning or
487 error occurred, but (by their very nature) warnings and errors occur
488 when something unexpected happens.  If you can't see an error in the
489 indicated line of your input file, try checking one or two lines
490 above the indicated position.
491
492 More information about errors is given in @ref{Common errors}.
493
494
495 @node Common errors
496 @section Common errors
497
498 The error conditions described below occur often, yet the cause
499 is not obvious or easily found.  Once seen and understood, they
500 are easily handled.
501
502
503 @menu
504 * Music runs off the page::     
505 * An extra staff appears::      
506 * Apparent error in ../ly/init.ly::  
507 * Error message Unbound variable %::  
508 * Error message FT_Get_Glyph_Name::  
509 @end menu
510
511 @node Music runs off the page
512 @unnumberedsubsec Music runs off the page
513
514 Music running off the page over the right margin or appearing
515 unduly compressed is almost always due to entering an incorrect
516 duration on a note, causing the final note in a measure to extend
517 over the bar line.  It is not invalid if the final note in a
518 measure does not end on the automatically entered bar line, as the
519 note is simply assumed to carry over into the next measure.  But
520 if a long sequence of such carry-over measures occurs the music
521 can appear compressed or may flow off the page because automatic
522 line breaks can be inserted only at the end of complete measures,
523 i.e., where all notes end before or at the end of the measure.
524
525 @warning{An incorrect duration can cause line breaks to be
526 inhibited, leading to a line of highly compressed music or
527 music which flows off the page.}
528
529 The incorrect duration can be found easily if bar checks are used,
530 see @ruser{Bar and bar number checks}.
531
532 If you actually intend to have a series of such carry-over measures
533 you will need to insert an invisible bar line where you want the
534 line to break.  For details, see @ruser{Bar lines}.
535
536
537 @node An extra staff appears
538 @unnumberedsubsec An extra staff appears
539
540 If contexts are not created explicitly with @code{\new} they will be
541 silently created as soon as a command is encountered which cannot
542 be applied to an existing context.  In simple scores the automatic
543 creation of contexts is useful, and most of the examples in the
544 LilyPond manuals take advantage of this simplification.  But
545 occasionally the silent creation of contexts can give rise to
546 unexpected new staves or scores.  For example, it might be expected
547 that the following code would cause all note heads within the
548 following staff to be colored red, but in fact it results in two
549 staves with the note heads remaining the default black in the lower
550 staff.
551
552 @lilypond[quote,verbatim,relative=2]
553 \override Staff.NoteHead #'color = #red
554 \new Staff { a }
555 @end lilypond
556
557 This is because a @code{Staff} context does not exist when the
558 override is processed, so one is implicitly created and the override
559 is applied to it, but then the @code{\new Staff} command creates
560 another, separate, staff into which the notes are placed.  The
561 correct code to color all note heads red is
562
563 @lilypond[quote,verbatim,relative=2]
564 \new Staff {
565   \override Staff.NoteHead #'color = #red
566   a
567 }
568 @end lilypond
569
570 As a second example, if a @code{\relative} command is placed inside
571 a @code{\repeat} command two staves result, the second offset from
572 the first, because the @code{\repeat} command generates two
573 @code{\relative} blocks, which each implicitly create @code{Staff}
574 and @code{Voice} blocks.
575
576 @lilypond[quote,verbatim]
577 \repeat unfold 2 \relative { c d e f }
578 @end lilypond
579
580 The correct way is to reverse the @code{\repeat} and
581 @code{\relative} commands, like this:
582
583 @lilypond[quote,verbatim]
584 \relative {
585   \repeat unfold 2 { c d e f }
586 }
587 @end lilypond
588
589
590 @node Apparent error in ../ly/init.ly
591 @unnumberedsubsec Apparent error in @code{../ly/init.ly}
592
593 Various obscure error messages may appear about syntax errors in
594 @code{../ly/init.ly} if the input file is not correctly formed,
595 for example, if it does not contain correctly
596 matched braces or quote signs.
597
598 The most common error is a missing brace, (@code{@}}), at the end of
599 a @code{score} block.  Here the solution is obvious: check the
600 @code{score} block is correctly terminated.  The correct structure
601 of an input file is described in @rlearning{How LilyPond input files work}.
602 Using an editor which automatically highlights matching brackets and
603 braces is helpful to avoid such errors.
604
605 A second common cause is no white space between the last syllable
606 of a lyrics block and the terminating brace, (@code{@}}).  Without
607 this separation the brace is taken to be part of the syllable.  It
608 is always advisable to ensure there is white space before and after
609 @emph{every} brace.  For the importance of this when using lyrics,
610 see @ruser{Lyrics explained}.
611
612 This error message can also appear if a terminating quote sign,
613 (@code{"}), is omitted.  In this case an accompanying error message
614 @c keep "-matching straight in fancy editors
615 should give a line number close to the line in error.  The
616 mismatched quote will usually be on the line one or two above.
617
618 @node Error message Unbound variable %
619 @unnumberedsubsec Error message Unbound variable %
620
621 This error message will appear at the bottom of the console
622 output or log file together with a @qq{GUILE signalled an error ...}
623 message every time a Scheme routine is called which (invalidly)
624 contains a @emph{LilyPond} rather than a @emph{Scheme} comment.
625
626 LilyPond comments begin with a percent sign, (@code{%}), and must
627 not be used within Scheme routines.  Scheme comments begin with a
628 semi-colon, (@code{;}).
629
630 @node Error message FT_Get_Glyph_Name
631 @unnumberedsubsec Error message FT_Get_Glyph_Name
632
633 This error messages appears in the console output or log file if
634 an input file contains a non-ASCII character and was not saved in
635 UTF-8 encoding.  For details, see @ruser{Text encoding}.
636
637
638 @node Point and click
639 @section Point and click
640
641 @cindex point and click
642
643 Point and click lets you find notes in the input by clicking on them
644 in the PDF viewer.  This makes it easier to find input that causes
645 some error in the sheet music.
646
647 When this functionality is active, LilyPond adds hyperlinks to the PDF
648 file.  These hyperlinks are sent to the web-browser, which opens a
649 text-editor with the cursor in the right place.
650
651 To make this chain work, you should configure your PDF viewer to
652 follow hyperlinks using the @file{lilypond-invoke-editor} script
653 supplied with LilyPond.
654
655 For Xpdf on UNIX, the following should be present in
656 @file{xpdfrc}@footnote{On UNIX, this file is found either in
657 @file{/etc/xpdfrc} or as @file{.xpdfrc} in your home directory.}
658
659 @example
660 urlCommand     "lilypond-invoke-editor %s"
661 @end example
662
663 The program @file{lilypond-invoke-editor} is a small helper
664 program.  It will invoke an editor for the special @code{textedit}
665 URIs, and run a web browser for others.  It tests the environment
666 variable @code{EDITOR} for the following patterns,
667
668 @table @code
669 @item emacs
670   this will invoke
671 @example
672 emacsclient --no-wait +@var{line}:@var{column} @var{file}
673 @end example
674 @item vim
675   this will invoke
676 @example
677 gvim --remote +:@var{line}:norm@var{char} @var{file}
678 @end example
679
680 @item nedit
681 this will invoke
682 @example
683   nc -noask +@var{line} @var{file}'
684 @end example
685 @end table
686
687 The environment variable @code{LYEDITOR} is used to override this.  It
688 contains the command line to start the editor, where @code{%(file)s},
689 @code{%(column)s}, @code{%(line)s} is replaced with the file, column
690 and line respectively.  The  setting
691
692 @example
693 emacsclient --no-wait +%(line)s:%(column)s %(file)s
694 @end example
695
696 @noindent
697 for @code{LYEDITOR} is equivalent to the standard emacsclient
698 invocation.
699
700
701 @cindex file size, output
702
703 The point and click links enlarge the output files significantly.  For
704 reducing the size of PDF and PS files, point and click may be switched
705 off by issuing
706
707 @example
708 \pointAndClickOff
709 @end example
710
711 @noindent
712 in a @file{.ly} file.  Point and click may be explicitly enabled with
713
714 @example
715 \pointAndClickOn
716 @end example
717
718 Alternately, you may disable point and click with a command-line
719 option:
720
721 @example
722 lilypond -dno-point-and-click file.ly
723 @end example
724
725 @warning{You should always turn off point and click in any LilyPond
726 files to be distributed to avoid including path information about
727 your computer in the .pdf file, which can pose a security risk.}
728 @node Text editor support
729 @section Text editor support
730
731 @cindex editors
732 @cindex vim
733 @cindex emacs
734 @cindex modes, editor
735 @cindex syntax coloring
736 @cindex coloring, syntax
737
738 There is support for different text editors for LilyPond.
739
740 @menu
741 * Emacs mode::                  
742 * Vim mode::                    
743 * Other editors::
744 @end menu
745
746 @node Emacs mode
747 @unnumberedsubsec Emacs mode
748
749 Emacs has a @file{lilypond-mode}, which provides keyword
750 autocompletion, indentation, LilyPond specific parenthesis matching
751 and syntax coloring, handy compile short-cuts and reading LilyPond
752 manuals using Info.  If @file{lilypond-mode} is not installed on your
753 platform, see below.
754
755 An Emacs mode for entering music and running LilyPond is contained in
756 the source archive in the @file{elisp} directory.  Do @command{make
757 install} to install it to @var{elispdir}.  The file @file{lilypond-init.el}
758 should be placed to @var{load-path}@file{/site-start.d/} or appended
759 to your @file{~/.emacs} or @file{~/.emacs.el}.
760
761 As a user, you may want add your source path (e.g. @file{~/site-lisp/}) to
762 your @var{load-path} by appending the following line (as modified) to your
763 @file{~/.emacs}
764
765 @c any reason we do not advise:  (push "~/site-lisp" load-path)
766 @example
767 (setq load-path (append (list (expand-file-name "~/site-lisp")) load-path))
768 @end example
769
770
771 @node Vim mode
772 @unnumberedsubsec Vim mode
773
774 For @uref{http://@/www@/.vim@/.org,VIM}, a @file{vimrc} is supplied,
775 along with syntax coloring tools.  A Vim mode for entering music and
776 running LilyPond is contained in the source archive in @code{$VIM}
777 directory.
778
779 The LilyPond file type is detected if the file
780 @file{~/.vim/filetype.vim} has the following content
781
782 @example
783 if exists("did_load_filetypes")
784   finish
785 endif
786 augroup filetypedetect
787   au! BufNewFile,BufRead *.ly,*.ily           setf lilypond
788 augroup END
789 @end example
790
791 Please include this path by appending the following line to your
792 @file{~/.vimrc}
793
794 @example
795 set runtimepath+=/usr/local/share/lilypond/$@{LILYPOND_VERSION@}/vim/
796 @end example
797
798 @noindent
799 where $@{LILYPOND_VERSION@} is your LilyPond version.  If LilyPond was not
800 installed in @file{/usr/local/}, then change this path accordingly.
801
802
803 @node Other editors
804 @unnumberedsubsec Other editors
805
806 Other editors (both text and graphical) support LilyPond, but
807 their special configuration files are not distributed with
808 LilyPond.  Consult their documentation for more information.  Such
809 editors are listed in @rgeneral{Alternate editors}.
810