From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani
Cl=C3=A9ment Pit-Claudel <clement.pitclaudel@live.com> writ= es:
> Here's a reliable repro:
>
> def f():
>=C2=A0 =C2=A0 =C2=A0"
>
> def g():
>=C2=A0 =C2=A0 =C2=A0"""That's a docstring""= ;"
>=C2=A0 =C2=A0 =C2=A0return ''
It can be reduced a bit:
Debugger entered--Lisp error: (cl-assertion-failed ((> string-start last= -string-end) "Overlapping strings detected" 13 13))
=C2=A0 cl--assertion-failed((> string-start last-string-end) "Overl= apping strings detected" (13 13) nil)
=C2=A0 python-nav-end-of-statement()
=C2=A0 python-info-end-of-statement-p()
=C2=A0 python-info-end-of-block-p()
=C2=A0 python-nav--forward-sexp(-1 nil nil)
=C2=A0 python-nav-forward-sexp(-1 nil nil)
=C2=A0 python-nav-backward-sexp()
=C2=A0 python-info-docstring-p((0 nil nil t nil nil 0 nil 1 nil nil))
=C2=A0 python-font-lock-syntactic-face-function((0 nil nil t nil nil 0 nil = 1 nil nil))
=C2=A0 font-lock-fontify-syntactically-region(1 15 nil)
=C2=A0 font-lock-default-fontify-region(1 15 nil)
=C2=A0 font-lock-fontify-region(1 15)
=C2=A0 font-lock-fontify-block(nil)
=C2=A0 funcall-interactively(font-lock-fontify-block nil)
=C2=A0 call-interactively(font-lock-fontify-block nil nil)
=C2=A0 command-execute(font-lock-fontify-block)
I think the problem is that the assertion is off by 1, it currently
asserts that there is at least one space between strings (because the
end position goes *after* the string, while the start position is part
of the string).
I see the assertion was added in [1: 4fbd330fae].=C2=A0 Phillip, does my
proposed change make sense to you?
=C2= =A0 ('make -C test python-tests' still
passes.)
--- i/lisp/progmodes/python.el
+++ w/lisp/progmodes/python.el
@@ -1506,7 +1506,7 @@ python-nav-end-of-statement
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ;; are somehow out of whack.=C2=A0 This has been
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ;; observed when using `syntax-ppss' during
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ;; narrowing.
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(cl-assert (> string-start last-string-end)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(cl-assert (>=3D string-start last-string-end)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:show-args
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"Overlapping strin= gs detected")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (goto-char string-start)
[1: 4fbd330fae]: 2017-03-23 23:05:19 +0100
=C2=A0 Protect against an infloop in python-mode
=C2=A0 https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=3D4fbd330fae54a9= c45d4a717127aa86d75e9938d5