From: Heikki Junes <heikki.junes@hut.fi>
Date: Fri, 23 May 2003 21:38:38 +0000 (+0000)
Subject: Match one-character brackets without two-character brackets.
X-Git-Tag: release/1.7.20~14
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9ce6de643a210c8d4c9ebb2c867ba47d2384e498;p=lilypond.git

Match one-character brackets without two-character brackets.
---

diff --git a/ChangeLog b/ChangeLog
index b62bf72bf0..dbbf9d0698 100644
--- 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.
diff --git a/lilypond-indent.el b/lilypond-indent.el
index bfa2941844..c2b5305a57 100644
--- a/lilypond-indent.el
+++ b/lilypond-indent.el
@@ -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)