From 41b90495794f94679f36e7b89f4ce32f02449aca Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 5 Jul 2008 04:26:11 +0000 Subject: [PATCH] (sgml-font-lock-syntactic-keywords): Use syntax-ppss on a position *before* the char we want to change. --- lisp/ChangeLog | 7 ++++++- lisp/textmodes/sgml-mode.el | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c4b6e2a8414..e5e5c7e629c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,8 +1,13 @@ +2008-07-05 Stefan Monnier + + * textmodes/sgml-mode.el (sgml-font-lock-syntactic-keywords): + Use syntax-ppss on a position *before* the char we want to change. + 2008-07-04 Dan Nicolaescu * vc-dir.el (vc-dir-query-replace-regexp): New function. (vc-dir-tool-bar-map, vc-dir-menu-map): Bind it. - (vc-dir-mode-map): Likewise + (vc-dir-mode-map): Likewise. 2008-07-03 Juanma Barranquero diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index d28f55bd70a..67ed335a9c0 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -292,7 +292,11 @@ Any terminating `>' or `/' is not matched.") '(("\\(<\\)!--" (1 "< b")) ("--[ \t\n]*\\(>\\)" (1 "> b")) ;; Double quotes outside of tags should not introduce strings. - ("\\\"" (0 (if (zerop (car (syntax-ppss))) ".")))) + ;; Be careful to call `syntax-ppss' on a position before the one we're + ;; going to change, so as not to need to flush the data we just computed. + ("\"" (0 (if (prog1 (zerop (car (syntax-ppss (match-beginning 0)))) + (goto-char (match-end 0))) + ".")))) "Syntactic keywords for `sgml-mode'.") ;; internal -- 2.39.2