diff options
| author | Stefan Monnier | 2005-10-21 06:01:22 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2005-10-21 06:01:22 +0000 |
| commit | 889c5dad201c98a3eefc91b1ec9f2f7595d03ec0 (patch) | |
| tree | b63d7319c6cab47ba9c86e5d0c027c4acae1f9b0 | |
| parent | 68f1aaeeadf985bacaf2b8d28ef4bafe56bae0b2 (diff) | |
| download | emacs-889c5dad201c98a3eefc91b1ec9f2f7595d03ec0.tar.gz emacs-889c5dad201c98a3eefc91b1ec9f2f7595d03ec0.zip | |
(syntax-ppss-flush-cache): Fix corner boundary case.
Suggested by Martin Rudalics <rudalics@gmx.at>.
| -rw-r--r-- | lisp/emacs-lisp/syntax.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index 126c8d50dd9..6c897319433 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el | |||
| @@ -83,10 +83,14 @@ point (where the PPSS is equivalent to nil).") | |||
| 83 | (setq syntax-ppss-cache (cdr syntax-ppss-cache))) | 83 | (setq syntax-ppss-cache (cdr syntax-ppss-cache))) |
| 84 | ;; Throw away `last' value if made invalid. | 84 | ;; Throw away `last' value if made invalid. |
| 85 | (when (< beg (or (car syntax-ppss-last) 0)) | 85 | (when (< beg (or (car syntax-ppss-last) 0)) |
| 86 | (if (< beg (or (car (nth 10 syntax-ppss-last)) | 86 | ;; If syntax-begin-function jumped to BEG, then the old state at BEG can |
| 87 | (nth 9 syntax-ppss-last) | 87 | ;; depend on the text after BEG (which is presumably changed). So if |
| 88 | (nth 2 syntax-ppss-last) | 88 | ;; BEG=(car (nth 10 syntax-ppss-last)) don't reuse that data because the |
| 89 | 0)) | 89 | ;; assumed nil state at BEG may not be valid any more. |
| 90 | (if (<= beg (or (car (nth 10 syntax-ppss-last)) | ||
| 91 | (nth 9 syntax-ppss-last) | ||
| 92 | (nth 2 syntax-ppss-last) | ||
| 93 | 0)) | ||
| 90 | (setq syntax-ppss-last nil) | 94 | (setq syntax-ppss-last nil) |
| 91 | (setcar syntax-ppss-last nil))) | 95 | (setcar syntax-ppss-last nil))) |
| 92 | ;; Unregister if there's no cache left. Sadly this doesn't work | 96 | ;; Unregister if there's no cache left. Sadly this doesn't work |
| @@ -293,5 +297,5 @@ Point is at POS when this function returns." | |||
| 293 | 297 | ||
| 294 | (provide 'syntax) | 298 | (provide 'syntax) |
| 295 | 299 | ||
| 296 | ;;; arch-tag: 302f1eeb-e77c-4680-a8c5-c543e01161a5 | 300 | ;; arch-tag: 302f1eeb-e77c-4680-a8c5-c543e01161a5 |
| 297 | ;;; syntax.el ends here | 301 | ;;; syntax.el ends here |