changeset 96509:0b35188a36dd

(sgml-font-lock-syntactic-keywords): Use syntax-ppss on a position *before* the char we want to change.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 05 Jul 2008 04:26:11 +0000
parents d5f79224e1c5
children ad09327f37a0
files lisp/ChangeLog lisp/textmodes/sgml-mode.el
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Jul 04 20:29:10 2008 +0000
+++ b/lisp/ChangeLog	Sat Jul 05 04:26:11 2008 +0000
@@ -1,8 +1,13 @@
+2008-07-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* 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  <dann@ics.uci.edu>
 
 	* 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  <lekktu@gmail.com>
 
--- a/lisp/textmodes/sgml-mode.el	Fri Jul 04 20:29:10 2008 +0000
+++ b/lisp/textmodes/sgml-mode.el	Sat Jul 05 04:26:11 2008 +0000
@@ -292,7 +292,11 @@
   '(("\\(<\\)!--" (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