X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=elisp%2Flilypond-font-lock.el;h=73a8df8f7d951b6d373c1d8beab88871b062ff92;hb=1bbeee0cee17cbc721d7c04e55480b64c2a343a4;hp=c2e258a709bbe9d8f9c2d9d581414ee109f54b20;hpb=5e738a5fbbccd3b1cf56976f103633109d584d3c;p=lilypond.git diff --git a/elisp/lilypond-font-lock.el b/elisp/lilypond-font-lock.el index c2e258a709..73a8df8f7d 100644 --- a/elisp/lilypond-font-lock.el +++ b/elisp/lilypond-font-lock.el @@ -1,8 +1,6 @@ ;;; lilypond-font-lock.el --- syntax coloring for LilyPond mode -;; Copyright (C) 1992,1993,1994 Tim Peters - -;; Author: 2001-2003: Heikki Junes +;; Author: 2001-2006: Heikki Junes ;; * Emacs-mode: new keywords, reserved words, identifiers, notenames, ;; some dynamics and brackets are font-lock-keywords ;; * context-dependent syntax-tables @@ -10,16 +8,10 @@ ;; Author: 1995-1996 Barry A. Warsaw ;; 1992-1994 Tim Peters ;; Created: Feb 1992 -;; Version: 1.9.9 -;; Last Modified: 23SEP2003 +;; Version: 2.9.29 +;; Last Modified: 11NOV2006 ;; Keywords: lilypond languages music notation -;; This software is provided as-is, without express or implied -;; warranty. Permission to use, copy, modify, distribute or sell this -;; software, without fee, for any purpose and by any individual or -;; organization, is hereby granted, provided that the above copyright -;; notice and this paragraph appear in all copies. - ;; This started out as a cannabalised version of python-mode.el, by hwn ;; For changes see the LilyPond ChangeLog ;; @@ -93,7 +85,7 @@ ;; - brackets '{[]}' ;; - ties '~' ;; - ligatures \[, \] - '("\\(-?[][~}{]\\|\\\\[][]\\)" 0 font-lock-warning-face t) + '("\\(-?[][~}{]\\|\\\\[][]\\)" 0 font-lock-reference-face t) ;; "on top", ... vertical grouping: ;; - '<>'-chord brackets with '\\'-voice sep., not marcato '->' @@ -162,8 +154,8 @@ (setq defaults (cons '( ?\( . "." ) (cons '( ?\) . "." ) defaults)))) ;; In LilyPond the following chars serve as escape chars, e.g., c^> d-) e_( , ;; but they may be set to punctuation chars, since inside strings they should not act as escape chars - (setq defaults (cons (if (memq ?\- not-punct) '( ?\- . "\\" ) '( ?\- . "." ) ) defaults)) - (setq defaults (cons (if (memq ?\^ not-punct) '( ?\^ . "\\" ) '( ?\^ . "." ) ) defaults)) + (setq defaults (cons (if (memq ?- not-punct) '( ?\- . "\\" ) '( ?\- . "." ) ) defaults)) + (setq defaults (cons (if (memq ?^ not-punct) '( ?^ . "\\" ) '( ?^ . "." ) ) defaults)) (setq defaults (cons (if (memq ?\_ not-punct) '( ?\_ . "\\" ) '( ?\_ . "." ) ) defaults)) (mapcar (function (lambda (x) (modify-syntax-entry @@ -180,8 +172,8 @@ (setq context (parse-partial-sexp (point-min) (point))) (cond ((nth 3 context)) ; inside string ((nth 4 context)) ; inside a comment - ((eq (char-syntax (char-before (point))) ?\\)) ; found escape-char - ((and (eq (char-syntax (char-before (- (point) 1))) ?\\) + ((eq (char-syntax (or (char-before (point)) 0)) ?\\)) ; found escape-char + ((and (eq (char-syntax (or (char-before (- (point) 1)) 0)) ?\\) (memq (char-before (point)) '( ?\) ?\] )))) ; found escape-char ((memq (char-before (point)) '( ?\) )) (LilyPond-mode-set-syntax-table '( ?\( ?\) )))