From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#67262: python-ts-mode cannot identify triple-quoted-strings Date: Sat, 18 Nov 2023 18:29:28 +0200 Message-ID: <838r6vm3dj.fsf@gnu.org> References: <66A741A1-38B8-40C9-BE84-AF99F74A079F@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17874"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67262@debbugs.gnu.org To: JD Smith Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 18 17:30:24 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r4OD7-0004SC-ON for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Nov 2023 17:30:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4OCy-0008NH-J5; Sat, 18 Nov 2023 11:30:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4OCo-0008Mt-VC for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2023 11:30:05 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r4OCo-0001FR-Jn for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2023 11:30:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r4OCp-00050N-0Q for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2023 11:30:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Nov 2023 16:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67262 X-GNU-PR-Package: emacs Original-Received: via spool by 67262-submit@debbugs.gnu.org id=B67262.170032498819189 (code B ref 67262); Sat, 18 Nov 2023 16:30:02 +0000 Original-Received: (at 67262) by debbugs.gnu.org; 18 Nov 2023 16:29:48 +0000 Original-Received: from localhost ([127.0.0.1]:49402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4OCZ-0004zR-MF for submit@debbugs.gnu.org; Sat, 18 Nov 2023 11:29:47 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4OCX-0004zD-38 for 67262@debbugs.gnu.org; Sat, 18 Nov 2023 11:29:45 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4OCQ-0001Cu-OI; Sat, 18 Nov 2023 11:29:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=3N5kiEouUsOUU53pek3zu+FXLkVk2+PZKngie1QPaTw=; b=UuS358qnk7B9DR/Q4o8F jYWAPT5GQ4maPEC9gZfThXUNRb9tdPluEhuBX23PibMASIhHlXJ84dTBr5wR54t9rvivglc8iEKNt S+2aV7aFY5vwYhiljdrvhModAM+9HxQnV+UY7/x5IE+nIIy+ODJwfFha/cDqiduIijgK2YOER5jzi CqAbB1+lvUFw20dKm8gPuvnGL8qKLmkGplq9oXN5GKbAd21dGL0kZ5oGCGObGFXnwvlfTONN+AD+P 7B4GYNlOdW+RdmF80Zkd85yRDy91LYg6NnwhM7RNJQoAWXTd0Ic/WuRFUcv4xqMgfLJ7zVANhcDkj /8o+fVB8l9T8Tw==; In-Reply-To: <66A741A1-38B8-40C9-BE84-AF99F74A079F@gmail.com> (message from JD Smith on Sat, 18 Nov 2023 10:52:05 -0500) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:274560 Archived-At: > From: JD Smith > 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.