]> git.donarmstrong.com Git - lilypond.git/commitdiff
match better scheme slurs. refontify if '}' was inserted after '%'.
authorHeikki Junes <heikki.junes@hut.fi>
Tue, 10 Jun 2003 18:32:37 +0000 (18:32 +0000)
committerHeikki Junes <heikki.junes@hut.fi>
Tue, 10 Jun 2003 18:32:37 +0000 (18:32 +0000)
ChangeLog
lilypond-indent.el

index 1bf8173c3869308608957f8def613d54f5b9d526..6d14006546ef2877770264eb49e49e88c42d8d1b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-06-10  Heikki Junes  <hjunes@cc.hut.fi>
+
+       * lilypond-indent.el: Match better slurs in scheme expressions.
+       Refontify buffer if a block-comment-ender, '}' after '%', is inserted.
+
 2003-06-10  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * scm/chord-name.scm (set-chord-name-style): Update for 'ignatzek.
index 1940e72ab264e58af82cc2e1470ae79b3d5945d9..2556fde035e9a1e1df89be1ecd30d295872a3a84 100644 (file)
@@ -340,7 +340,7 @@ slur-paren-p defaults to nil.
        (setq paren-regexp (concat (mapconcat 'car (mapcar 'cdr regexp-alist) "\\|") "\\|"
                                   (mapconcat 'cdr (mapcar 'cdr regexp-alist) "\\|")))))
     (if (and (eq dir 1)
-            (memq (char-after oldpos) '(?[ ?{)))
+            (memq (char-after oldpos) '(?[ ?{ ?\()))
        (forward-char 1))
     (while (and (if (not (eq dir 1)) 
                    (> level 0) 
@@ -374,7 +374,8 @@ slur-paren-p defaults to nil.
        (progn
          (if (sequencep bracket-type)
              (if (looking-at "..[][)(]") (forward-char 1)))
-         (if (looking-at ".[][><)(]") (forward-char 1)))
+         (if (and (not (looking-at "[)(]"))
+                  (looking-at ".[][><)(]")) (forward-char 1)))
       (backward-char 1))
     (if (= level 0) 
        (point)
@@ -505,14 +506,19 @@ builtin 'blink-matching-open' is not used. In syntax table, see
   (interactive)
   (let ((oldpos (point)))
     (self-insert-command 1)
-    (if (and blink-matching-paren
-            (not (LilyPond-inside-string-or-comment-p))
-            (save-excursion (re-search-backward 
-                             (concat (mapconcat 'cdr (mapcar 'cdr LilyPond-parens-regexp-alist) "\\|") "\\|)") nil t)
-                            (eq oldpos (1- (match-end 0)))))
-       (progn (backward-char 1)
-              (LilyPond-blink-matching-paren)
-              (forward-char 1)))))
+    ;; Refontify buffer if a block-comment-ender '%}' is inserted
+    (if (and (eq (char-before (point)) ?})
+            (eq (char-before (- (point) 1)) ?%))
+       (font-lock-fontify-buffer)
+      ;; Match paren if the cursor is not inside string or comment.
+      (if (and blink-matching-paren
+              (not (LilyPond-inside-string-or-comment-p))
+              (save-excursion (re-search-backward 
+                               (concat (mapconcat 'cdr (mapcar 'cdr LilyPond-parens-regexp-alist) "\\|") "\\|)") nil t)
+                              (eq oldpos (1- (match-end 0)))))
+         (progn (backward-char 1)
+                (LilyPond-blink-matching-paren)
+                (forward-char 1))))))
 
 ;;; REDEFINITIONS
 (defun scan-sexps (pos dir)