]> git.donarmstrong.com Git - lilypond.git/commitdiff
Match one-character brackets without two-character brackets.
authorHeikki Junes <heikki.junes@hut.fi>
Fri, 23 May 2003 21:38:38 +0000 (21:38 +0000)
committerHeikki Junes <heikki.junes@hut.fi>
Fri, 23 May 2003 21:38:38 +0000 (21:38 +0000)
ChangeLog
lilypond-indent.el

index b62bf72bf012c03271377e617217a9483ce2d6b1..dbbf9d0698c848a6d2d547bfbc9a4c5a0bdd684f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-05-24  Heikki Junes  <hjunes@cc.hut.fi>
+
+       * lilypond-indent.el: Match '(' and ')' by skipping '\(' and '\)'.
+       Similarly, match '[' and ']' by skipping '\[' and '\]'.
+
 2003-05-23  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * .cvsignore: Add aclocal.m4.
index bfa2941844d3c0f9d824b433bb5838093ed0c17b..c2b5305a578b7d78d56454ec04539dd743b4f6da 100644 (file)
@@ -279,7 +279,8 @@ Argument LIM limit."
      ;; but a b c^-> and a b c^^> are close brackets with tenuto/marcato before them
      ;; also \> and \< are hairpins
      ( ?}  .  ("{" . "}"))
-     ( ?]  .  ("[[]" . "[]]"))
+     ;; ligatures  '\[ ... \]' are skipped in the following expression
+     ( ?]  .  ("\\([^\\]\\|^\\)[[]" . "\\([^\\]\\|^\\)[]]"))
      ))
 
 
@@ -320,7 +321,8 @@ slur-paren-p defaults to nil.
     (if (LilyPond-inside-scheme-p)
        (setq paren-regexp "(\\|)")
       (if slur-paren-p
-         (setq regexp-alist (cons '( ?\) . ("(" . ")")) regexp-alist)))
+         ;; expressional slurs  '\( ... \)' are not taken into account
+         (setq regexp-alist (cons '( ?\) . ("\\([^\\]\\|^\\)(" . "\\([^\\]\\|^\\))")) regexp-alist)))
       (if (memq bracket-type (mapcar 'car regexp-alist))
          (progn (setq paren-regexp (cdr (assoc bracket-type regexp-alist)))
                 (setq paren-regexp (concat (car paren-regexp) "\\|" (cdr paren-regexp))))
@@ -340,7 +342,8 @@ slur-paren-p defaults to nil.
                   (if (and (= match ?<)
                            (looking-at ".\\s-+<\\|\\({\\|}\\|<\\|>\\|(\\|)\\|[][]\\)<"))
                       (forward-char 1))))))
-    (if (looking-at ".<\\|.>") (forward-char 1))
+    ;; somehow here two-char brackets \<, \>, \[, \], \(, \) are handled
+    (if (looking-at ".<\\|.>\\|.[][)(]") (forward-char 1))
     (if (= level 0) 
        (point)
       (progn (goto-char oldpos)