]> git.donarmstrong.com Git - lilypond.git/blobdiff - elisp/lilypond-indent.el
Merge branch 'cvs-head' of ssh+git://hanwen@repo.or.cz/srv/git/lilypond into master...
[lilypond.git] / elisp / lilypond-indent.el
index 4626646d06a7139dd40c96cb843cdf71dc8ceae9..de988f9ff5acfc9a66505d2ee4a6a9dce9b4aef4 100644 (file)
 ;;; Variables for customising indentation style
 
 ;;; TODO:
-;;;    * currently, in bracket matching one may need a non-bracket 
+;;;    * currently, in bracket matching one may need a non-bracket
 ;;;      chararacter between the bracket characters, like ( ( ) )
 
-(defcustom LilyPond-indent-level 4
-  "*Indentation of lilypond statements with respect to containing block.")
+(defcustom LilyPond-indent-level 2
+  "*Indentation of lilypond statements with respect to containing block."
+  :group 'LilyPond
+  :type 'integer)
 
 (defcustom LilyPond-brace-offset 0
   "*Extra indentation for open braces.
-Compares with other text in same context.")
+Compares with other text in same context."
+  :group 'LilyPond
+  :type 'integer)
 
 (defcustom LilyPond-angle-offset 0
   "*Extra indentation for open angled brackets.
-Compares with other text in same context.")
+Compares with other text in same context."
+  :group 'LilyPond
+  :type 'integer)
 
 (defcustom LilyPond-square-offset 0
   "*Extra indentation for open square brackets.
-Compares with other text in same context.")
+Compares with other text in same context."
+  :group 'LilyPond
+  :type 'integer)
 
 (defcustom LilyPond-scheme-paren-offset 0
   "*Extra indentation for open scheme parens.
-Compares with other text in same context.")
+Compares with other text in same context."
+  :group 'LilyPond
+  :type 'integer)
 
 (defcustom LilyPond-close-brace-offset 0
-  "*Extra indentation for closing braces.")
+  "*Extra indentation for closing braces."
+  :group 'LilyPond
+  :type 'integer)
 
 (defcustom LilyPond-close-angle-offset 0
-  "*Extra indentation for closing angle brackets.")
+  "*Extra indentation for closing angle brackets."
+  :group 'LilyPond
+  :type 'integer)
 
 (defcustom LilyPond-close-square-offset 0
-  "*Extra indentation for closing square brackets.")
+  "*Extra indentation for closing square brackets."
+  :group 'LilyPond
+  :type 'integer)
 
 (defcustom LilyPond-close-scheme-paren-offset 0
-  "*Extra indentation for closing scheme parens.")
+  "*Extra indentation for closing scheme parens."
+  :group 'LilyPond
+  :type 'integer)
 
 (defcustom LilyPond-fancy-comments t
-  "*Non-nil means distiguish between %, %%, and %%% for indentation.")
+  "*Non-nil means distiguish between %, %%, and %%% for indentation."
+  :group 'LilyPond
+  :type 'boolean)
 
 (defcustom LilyPond-comment-region "%%$"
   "*String inserted by \\[LilyPond-comment-region]\
- at start of each line in region.")
+ at start of each line in region."
+  :group 'LilyPond
+  :type 'string)
 
 (defun LilyPond-comment-region (beg-region end-region)
   "Comment/uncomment every line in the region.
@@ -361,7 +383,7 @@ slur-paren-p defaults to nil.
     ;; match concurrent one-char opening and closing slurs
     (if (and (eq dir 1)
             (not (sequencep bracket-type))
-            (eq (char-syntax (char-after oldpos)) ?\()
+            (eq (char-syntax (or (char-after oldpos) 0)) ?\()
             (not (eq (char-after oldpos) ?<)))
        ;; anyway do not count open slur, since already level = -1
         (progn (forward-char 1)