Mercurial > cpython-lru_cache-weakref
diff Misc/python-mode.el @ 10876:17ae178a3038 legacy-trunk
(py-parse-state): When running under Emacs -- which doesn't have
buffer-syntactic-context -- just short circuit the TQS test by jumping
to point-min and doing the test from there. For long files, this will
be faster than looping with a re-search-backwards.
| author | Barry Warsaw <barry@python.org> |
|---|---|
| date | Mon, 24 May 1999 19:57:32 +0000 |
| parents | 1821e64e08fc |
| children | 2669ac7cd76a |
line wrap: on
line diff
--- a/Misc/python-mode.el Mon May 24 18:37:57 1999 +0000 +++ b/Misc/python-mode.el Mon May 24 19:57:32 1999 +0000 @@ -2786,7 +2786,13 @@ (save-excursion (setq pps (parse-partial-sexp (point) here))) ;; make sure we don't land inside a triple-quoted string (setq done (or (not (nth 3 pps)) - (bobp)))) + (bobp))) + ;; Just go ahead and short circuit the test back to the + ;; beginning of the buffer. This will be slow, but not + ;; nearly as slow as looping through many + ;; re-search-backwards. + (if (not done) + (goto-char (point-min)))) ;; XEmacs (setq done (or (not (buffer-syntactic-context)) (bobp)))
