From 1ef65a651bc0af68f169b0052f2bad8984471e11 Mon Sep 17 00:00:00 2001 From: Heikki Junes Date: Fri, 14 Oct 2005 12:35:25 +0000 Subject: [PATCH] * elisp/lilypond-font-lock.el, elisp/lilypond-indent.el: Avoid nil as an argument for char-syntax: use (char-syntax (or nil 0)) instead of (char-syntax nil), thanks to Milan Zamazal. --- ChangeLog | 6 ++++++ THANKS | 1 + elisp/lilypond-font-lock.el | 4 ++-- elisp/lilypond-indent.el | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index bbc1949426..6e9165c347 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-10-14 Heikki Junes + + * elisp/lilypond-font-lock.el, elisp/lilypond-indent.el: Avoid nil + as an argument for char-syntax: use (char-syntax (or nil 0)) + instead of (char-syntax nil), thanks to Milan Zamazal. + 2005-10-14 Han-Wen Nienhuys * make/lilypond.fedora.spec.in (Group): add lilypond-internals to diff --git a/THANKS b/THANKS index a0b8a290a0..48c6573909 100644 --- a/THANKS +++ b/THANKS @@ -28,6 +28,7 @@ Jamie Bullock D. Josiah Boothby Kieren MacMillan Kris Shaffer +Milan Zamazal Nancho Alvarez Nicolas Sceaux Steve Doonan diff --git a/elisp/lilypond-font-lock.el b/elisp/lilypond-font-lock.el index 9e71ad6f02..224ab779de 100644 --- a/elisp/lilypond-font-lock.el +++ b/elisp/lilypond-font-lock.el @@ -180,8 +180,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 '( ?\( ?\) ))) diff --git a/elisp/lilypond-indent.el b/elisp/lilypond-indent.el index fd9ce60dab..de988f9ff5 100644 --- a/elisp/lilypond-indent.el +++ b/elisp/lilypond-indent.el @@ -383,7 +383,7 @@ slur-paren-p defaults to nil. ;; match concurrent one-char opening and closing slurs (if (and (eq dir 1) (not (sequencep bracket-type)) - (eq (char-syntax (char-after oldpos)) ?\() + (eq (char-syntax (or (char-after oldpos) 0)) ?\() (not (eq (char-after oldpos) ?<))) ;; anyway do not count open slur, since already level = -1 (progn (forward-char 1) -- 2.39.2