From: Heikki Junes Date: Tue, 10 Jun 2003 18:32:37 +0000 (+0000) Subject: match better scheme slurs. refontify if '}' was inserted after '%'. X-Git-Tag: release/1.7.21~28 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3486df160eb09ae65945f3fc19e7b3b6aee5ed59;p=lilypond.git match better scheme slurs. refontify if '}' was inserted after '%'. --- diff --git a/ChangeLog b/ChangeLog index 1bf8173c38..6d14006546 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-06-10 Heikki Junes + + * lilypond-indent.el: Match better slurs in scheme expressions. + Refontify buffer if a block-comment-ender, '}' after '%', is inserted. + 2003-06-10 Jan Nieuwenhuizen * scm/chord-name.scm (set-chord-name-style): Update for 'ignatzek. diff --git a/lilypond-indent.el b/lilypond-indent.el index 1940e72ab2..2556fde035 100644 --- a/lilypond-indent.el +++ b/lilypond-indent.el @@ -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)