From 9ce6de643a210c8d4c9ebb2c867ba47d2384e498 Mon Sep 17 00:00:00 2001 From: Heikki Junes Date: Fri, 23 May 2003 21:38:38 +0000 Subject: [PATCH] Match one-character brackets without two-character brackets. --- ChangeLog | 5 +++++ lilypond-indent.el | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b62bf72bf0..dbbf9d0698 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-05-24 Heikki Junes + + * lilypond-indent.el: Match '(' and ')' by skipping '\(' and '\)'. + Similarly, match '[' and ']' by skipping '\[' and '\]'. + 2003-05-23 Jan Nieuwenhuizen * .cvsignore: Add aclocal.m4. diff --git a/lilypond-indent.el b/lilypond-indent.el index bfa2941844..c2b5305a57 100644 --- a/lilypond-indent.el +++ b/lilypond-indent.el @@ -279,7 +279,8 @@ Argument LIM limit." ;; but a b c^-> and a b c^^> are close brackets with tenuto/marcato before them ;; also \> and \< are hairpins ( ?} . ("{" . "}")) - ( ?] . ("[[]" . "[]]")) + ;; ligatures '\[ ... \]' are skipped in the following expression + ( ?] . ("\\([^\\]\\|^\\)[[]" . "\\([^\\]\\|^\\)[]]")) )) @@ -320,7 +321,8 @@ slur-paren-p defaults to nil. (if (LilyPond-inside-scheme-p) (setq paren-regexp "(\\|)") (if slur-paren-p - (setq regexp-alist (cons '( ?\) . ("(" . ")")) regexp-alist))) + ;; expressional slurs '\( ... \)' are not taken into account + (setq regexp-alist (cons '( ?\) . ("\\([^\\]\\|^\\)(" . "\\([^\\]\\|^\\))")) regexp-alist))) (if (memq bracket-type (mapcar 'car regexp-alist)) (progn (setq paren-regexp (cdr (assoc bracket-type regexp-alist))) (setq paren-regexp (concat (car paren-regexp) "\\|" (cdr paren-regexp)))) @@ -340,7 +342,8 @@ slur-paren-p defaults to nil. (if (and (= match ?<) (looking-at ".\\s-+<\\|\\({\\|}\\|<\\|>\\|(\\|)\\|[][]\\)<")) (forward-char 1)))))) - (if (looking-at ".<\\|.>") (forward-char 1)) + ;; somehow here two-char brackets \<, \>, \[, \], \(, \) are handled + (if (looking-at ".<\\|.>\\|.[][)(]") (forward-char 1)) (if (= level 0) (point) (progn (goto-char oldpos) -- 2.39.5