]> git.donarmstrong.com Git - lilypond.git/commitdiff
match two-char slurs
authorHeikki Junes <heikki.junes@hut.fi>
Mon, 2 Jun 2003 22:31:43 +0000 (22:31 +0000)
committerHeikki Junes <heikki.junes@hut.fi>
Mon, 2 Jun 2003 22:31:43 +0000 (22:31 +0000)
ChangeLog
lilypond-indent.el

index 85aa755f46552bab64eb0e5821c8dd4bc1c8b552..8321981b9e92430cd50e8df9375515a3d187dcf1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -60,6 +60,9 @@
 
        * scm/output-lib.scm (func, arg->string): Re-add from archive.
        (Were these silently removed, without ChangeLog entry?)
+2003-06-03  Heikki Junes  <hjunes@cc.hut.fi>
+
+       * lilypond-indent.el: match two-char slurs \[ ... \] and \( ... \).
 
 2003-05-27  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
index 3d62982550e1479d1d9a12556122011b746610a1..d699494c7653a96c9317ac3e1a56deb0b4771d00 100644 (file)
@@ -281,8 +281,8 @@ Argument LIM limit."
      ( ?}  .  ("{" . "}"))
      ;; ligatures  '\[ ... \]' are skipped in the following expression
      ( ?]  .  ("\\([^\\]\\([\\][\\]\\)*\\|^\\)[[]" . "\\([^\\]\\([\\][\\]\\)*\\|^\\)[]]"))
-     ;; ( "\\]" . ("\\([^\\]\\|^\\)\\([\\][\\]\\)*[\\][[]" . "\\([^\\]\\|^\\)\\([\\][\\]\\)*[\\][]]"))
-     ;; ( "\\)" . ("\\([^\\]\\|^\\)\\([\\][\\]\\)*[\\][(]" . "\\([^\\]\\|^\\)\\([\\][\\]\\)*[\\][)]"))
+     ( "\\]" . ("\\([^\\]\\|^\\)\\([\\][\\]\\)*[\\][[]" . "\\([^\\]\\|^\\)\\([\\][\\]\\)*[\\][]]"))
+     ( "\\)" . ("\\([^\\]\\|^\\)\\([\\][\\]\\)*[\\][(]" . "\\([^\\]\\|^\\)\\([\\][\\]\\)*[\\][)]"))
      ))
 
 
@@ -346,8 +346,10 @@ slur-paren-p defaults to nil.
                   (if (and (= match ?<)
                            (looking-at ".\\s-+<\\|\\({\\|}\\|<\\|>\\|(\\|)\\|[][]\\)<"))
                       (forward-char 1))))))
-    ;; somehow here two-char brackets \<, \>, \[, \], \(, \) are handled
-    (if (looking-at ".<\\|.>\\|.[][)(]") (forward-char 1))
+    ;; jump to the matching slur
+    (if (sequencep bracket-type)
+       (if (looking-at "..[][)(]") (forward-char 1)))
+    (if (looking-at ".[][><)(]") (forward-char 1))
     (if (= level 0) 
        (point)
       (progn (goto-char oldpos)
@@ -409,15 +411,18 @@ builtin 'blink-matching-open' is not used. In syntax table, see
        (if (eq bracket-type ?])
             (message "trying to match ligatures \\[ ... \\]")
           (message "trying to match slurs \\( ... \\)")))
+    (if (eq char-before-bracket-type ?\\)
+       (setq bracket-type (string char-before-bracket-type bracket-type)))
     (save-restriction
       (if blink-matching-paren-distance
          (narrow-to-region (max (point-min)
                                 (- (point) blink-matching-paren-distance))
                            oldpos)))
-    (if (memq bracket-type '(?> ?} ?]))
-       ;; < { need to be mutually balanced and nested, so search backwards for both of these bracket types 
+    (if (memq bracket-type '(?> ?}))
+       ;; < { need to be mutually balanced and nested, so search backwards for both of these bracket types 
        (LilyPond-beginning-of-containing-sexp nil nil)  
       ;; whereas ( ) slurs within music don't, so only need to search for ( )
+      ;; use same mechanism for [ ] slurs
       (LilyPond-beginning-of-containing-sexp bracket-type t))
     (setq blinkpos (point))
     (setq mismatch