]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4208/2: Emacs mode: both # and $ should start Scheme
authorDavid Kastrup <dak@gnu.org>
Sun, 16 Jun 2013 20:11:09 +0000 (22:11 +0200)
committerDavid Kastrup <dak@gnu.org>
Sat, 6 Dec 2014 12:25:26 +0000 (13:25 +0100)
elisp/lilypond-indent.el

index 5e82148ccbcd953e88a4f895eb0ea8b826825271..70d24f9b185bd3094033dea5e350299a832f7f35 100644 (file)
@@ -452,17 +452,16 @@ slur-paren-p defaults to nil.
   (let ( (test-point (point))
         (level 0) )
     (save-excursion 
-      (if (or (and (/= (point) (point-max))
-                  (= (char-after (point)) ?\()
-                  (or (= (char-after (- (point) 1)) ?#)
-                      (and (= (char-after (- (point) 2)) ?#)
-                           (= (char-after (- (point) 1)) ?`))))
-             (and (re-search-backward "#(\\|#`(" nil t)
+      (if (or (and (eq (char-after (point)) ?\()
+                  (save-excursion
+                    (skip-chars-backward "'`")
+                    (memq (char-before) '(?# ?$))))
+             (and (re-search-backward "[#$][`']?(" nil t)
                   (progn 
                     (search-forward "(")
                     (setq level 1)
                     (while (and (> level 0)
-                                (re-search-forward "(\\|)" test-point t)
+                                (re-search-forward "[()]" test-point t)
                                 (setq match (char-after (match-beginning 0)))
                                 (<= (point) test-point))
                       (if (= match ?\()