]> git.donarmstrong.com Git - lilypond.git/commitdiff
Small fixes from Maximilian, thanks!
authorGraham Percival <graham@percival-music.ca>
Thu, 5 Feb 2009 15:08:47 +0000 (23:08 +0800)
committerGraham Percival <graham@percival-music.ca>
Thu, 5 Feb 2009 15:08:47 +0000 (23:08 +0800)
Documentation/devel/programming-work.itexi

index 0bf16ad2438a8c492801f3deb4d3be17af7c36e3..12db3309ff14e3911c214110172b97fc41dbc51e 100644 (file)
@@ -68,10 +68,10 @@ in the documentation.  You can find these guidelines at
 @section Finding functions
 
 When making changes or fixing bugs in LilyPond, one of the initial
-challenges is finding out where in the code tree the functions to be
-modified live.  With nearly 3000 files in the source tree,
-trial-and-error searching is generally inefective. This section describes
-a process for finding interesting code.
+challenges is finding out where in the code tree the functions to
+be modified live.  With nearly 3000 files in the source tree,
+trial-and-error searching is generally ineffective. This section
+describes a process for finding interesting code.
 
 @subsection Using the ROADMAP
 
@@ -88,11 +88,14 @@ Having identified a likely subdirectory to search, the grep utility can
 be used to search for a function name.  The format of the grep command is
 
 @example 
-grep functionName subdirectory/*
+grep -i functionName subdirectory/*
 @end example
 
 This command will search all the contents of the directory subdirectory/
-and display every line in any of the files that contains functionName.
+and display every line in any of the files that contains
+functionName.  The @code{-i} option makes @command{grep} ignore
+case -- this can be very useful if you are not yet familiar with
+our capitalization conventions.
 
 The most likely directories to grep for function names are scm/ for
 scheme files, ly/ for lilypond input (*.ly) files, and lily/ for C++
@@ -209,7 +212,7 @@ If you like using font-lock, you can also add this to your
 @subsection Classes and Types
 
 @verbatim
-             This_is_a_class
+This_is_a_class
 @end verbatim
 
 
@@ -218,7 +221,7 @@ If you like using font-lock, you can also add this to your
 Member variable names end with an underscore:
 
 @verbatim
-     Type Class::member_
+Type Class::member_
 @end verbatim
 
 
@@ -284,7 +287,7 @@ output strings (PostScript, TeX, etc.)
 
 @item
 Messages to be localised must be encapsulated in `_ (STRING)' or
-`_f (FORMAT, ...)'. Eg:
+`_f (FORMAT, ...)'. E.g.:
 
 @verbatim
       warning (_ ("need music in a score"));
@@ -298,18 +301,17 @@ constants for translation, using `_i (STRING)'. The `_i' macro is
 a no-op, it only serves as a marker for `xgettext'.
 
 @verbatim
-      char const* messages[] = {
-      _i ("enable debugging output"),
-      _i ("ignore lilypond version"),
-      0
-      };
-
-    
-      void
-      foo (int i)
-      {
-      puts (gettext (messages i));
-      }
+char const* messages[] = {
+_i ("enable debugging output"),
+_i ("ignore lilypond version"),
+0
+};
+
+void
+foo (int i)
+{
+puts (gettext (messages i));
+}
 @end verbatim
     
 See also `flower/getopt-long.cc' and `lily/main.cc'.
@@ -320,15 +322,15 @@ whitespace to be printed, prepend or append it to the translated
 message
 
 @verbatim
-      message (Calculating line breaks... + " ");
+message ("Calculating line breaks..." + " ");
 @end verbatim
-    
+
 @item
 Error or warning messages displayed with a file name and line
 number never start with a capital, eg,
 
 @verbatim
-       foo.ly: 12: not a duration: 3
+foo.ly: 12: not a duration: 3
 @end verbatim
       
 Messages containing a final verb, or a gerund (`-ing'-form) always
@@ -336,9 +338,9 @@ start with a capital. Other (simpler) messages start with a
 lowercase letter
 
 @verbatim
-      Processing foo.ly...
-      `foo': not declared.
-      Not declaring: `foo'.
+Processing foo.ly...
+`foo': not declared.
+Not declaring: `foo'.
 @end verbatim
     
 @item
@@ -349,8 +351,8 @@ situation, we'll use quoting like this `"message: `%s'"' for all
 strings. Numbers are not quoted:
 
 @verbatim
-      _f ("cannot open file: `%s'", name_str)
-      _f ("cannot find character number: %d", i)
+_f ("cannot open file: `%s'", name_str)
+_f ("cannot find character number: %d", i)
 @end verbatim
     
 @item
@@ -359,32 +361,30 @@ translate a whole message. The english grammar mustn't be imposed
 on the translator. So, instead of
 
 @verbatim
-      stem at  + moment.str () +  does not fit in beam
+stem at  + moment.str () +  does not fit in beam
 @end verbatim
     
 have
 
 @verbatim
-      _f ("stem at %s does not fit in beam", moment.str ())
+_f ("stem at %s does not fit in beam", moment.str ())
 @end verbatim
     
 @item
 Split up multi-sentence messages, whenever possible. Instead of
 
 @verbatim
-      warning (_f ("out of tune!  Can't find: `%s'",
-"Key_engraver"));
-      warning (_f ("cannot find font `%s', loading default",
-      font_name));
+warning (_f ("out of tune!  Can't find: `%s'", "Key_engraver"));
+warning (_f ("cannot find font `%s', loading default", font_name));
 @end verbatim
     
 rather say:
 
 @verbatim
-      warning (out of tune:;
-      warning (_f ("cannot find: `%s', "Key_engraver"));
-      warning (_f ("cannot find font: `%s', font_name));
-      warning (_f ("Loading default font"));
+warning (out of tune:;
+warning (_f ("cannot find: `%s', "Key_engraver"));
+warning (_f ("cannot find font: `%s', font_name));
+warning (_f ("Loading default font"));
 @end verbatim
     
 @item