On Nov 18, 2023, at 11:29 AM, Eli Zaretskii <eliz@gnu.org> wrote:
From: JD Smith <jdtsmith@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,
Can you figure out which part of python-mode's initialization makesthe above work correctly, and why? Then we could discuss whethermoving that part into python-base-mode is TRT.
I took a look. It’s `syntax-propertize-function' that is not being setup. From a buffer in `python-ts-mode', this reenables triple-quote recognition:
(progn (setq-local syntax-propertize-function python-syntax-propertize-function) (syntax-ppss-flush-cache (point-min)))
Note that `python-syntax-propertize-function' mentions `python-syntax-stringify', which scans the syntax for triple quotes and marks their 'syntax-table. I am not sure whether this was an oversight, or was omitted purposefully from the body of python-ts-mode. |