From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#67262: python-ts-mode cannot identify triple-quoted-strings Date: Sun, 24 Dec 2023 02:45:25 +0200 Message-ID: <2d6c8f44-e59e-4752-811a-ce7eebd3ee09@gutov.dev> References: <66A741A1-38B8-40C9-BE84-AF99F74A079F@gmail.com> <838r6vm3dj.fsf@gnu.org> <9bfc5e6f-3612-115f-a59d-35ad629bdf9e@gutov.dev> <83v89qcfsb.fsf@gnu.org> <9B8C904A-3729-44AF-82F7-3BEA849F46D0@gmail.com> <83le9umhzh.fsf@gnu.org> <6b009ad5-2a09-f4e5-8ebe-8a7744692473@gutov.dev> <2C8AF27C-596F-4F7B-879C-9EB7497C45D1@gmail.com> <83edfddz5g.fsf@gnu.org> <4E036F58-8190-42BF-A6EC-7967BE3921B2@gmail.com> <90B31D18-7607-4D37-A6B4-5CFE3C4F40A9@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10675"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Eli Zaretskii , 67262@debbugs.gnu.org, JD Smith To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 24 01:46:16 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 1rHCdD-0002bD-7u for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Dec 2023 01:46:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rHCcx-0005wU-2I; Sat, 23 Dec 2023 19:45:59 -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 1rHCcv-0005w5-1S for bug-gnu-emacs@gnu.org; Sat, 23 Dec 2023 19:45:57 -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 1rHCcu-0003B6-N3 for bug-gnu-emacs@gnu.org; Sat, 23 Dec 2023 19:45:56 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rHCd0-0000yL-7d for bug-gnu-emacs@gnu.org; Sat, 23 Dec 2023 19:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Dec 2023 00:46: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.17033787451828 (code B ref 67262); Sun, 24 Dec 2023 00:46:02 +0000 Original-Received: (at 67262) by debbugs.gnu.org; 24 Dec 2023 00:45:45 +0000 Original-Received: from localhost ([127.0.0.1]:51509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rHCci-0000Sb-Np for submit@debbugs.gnu.org; Sat, 23 Dec 2023 19:45:45 -0500 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:57753) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rHCcg-0000EK-T8 for 67262@debbugs.gnu.org; Sat, 23 Dec 2023 19:45:43 -0500 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 06BE63200A2D; Sat, 23 Dec 2023 19:45:30 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sat, 23 Dec 2023 19:45:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1703378730; x=1703465130; bh=gffjnuOvGhk6ijhaFJi0StY1XGVVD/GqycHCr0CGbjY=; b= TbGvV35bT95SHwXzEsVybEssd3CMK+ZGpF27Xnm4RhYwkAWc+AIpJAFpgfp9NLv7 UkPhlbkWSlw4h96g9qro4NqvN7VKqs8fQagMNMa9Y5qY0Zi3eJFyGQ9nQZIZL/q1 AEHl4wwH/irfID26kwJ4V3fpWmcs7bua3Ui8W+d9SjkNU4VI9bEUhpCt9YeEUyKz DOblQh3toImFrQMw66Xqm11BqCLVSNXVGQVLocEO1LhyNnXfjGksp0b2ihvp0JWZ UJS6ds2zXpdixCEshcDf9ONAEUjP690jeU9m5Nvs3IVXtwBL4hhB5SgByh0w3dRt 9Af7mgy/msgGgfyMpvb0ug== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1703378730; x= 1703465130; bh=gffjnuOvGhk6ijhaFJi0StY1XGVVD/GqycHCr0CGbjY=; b=A De6/3T+1sXkGopq395Vbe/FyItP1Siuk4tetIEcrmvFmqkdeOKVGT4A3sGQAUZqn tQQCYqDgTv5N4P5tI2fk23VpRaVeF6v2n3RCecAFDrHnbOuBD9BDdHNftbmplWfC mA2jY6JuVGyGwtsyN9HJmCcJX2jS2l+RJXiZdpLMU+A2O5aBB9wTbNuGiVLj+mwZ fIf91i20AMikWDD6f7+VvInsKUwC4wln77YnC0dN6IcSFfJ9KztkT8yuepbfR2jy Fj5PsP5Y9jI3+7RVXjD9Ek6uWTQdhW6edSswaqsmj3tSoWGiWXalH1jUpx7hh31p gkScoRMV7KxoshJZhI2lQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvddvtddgvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 23 Dec 2023 19:45:28 -0500 (EST) Content-Language: en-US In-Reply-To: <90B31D18-7607-4D37-A6B4-5CFE3C4F40A9@gmail.com> 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:276778 Archived-At: On 24/12/2023 01:51, Yuan Fu wrote: > Something like this? IMHO the code is easier to understand without the syntax-propertize-rules. Sure, fine with me. > + (while (search-forward "\"\"\"" end t)+ (put-text-property (1- start) start I think we also should support the triple-single-quotes, like python-syntax-propertize-function does. > + 'syntax-table (string-to-syntax "| ")) > + (put-text-property end (min (1+ end) (point-max)) > + 'syntax-table (string-to-syntax "| ")))))))) The spaces after "|" seem unnecessary.