]> git.donarmstrong.com Git - lilypond.git/commitdiff
add a warning about matching \] or \)
authorHeikki Junes <heikki.junes@hut.fi>
Thu, 22 May 2003 22:30:48 +0000 (22:30 +0000)
committerHeikki Junes <heikki.junes@hut.fi>
Thu, 22 May 2003 22:30:48 +0000 (22:30 +0000)
ChangeLog
lilypond-indent.el

index e5bec0876fb2a4f7da93b32e0fde6395266607a1..9e16cb8853705cf6a86e98f807866576a90769f0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2003-05-22  Heikki Junes  <hjunes@cc.hut.fi>
+
+       * lilypond-indent.el: Add a message about trying to match \] or \).
+       
 2003-05-22  Juergen Reuter  <reuter@ipd.uka.de>
        * input/test/gregorian-scripts.ly, input/test/vaticana.ly: removed
        obsolete "arithmetic_*"
index 21cd641244d11f27916c04c694b50a82a3a0b21b..bfa2941844d3c0f9d824b433bb5838093ed0c17b 100644 (file)
@@ -378,16 +378,20 @@ slur-paren-p defaults to nil.
 ;;; Largely taken from the 'blink-matching-open' in lisp/simple.el in
 ;;; the Emacs distribution.
 
-(defun LilyPond-blink-matching-open (bracket-type)
+(defun LilyPond-blink-matching-open (bracket-type char-before-bracket-type)
   "Move cursor momentarily to the beginning of the sexp before
-point. In lilypond files this is used for closing ), } and >, whereas the
-builtin 'blink-matching-open' is used for closing ],  which is in
-the syntax table"
+point. In lilypond files this is used for closing ), ], } and >, whereas the
+builtin 'blink-matching-open' is not used. In syntax table, see
+`lilypond-font-lock.el', all brackets are punctuation characters."
 ;;; An user does not call this function directly, or by a key sequence.
   ;;  (interactive)
   (let ( (oldpos (point))
         (level 0) 
         (mismatch) )
+    (if (eq char-before-bracket-type ?\\)
+       (if (eq bracket-type ?])
+            (message "trying to match ligatures \\[ ... \\]")
+          (message "trying to match slurs \\( ... \\)")))
     (save-restriction
       (if blink-matching-paren-distance
          (narrow-to-region (max (point-min)
@@ -455,17 +459,17 @@ the syntax table"
     ;; the result is now in backslashed-close-char, BUT
     ;; the result should also be used  -- match also \] or \) !
     ;; Thus, update: LilyPond-parens-regexp-alist, LilyPond-blink-matching-open
-    (setq backslashed-close-char nil)
+    (setq char-before-close-char nil)
     (if (memq close-char '(?] ?\)))
       (progn 
        (setq np 0)
        (while (eq (char-before (- (point) (setq np (+ np 1)))) ?\\)
-         (setq backslashed-close-char (not backslashed-close-char)))))
+         (setq char-before-close-char (if char-before-close-char nil ?\\)))))
     (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-open close-char)
+              (LilyPond-blink-matching-open close-char char-before-close-char)
               (forward-char 1)))))