;; - 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 '->'
(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
(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 '( ?\( ?\) )))