From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: casouri@gmail.com, 67262@debbugs.gnu.org, jdtsmith@gmail.com
Subject: bug#67262: python-ts-mode cannot identify triple-quoted-strings
Date: Sat, 23 Dec 2023 11:52:11 +0200 [thread overview]
Message-ID: <83edfddz5g.fsf@gnu.org> (raw)
In-Reply-To: <c7920311-e58d-4008-24c4-6a3988e9d1c7@gutov.dev> (message from Dmitry Gutov on Sun, 17 Dec 2023 15:46:29 +0200)
Ping! Can we please make further progress here to resolve this issue?
> Date: Sun, 17 Dec 2023 15:46:29 +0200
> Cc: Eli Zaretskii <eliz@gnu.org>, JD Smith <jdtsmith@gmail.com>,
> 67262@debbugs.gnu.org
> From: Dmitry Gutov <dmitry@gutov.dev>
>
> On 17/12/2023 01:36, Yuan Fu wrote:
> > How do you think of this patch? This extends the patch in bug#66732, and adds correct text property to the quotes (I think).
>
> I do believe the common pattern should be followed here: a
> syntax-propertize-function and a call to syntax-ppss-flush-cache to
> invalidate when appropriate. See my patch in this bug for reference.
>
> The reasons are performance (deferring work) and keeping state
> management logic in one place.
>
> With your patch in particular, try this:
>
> 1. Type """foo -- no text properties.
> 2. Add """. Check the 3rd and 4th quote characters with 'C-u C-x ='.
> Both should have the (15) 'syntax-table' text property applied.
> 4. Backspace. Syntax highlighting changes -- the string is not
> highlighted now (that's good, I guess). But both 3rd and 4th quote chars
> retain the text property. (python-info-triple-quoted-string-p) still
> returns the same value, and, more importantly, (syntax-ppss) does too.
> 5. Backspace 2 more times (the text in the buffer is now '"""foo'). The
> 4th quote is gone now, but the 3rd still has the text property.
>
> (nth 3 (syntax-ppss)) still returns t, and
> (python-info-triple-quoted-string-p) still returns the same value.
>
> On steps 1 and 5 the buffer contents are the same, but the syntax-table
> properties are different.
>
> > It doesn’t handle the case of “””””” (no content inside the quotes), but I think that’s fine?
>
> It might be important for some callers of
> (python-info-triple-quoted-string-p). But it should be pretty easy to
> fix, now or later.
>
next prev parent reply other threads:[~2023-12-23 9:52 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-18 15:52 bug#67262: python-ts-mode cannot identify triple-quoted-strings JD Smith
2023-11-18 16:29 ` Eli Zaretskii
2023-11-18 17:18 ` JD Smith
2023-11-18 22:52 ` Dmitry Gutov
2023-11-25 10:01 ` Eli Zaretskii
2023-11-25 14:42 ` JD Smith
2023-11-26 2:04 ` Dmitry Gutov
2023-11-26 14:58 ` Dmitry Gutov
2023-11-26 23:43 ` Yuan Fu
2023-11-27 0:05 ` Dmitry Gutov
2023-12-12 8:32 ` Yuan Fu
2023-12-12 21:55 ` Dmitry Gutov
2023-12-16 12:47 ` Eli Zaretskii
2023-12-16 13:37 ` Dmitry Gutov
2023-12-16 13:59 ` Eli Zaretskii
2023-12-16 15:11 ` JD Smith
2023-12-16 15:21 ` Dmitry Gutov
2023-12-16 15:57 ` Eli Zaretskii
2023-12-16 23:36 ` Yuan Fu
2023-12-17 13:46 ` Dmitry Gutov
2023-12-23 9:52 ` Eli Zaretskii [this message]
2023-12-23 18:03 ` Yuan Fu
2023-12-23 21:01 ` Dmitry Gutov
2023-12-23 23:51 ` Yuan Fu
2023-12-24 0:45 ` Dmitry Gutov
2023-12-24 3:10 ` Yuan Fu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83edfddz5g.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=67262@debbugs.gnu.org \
--cc=casouri@gmail.com \
--cc=dmitry@gutov.dev \
--cc=jdtsmith@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).