# HG changeset patch # User Stefan Monnier # Date 1129874482 0 # Node ID f15e775dfb97b17740e2421be06b010d779f597b # Parent d077f2d7aa12b750098175e2e2a1cd201a438a83 (syntax-ppss-flush-cache): Fix corner boundary case. Suggested by Martin Rudalics . diff -r d077f2d7aa12 -r f15e775dfb97 lisp/emacs-lisp/syntax.el --- a/lisp/emacs-lisp/syntax.el Fri Oct 21 05:57:08 2005 +0000 +++ b/lisp/emacs-lisp/syntax.el Fri Oct 21 06:01:22 2005 +0000 @@ -83,10 +83,14 @@ (setq syntax-ppss-cache (cdr syntax-ppss-cache))) ;; Throw away `last' value if made invalid. (when (< beg (or (car syntax-ppss-last) 0)) - (if (< beg (or (car (nth 10 syntax-ppss-last)) - (nth 9 syntax-ppss-last) - (nth 2 syntax-ppss-last) - 0)) + ;; If syntax-begin-function jumped to BEG, then the old state at BEG can + ;; depend on the text after BEG (which is presumably changed). So if + ;; BEG=(car (nth 10 syntax-ppss-last)) don't reuse that data because the + ;; assumed nil state at BEG may not be valid any more. + (if (<= beg (or (car (nth 10 syntax-ppss-last)) + (nth 9 syntax-ppss-last) + (nth 2 syntax-ppss-last) + 0)) (setq syntax-ppss-last nil) (setcar syntax-ppss-last nil))) ;; Unregister if there's no cache left. Sadly this doesn't work @@ -293,5 +297,5 @@ (provide 'syntax) -;;; arch-tag: 302f1eeb-e77c-4680-a8c5-c543e01161a5 +;; arch-tag: 302f1eeb-e77c-4680-a8c5-c543e01161a5 ;;; syntax.el ends here