From: David Kastrup Date: Sun, 16 Jun 2013 20:11:09 +0000 (+0200) Subject: Issue 4208/2: Emacs mode: both # and $ should start Scheme X-Git-Tag: release/2.19.16-1~2^2~54^2~21 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a2c45742078a527a0f418ac45239467e0c5c380f;p=lilypond.git Issue 4208/2: Emacs mode: both # and $ should start Scheme --- diff --git a/elisp/lilypond-indent.el b/elisp/lilypond-indent.el index 5e82148ccb..70d24f9b18 100644 --- a/elisp/lilypond-indent.el +++ b/elisp/lilypond-indent.el @@ -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 ?\()