GNU bug report logs - #67262
python-ts-mode cannot identify triple-quoted-strings

Previous Next

Package: emacs;

Reported by: JD Smith <jdtsmith <at> gmail.com>

Date: Sat, 18 Nov 2023 15:53:02 UTC

Severity: normal

Merged with 67394

Found in version 29.1.90

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 67262 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: JD Smith <jdtsmith <at> gmail.com>
Cc: 67262 <at> debbugs.gnu.org
Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings
Date: Sat, 18 Nov 2023 18:29:28 +0200
> From: JD Smith <jdtsmith <at> gmail.com>
> Date: Sat, 18 Nov 2023 10:52:05 -0500
> 
> Inside this triple-quoted string, in a python buffer:
> 
> a = """This is a test"""
> 
> python-mode yields (python-info-triple-quoted-string-p)=t, whereas python-ts-mode gives nil,
> defeating the fancy doc string folding both modes implement.
> 
> The reason seems to be that (syntax-ppss) returns something different in position 3 (which is "non-nil
> if inside a string”) between these modes: 
> 
> * t for python-mode (which signals a triple quote)
> *  ?34=" in python-ts-mode 
> 
> If you first load python-mode, then load python-ts-mode, the syntax parse becomes equal between the
> modes, and this bug vanishes.  

Can you figure out which part of python-mode's initialization makes
the above work correctly, and why?  Then we could discuss whether
moving that part into python-base-mode is TRT.

Thanks.




This bug report was last modified 1 year and 153 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.