From unknown Sun Jun 22 03:52:12 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#67262 <67262@debbugs.gnu.org> To: bug#67262 <67262@debbugs.gnu.org> Subject: Status: python-ts-mode cannot identify triple-quoted-strings Reply-To: bug#67262 <67262@debbugs.gnu.org> Date: Sun, 22 Jun 2025 10:52:12 +0000 retitle 67262 python-ts-mode cannot identify triple-quoted-strings reassign 67262 emacs submitter 67262 JD Smith severity 67262 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 18 10:52:34 2023 Received: (at submit) by debbugs.gnu.org; 18 Nov 2023 15:52:34 +0000 Received: from localhost ([127.0.0.1]:49331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4NcX-00040I-M1 for submit@debbugs.gnu.org; Sat, 18 Nov 2023 10:52:33 -0500 Received: from lists.gnu.org ([2001:470:142::17]:52300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4NcT-0003zs-6f for submit@debbugs.gnu.org; Sat, 18 Nov 2023 10:52:31 -0500 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 1r4NcM-0003HX-IQ for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2023 10:52:22 -0500 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r4NcK-0007xQ-UQ for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2023 10:52:22 -0500 Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-3b2e72fe47fso2049381b6e.1 for ; Sat, 18 Nov 2023 07:52:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700322738; x=1700927538; darn=gnu.org; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=4UbjX5EVUORu93hsIT4MXdL9at4+ArZnoNRFkCC7jSY=; b=mLOwcl5FKFTOA695G8eoNv+NQ56J28JPx3pyDA0F8/fuqDlACmdcxV3NE2CBHovgab wOfGkYcKsUsugj3mm/rU03LnIPJVFoUGDZIZco9j6RbTVafc/tsIXLuXWtCDxTDVUGhd RVlQvfxmzN7aNAKmzoOswNCS+ccmFOG2LsIRvEqCVBig5Dp17j7IasP/bX1imwliyPSR Lt0454RH3MIYmO+i9c9gqS4RSc9jxSWilMh/xkRzEErJYLMeDesFnXFdczYbIaeUckOQ 0goJQaTrN1Gnk5N1rZjVR48ek2yHKGvL93RWCIZckCZqbuC7WxU6aq5AzB+g1LJBMpXK 0cNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700322738; x=1700927538; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=4UbjX5EVUORu93hsIT4MXdL9at4+ArZnoNRFkCC7jSY=; b=WMsPCMfXtRpbd0g9GG2+j9bHl9EbfQzfAXpChiRAzCRZOyIwEh4uiIxWviqiYiS8Nc qqtj58giyBbHUI9WnWo+aTwfg174oCbrYKHzUZSRpX5yqRrHndZRtWBW6lbYnm37He9J oU4uyAZ9FqKWUj6j5AcwAPMHtgHTUFOJrXNP/0sEleSz94iP56XK+quaMpiaK0QsJJFV kd248GSr6p0AKFlrFTLKHT4y+BIQjwO68QIWWoGwPF6xUXsmNjtCJJffoGBMMjlHFboN 5uEApwv94fT9IxDfLnOolPehHN91cyD0YMvnbDt2SVq+DlWyAazKwTvdC2dZOoXgoYo7 Docg== X-Gm-Message-State: AOJu0YyshBQraK2r6WOZzkpTOlumwLF05Uic5umCgQ0uUo2WbhfKpGg5 kskrGbf7taM9iE1uhVlOKOfKl/UQYSY= X-Google-Smtp-Source: AGHT+IHzxGgNjHEsWfvUzKoGU0eRTqpr75MvBFUpbCwvZ5uuYzXNihR0vuk2RnxPnMScv01zF77Y2w== X-Received: by 2002:a05:6808:17:b0:3a3:b39d:a8bf with SMTP id u23-20020a056808001700b003a3b39da8bfmr3001984oic.45.1700322738112; Sat, 18 Nov 2023 07:52:18 -0800 (PST) Received: from smtpclient.apple (cm-24-53-187-34.buckeyecom.net. [24.53.187.34]) by smtp.gmail.com with ESMTPSA id sn1-20020a05620a948100b00770f2a690a8sm1383453qkn.53.2023.11.18.07.52.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Nov 2023 07:52:16 -0800 (PST) From: JD Smith Content-Type: multipart/alternative; boundary="Apple-Mail=_90D71A41-AA9E-4CF7-95B2-67A477C0C181" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: python-ts-mode cannot identify triple-quoted-strings Message-Id: <66A741A1-38B8-40C9-BE84-AF99F74A079F@gmail.com> Date: Sat, 18 Nov 2023 10:52:05 -0500 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3731.700.6) Received-SPF: pass client-ip=2607:f8b0:4864:20::229; envelope-from=jdtsmith@gmail.com; helo=mail-oi1-x229.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --Apple-Mail=_90D71A41-AA9E-4CF7-95B2-67A477C0C181 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Inside this triple-quoted string, in a python buffer: a =3D """This is a test""" python-mode yields (python-info-triple-quoted-string-p)=3Dt, 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=E2=80=9D) between these = modes:=20 t for python-mode (which signals a triple quote) ?34=3D" in python-ts-mode=20 If you first load python-mode, then load python-ts-mode, the syntax = parse becomes equal between the modes, and this bug vanishes. =20 python.el v0.28, Emacs v29.1= --Apple-Mail=_90D71A41-AA9E-4CF7-95B2-67A477C0C181 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

Inside this triple-quoted = string, in a python buffer:

a =3D """This = is a test"""

python-mode = yields (python-info-triple-quoted-string-p)=3Dt, 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=E2=80=9D) between these = modes: 

  • t = for python-mode (which signals a triple quote)
  •  ?34=3D" 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. =  

python.el v0.28, Emacs = v29.1
= --Apple-Mail=_90D71A41-AA9E-4CF7-95B2-67A477C0C181-- From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 18 11:29:48 2023 Received: (at 67262) by debbugs.gnu.org; 18 Nov 2023 16:29:48 +0000 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 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 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==; Date: Sat, 18 Nov 2023 18:29:28 +0200 Message-Id: <838r6vm3dj.fsf@gnu.org> From: Eli Zaretskii To: JD Smith In-Reply-To: <66A741A1-38B8-40C9-BE84-AF99F74A079F@gmail.com> (message from JD Smith on Sat, 18 Nov 2023 10:52:05 -0500) Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings References: <66A741A1-38B8-40C9-BE84-AF99F74A079F@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67262 Cc: 67262@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 18 12:18:24 2023 Received: (at 67262) by debbugs.gnu.org; 18 Nov 2023 17:18:24 +0000 Received: from localhost ([127.0.0.1]:49447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4Oxb-0006S5-QH for submit@debbugs.gnu.org; Sat, 18 Nov 2023 12:18:24 -0500 Received: from mail-qt1-x82c.google.com ([2607:f8b0:4864:20::82c]:51636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4OxY-0006Rr-NL for 67262@debbugs.gnu.org; Sat, 18 Nov 2023 12:18:22 -0500 Received: by mail-qt1-x82c.google.com with SMTP id d75a77b69052e-41cc56255e3so18514071cf.3 for <67262@debbugs.gnu.org>; Sat, 18 Nov 2023 09:18:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700327894; x=1700932694; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=mtuERcL1BAErYeklFADqdJ9vFPj+BsbUkr1Zx3qZZqc=; b=aetLCvz1qiYYEuUVxdC75yKreKEzQxGLwajowRLXfc3BVUfoSu7kC89MLLb2KGrMA0 zMlZqUy//t2a8if7JH8sa6u2L0ZqWiC1fKlZFIFYYyPeyA8+NSInXxgFsX8RSCISo5i9 S8ZdWzGkeITDlkXrTX/GkIk3fawvfnjD9VRY/C+On1VqSmdQfaF+mYMgZgJXtm3sMZic jAYOo22FGwd26/+Av6kOlyTzn+nisTkDPsMBCFXZHACBMeRWFuuUbPZBHcRwwD9MID2f 0O0glodXJcU/do6s49F/7z/fNUnVoOCuZh4dmRyvLUbazGlGgzq217/Bz1knYaWoEmOz 4XTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700327894; x=1700932694; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mtuERcL1BAErYeklFADqdJ9vFPj+BsbUkr1Zx3qZZqc=; b=dqC32K0+YQquf4GKh0358gdLeKm3Ct7u4uBZEiHMZfiga32voR9ENOmvoJJpJMY6Fn t7E7dRFHaINVMBtYvXXPM3FT6MOpp6GSX/nhIGmpNE9y8mL9qiWngWzBYTbyfVafTLsT S1MF7Up0Rukd4ewWPXCj7g45QJGTmOzywf8rzzXGmQfVBqU3LhomEGhWsgjcxvXBTu8W 1rYdYpuKuPRbjuim2Vb2lxP4awcIfY24k7fjigcGgRBVcZPu4noHDJkrY4Y7ED7LyE2u X2y7/qRml643WZCKRAyqPKUitr/CnNm3SlsK8S+Qzp5ApXKbXACpp48AWIg9oA3Vx/f/ fLQw== X-Gm-Message-State: AOJu0Yxqb0W2apUZe0Y1MzwsB8rhLUHXvYrjz+lDQgGEq+KWUmb7aiNT LcZVPeYfV+fV8Oc1L1kRiYo= X-Google-Smtp-Source: AGHT+IGHUcO2aFV/Cy2Vg2OfJ+2XYS3kDwK5TdWnTi44NCRo+u0+KnVjEzuHoT5Y5D94Q3qAsu2drA== X-Received: by 2002:ac8:7fcf:0:b0:41e:288a:d99e with SMTP id b15-20020ac87fcf000000b0041e288ad99emr4151380qtk.39.1700327894205; Sat, 18 Nov 2023 09:18:14 -0800 (PST) Received: from smtpclient.apple (cm-24-53-187-34.buckeyecom.net. [24.53.187.34]) by smtp.gmail.com with ESMTPSA id df25-20020a05622a0ed900b00419c39dd28fsm1400170qtb.20.2023.11.18.09.18.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Nov 2023 09:18:13 -0800 (PST) From: JD Smith Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_46145E57-47AD-416E-AD39-436D1147BD68" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings Date: Sat, 18 Nov 2023 12:18:02 -0500 In-Reply-To: <838r6vm3dj.fsf@gnu.org> To: Eli Zaretskii References: <66A741A1-38B8-40C9-BE84-AF99F74A079F@gmail.com> <838r6vm3dj.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.700.6) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67262 Cc: 67262@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Apple-Mail=_46145E57-47AD-416E-AD39-436D1147BD68 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Nov 18, 2023, at 11:29 AM, Eli Zaretskii wrote: >=20 >> From: JD Smith >> Date: Sat, 18 Nov 2023 10:52:05 -0500 >>=20 >> Inside this triple-quoted string, in a python buffer: >>=20 >> a =3D """This is a test""" >>=20 >> python-mode yields (python-info-triple-quoted-string-p)=3Dt, whereas = python-ts-mode gives nil, >=20 > 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. I took a look. It=E2=80=99s `syntax-propertize-function' that is not = being setup. =46rom a buffer in `python-ts-mode', this reenables = triple-quote recognition: (progn=20 (setq-local syntax-propertize-function = python-syntax-propertize-function)=20 (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.= --Apple-Mail=_46145E57-47AD-416E-AD39-436D1147BD68 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

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 =3D """This is a test"""

python-mode yields = (python-info-triple-quoted-string-p)=3Dt, whereas python-ts-mode gives = nil,

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.

I took a look. It=E2=80=99= s `syntax-propertize-function' that is not being setup.  =46rom 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.= --Apple-Mail=_46145E57-47AD-416E-AD39-436D1147BD68-- From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 18 17:52:25 2023 Received: (at 67262) by debbugs.gnu.org; 18 Nov 2023 22:52:25 +0000 Received: from localhost ([127.0.0.1]:49631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4UAq-0007GS-NM for submit@debbugs.gnu.org; Sat, 18 Nov 2023 17:52:24 -0500 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:60401) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4UAl-0007GA-DN for 67262@debbugs.gnu.org; Sat, 18 Nov 2023 17:52:23 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 382AB32007F1; Sat, 18 Nov 2023 17:52:11 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 18 Nov 2023 17:52:11 -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:sender:subject:subject:to:to; s=fm2; t= 1700347930; x=1700434330; bh=lBDF5ma+0dk1QKWQvy4XVo0nAptBy9Gifp+ AKpgP0XA=; b=TSngVlDQYmx7V8x57oQE4VP9RAlEfSHOVR9nY1XzA+Tw7IvwH8F 5AQmdAUR6xBch4cR8tEQgvNsFU0KjS+vwsA1jdxrdnapWyD6Od2/h80eH+60phZn gHWqibvhmVZ1vDaqNAyZz6I/+4I3hgdW06yYJb/w4jekFOQ8svbhLRn/0xX4Ql6p Yr8Wa4gi2ZSfK5or06+M2RuIp3gy9YWwwZ0oKmt7UWNiRpnoGu96Fj4afuP6lxWN IIXOOj07lKeww4sHbPdh4rbT/N94c3iw1D58+9uShHFh/Ws9HAPFrqi5KwFDMUoj VmlvDuNzDjddiFCC+vSxD292IxvOPdVUUYg== 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:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1700347930; x=1700434330; bh=lBDF5ma+0dk1QKWQvy4XVo0nAptBy9Gifp+ AKpgP0XA=; b=DqeBZLkngKnZSd9eSsByUdXJAzs6ePiEtWMyu2mS8zRMURqmp0c CNGF7JqCChIRKv/4ayz1zCMjxJ+6fPZn2mqAqi9mw/VwuJrHJnBtnLsQUPbBdHWZ HOg7xqSWXGUP3EHkA4BoweA8QBu6QXV5fz2r5jfmBL8RMBxEslL3zTaRSYurtaJd 6Zqea/rhxT2wLUVpuXKHEniM3XhaaTMvCbqZl4tnK5LoLfiEE8ve10xyc5kCWSTB AMy56GvY8KGN6QBq2NAsqbTFHXBQMebyfpC5e8kgivySpDdpYI1ycbRaAB2+pUJp fGV2IhYvK1VP304eMNlzmY3Pa26kE5hm6BA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudegfedgtddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 18 Nov 2023 17:52:09 -0500 (EST) Message-ID: <9bfc5e6f-3612-115f-a59d-35ad629bdf9e@gutov.dev> Date: Sun, 19 Nov 2023 00:52:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings Content-Language: en-US To: JD Smith , Eli Zaretskii References: <66A741A1-38B8-40C9-BE84-AF99F74A079F@gmail.com> <838r6vm3dj.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 67262 Cc: 67262@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.9 (---) On 18/11/2023 19:18, JD Smith wrote: >   (setq-local syntax-propertize-function > python-syntax-propertize-function) This is not a bad choice, but even better would be to write a s-p-f based on the tree-sitter parse tree. There are examples in ruby-ts-mode and js-ts-mode. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 25 05:02:11 2023 Received: (at 67262) by debbugs.gnu.org; 25 Nov 2023 10:02:11 +0000 Received: from localhost ([127.0.0.1]:37878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6pUI-0004jC-UE for submit@debbugs.gnu.org; Sat, 25 Nov 2023 05:02:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6pUG-0004iz-Ql for 67262@debbugs.gnu.org; Sat, 25 Nov 2023 05:02:09 -0500 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 1r6pU6-0005Oh-4Y; Sat, 25 Nov 2023 05:01:58 -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=QoKCSirePNGI/IVJC9I637IlbxEq6G8hl9Y5TeG6Mco=; b=VeH3+wVnlFVSYelJQiFd 1BTyd24a67JM2L3tmQFdl1/OHwUrvlTAu3EdYNfq6elMeGEex605p2sZYKCvj1fg3lvMl937XevRj gjKblYAgrqCDbU671pPvJlO8ke03ueWKux6yCNqj8okhLd3ZoM+o0L+RrHZYcSv2uqBdnz72d28eE 8Pi50e6DrcXn2ndbjg91N7jvlMu9V+BqTAA8Dwm0eKC7l/E1pesKedYZLIrw/w9c8VrVX1GqjhkHG zhkN/i1/l21dwY5BstA2G18w8ElJE1DCTAmu4hy+8x55R6kp0oFVO3ph8j3xR7gLohohR8kCwUpJZ +2qNch+3k6QJrg==; Date: Sat, 25 Nov 2023 12:01:56 +0200 Message-Id: <83v89qcfsb.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: <9bfc5e6f-3612-115f-a59d-35ad629bdf9e@gutov.dev> (message from Dmitry Gutov on Sun, 19 Nov 2023 00:52:06 +0200) Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings References: <66A741A1-38B8-40C9-BE84-AF99F74A079F@gmail.com> <838r6vm3dj.fsf@gnu.org> <9bfc5e6f-3612-115f-a59d-35ad629bdf9e@gutov.dev> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67262 Cc: 67262@debbugs.gnu.org, jdtsmith@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 19 Nov 2023 00:52:06 +0200 > Cc: 67262@debbugs.gnu.org > From: Dmitry Gutov > > On 18/11/2023 19:18, JD Smith wrote: > >   (setq-local syntax-propertize-function > > python-syntax-propertize-function) > > This is not a bad choice, but even better would be to write a s-p-f > based on the tree-sitter parse tree. > > There are examples in ruby-ts-mode and js-ts-mode. JD, would you like to try writing such a syntax-propertize-function? From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 25 09:42:48 2023 Received: (at 67262) by debbugs.gnu.org; 25 Nov 2023 14:42:48 +0000 Received: from localhost ([127.0.0.1]:38256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6trs-0001Rt-15 for submit@debbugs.gnu.org; Sat, 25 Nov 2023 09:42:48 -0500 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]:44431) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6trq-0001Rg-Bg for 67262@debbugs.gnu.org; Sat, 25 Nov 2023 09:42:46 -0500 Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-41cd4cc515fso15538461cf.1 for <67262@debbugs.gnu.org>; Sat, 25 Nov 2023 06:42:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700923355; x=1701528155; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=dIuoqavLS6ieFo+4s9nlUxcmHM+w60AtzPdwEBfo9QU=; b=jQu+KeR4CyLNcz/N2grL8GU46+5uZzbex32VL7DwGlaZN8dEDy5uS13nC10cAvBnL8 S1IVEV5YEcW9NTa7tC7ElFfEDJmzNYGJzAtayo43ahL6fW2B3THGku+XF3nE1PmPTQw+ UnsIngLhMv3x7jfwex5n7h1pxabVuSjQoYcu/lSDZNYgeyYQSQLlOyXaujFhCUO7SJVe M41g+MiB1jeCsfDdTQcFVtpTIMe+pLmDKnAgtDIwQacfEg/2pVv+nx8xJCw/zm9C9D7X DxtsTbnXNgIQa3BM+36CsDMXhht6lkd1bmOmdDe2eZ9bSrEebPDRPVYtJY0q4oan6Lzi xbtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700923355; x=1701528155; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dIuoqavLS6ieFo+4s9nlUxcmHM+w60AtzPdwEBfo9QU=; b=h07eFs2V8arOEPUE2/Fz+yyvYl5CL4o2QWcjAmGQ5sg8E4JePzi168wcet4+elDXWN yLy8swXtGcU3U168ShTCjGXd0dypr9k0G3R8x5/RPfC5Je4Sgv8KXH+ipe5uWQzLkxos LgNJbo0jaAfds5tWowtr+qdi73/pIUhD3+jMajZkG/qwJerXP/tMxgl8mOqkMjz03alz VpW7crKq6FtT/C6vzSqDXi+lXlyHuQhJ7usJ0jAuDTM4FMNot6eMYBxI7YcJNnAlykR8 AewlJTsDWJmdp8VGnqIeBPwxjnLhx9XhFO9FsmE9+Hsvy9C2ViPXIeo3Exyyc7HbTmii qAPQ== X-Gm-Message-State: AOJu0Yx7iTvhUY4Z+X7ez/e10CLMd2YmGI32nLfxQDJ+p8H5t9pwVz7Z MyqVxC5TrTtkb3qV2DhxTHU= X-Google-Smtp-Source: AGHT+IGUZjEzf+PHT6wGiZZ5rUE3O9A/9z4GDHK83VzOnyF7p+cIfF4lfHbaO19ZrBK8R5iDav1uIQ== X-Received: by 2002:a05:622a:514:b0:421:f47f:d758 with SMTP id l20-20020a05622a051400b00421f47fd758mr8362303qtx.8.1700923355608; Sat, 25 Nov 2023 06:42:35 -0800 (PST) Received: from smtpclient.apple (cm-24-53-187-34.buckeyecom.net. [24.53.187.34]) by smtp.gmail.com with ESMTPSA id z25-20020ac86b99000000b003f6ac526568sm2216670qts.39.2023.11.25.06.42.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Nov 2023 06:42:34 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.200.91.1.1\)) Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings From: JD Smith In-Reply-To: <83v89qcfsb.fsf@gnu.org> Date: Sat, 25 Nov 2023 09:42:23 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <9B8C904A-3729-44AF-82F7-3BEA849F46D0@gmail.com> References: <66A741A1-38B8-40C9-BE84-AF99F74A079F@gmail.com> <838r6vm3dj.fsf@gnu.org> <9bfc5e6f-3612-115f-a59d-35ad629bdf9e@gutov.dev> <83v89qcfsb.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3774.200.91.1.1) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67262 Cc: Dmitry Gutov , 67262@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Bridging emacs syntax to treesitter in a robust way seems like it could = be a subtle enterprise, so I=E2=80=99d prefer to leave that to one of = the experts. Right now the syntax-propertize-function in python-mode = does one simple thing: ensure triple quotes are properly marked as = strings. Since the treesitter grammar doesn=E2=80=99t distinguish = between different flavors of strings, something similar would still be = needed, if we want to continue to treat various string flavors = distinctly using syntax. =20 Is moving all syntactification (beyond just font-lock) over to TS an = explicit goal for all the *-ts-mode=E2=80=99s? > On Nov 25, 2023, at 5:01=E2=80=AFAM, Eli Zaretskii = wrote: >=20 >> Date: Sun, 19 Nov 2023 00:52:06 +0200 >> Cc: 67262@debbugs.gnu.org >> From: Dmitry Gutov >>=20 >> On 18/11/2023 19:18, JD Smith wrote: >>> (setq-local syntax-propertize-function=20 >>> python-syntax-propertize-function) >>=20 >> This is not a bad choice, but even better would be to write a s-p-f=20= >> based on the tree-sitter parse tree. >>=20 >> There are examples in ruby-ts-mode and js-ts-mode. >=20 > JD, would you like to try writing such a syntax-propertize-function? From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 25 21:04:27 2023 Received: (at 67262) by debbugs.gnu.org; 26 Nov 2023 02:04:27 +0000 Received: from localhost ([127.0.0.1]:40514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r74VX-00067f-27 for submit@debbugs.gnu.org; Sat, 25 Nov 2023 21:04:27 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:38751) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r74VU-00067O-UI for 67262@debbugs.gnu.org; Sat, 25 Nov 2023 21:04:25 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 4F9573200A29; Sat, 25 Nov 2023 21:04:13 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 25 Nov 2023 21:04:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1700964252; x=1701050652; bh=a9 Lyz/C1Q7pCc+s0vAFxWUT3th/1UmmH+obTnOAqC7c=; b=NXUJCAE5E7psMVGs4e R7ckz+cpGO5GV9XPl4ME+opls6HQB1mJLVbUisBYibHliUq3+xCnu8cQojqiEdmx +ceKFfe133hq3LS1XrnSCp+vCY4lfbiOutG0330xRbW/Tkn9DOY5PpnWRkx/vgdV hr8FZrWIT3ua/uW254lJbYFg9inuoQKvZ2K8kCaaIIxwMPDjwcaWc/tsveUP42zm mj6limlnk3kgJRuNLxs+oj/kaZnY4JfHW0prDdB4TH52F06WQAFrS9UHNMX11Gsk R3YfxYEC3VpYGUEc92/LgPtaGjMZRT+Fpm71jhoDIylV8FGDmJ3wt6jxP6MJ8iS6 5b+w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1700964252; x=1701050652; bh=a9Lyz/C1Q7pCc +s0vAFxWUT3th/1UmmH+obTnOAqC7c=; b=E2drv21aSFQbZiyIKR1EQqw90x5um PlvAhFNO0vKVAGj2hI175YHfEUPGQCCGRaAqDMubGKpX2XjJ+IduViPb/Y94P/Z/ ey/VHzv0E23KuK4s1S49mTZJ3gYGVUjhQBIXSp+xbhNTRmPBg5g2gIPXLASMnqbI LN7dC4yoZS/hxilit0SWFRkMafrI9f3StpSB6dwwchVLKwFRNxoDgpQsxQ6hNNWG MJtvE95DL5IaPU0aZARDa0qU6e7xpf+O5dpKVo9dOrl34Xic6uy35NRannWoqYRA ZmMmxT6TqFXGMChgELL7SoU4CHaMzOcXHvTE/AZQQXoAePYrNiHq70c+A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudehkedggeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptgfkffggfgfuvfevfhfhjgesmhdtreertdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeehteekgfetieeujeeuvddtvdelteffleejteduvdefffejieehheeuteffveei jeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 25 Nov 2023 21:04:11 -0500 (EST) Content-Type: multipart/mixed; boundary="------------Q0aIrxjQwHlh0z0jWLCDsSeL" Message-ID: Date: Sun, 26 Nov 2023 04:04:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings Content-Language: en-US To: JD Smith , Eli Zaretskii , Yuan Fu 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> From: Dmitry Gutov In-Reply-To: <9B8C904A-3729-44AF-82F7-3BEA849F46D0@gmail.com> X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 67262 Cc: 67262@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.9 (---) This is a multi-part message in MIME format. --------------Q0aIrxjQwHlh0z0jWLCDsSeL Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 25/11/2023 16:42, JD Smith wrote: > Bridging emacs syntax to treesitter in a robust way seems like it could be a subtle enterprise, so I’d prefer to leave that to one of the experts. Right now the syntax-propertize-function in python-mode does one simple thing: ensure triple quotes are properly marked as strings. Since the treesitter grammar doesn’t distinguish between different flavors of strings, something similar would still be needed, if we want to continue to treat various string flavors distinctly using syntax. > > Is moving all syntactification (beyond just font-lock) over to TS an explicit goal for all the *-ts-mode’s? It would make sense - since this way we would only have one source of syntax-recognition bugs, rather than two (both the grammar and the definition in Elisp). Attached is a patch you can try (that uses treesit for s-p-f). Unfortunately, it's not quite perfect (nor is python-syntax-stringify, according to its FIXME inside): after certain modifications, the syntax-table property is not applied. I've done some print-debugging in python--treesit-parser-after-change, and it looks like the problem is this: in certain cases (e.g. when electric-pair-post-self-insert-function fires) the parser notifier fires only after syntax-propertize has been called -- and it fires inside of it. Meaning it's too late to flush the syntax-propertize cache at that point. The reason for it is, overall, the fast that we're trigger parser's after-change notifiers lazily: only after some other feature has to initialize the parser, calling treesit_ensure_parsed from treesit-parser-root-node. I think bug#66732 might also be a variation of this problem. As for what to do about this one -- probably something involving syntax-propertize-extend-region-functions, adding an entry which would initialize the parser, but not call syntax-ppss-flush-cache directly (or at least not just that). It would signal the earlier position to extend to through some dynamic variable. This is getting tricky enough to move from the individual major modes into treesit.el proper, I think. Yuan and others, thoughts welcome. JD, I do believe the attached patch is TRT (or close to it), but depending on how it works for you, and how quickly we deal with the above problem, it might make sense to enact your original suggestion first. And finally, here's the backtrace that led me to the above conclusions: backtrace() (message "in progress, backtrace %s" (backtrace)) (progn (message "in progress, backtrace %s" (backtrace))) (if (syntax-propertize--in-process-p) (progn (message "in progress, backtrace %s" (backtrace)))) (save-current-buffer (set-buffer (treesit-parser-buffer parser)) (message "flushing %s up to %s" ranges (let* ((--cl-var-- ranges) (r nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq r (car --cl-var--)) (let* ((temp (car r))) (setq --cl-var-- (if --cl-var-- (min --cl-var-- temp) temp))) (setq --cl-var-- (cdr --cl-var--))) --cl-var--)) (syntax-ppss-flush-cache (let* ((--cl-var-- ranges) (r nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq r (car --cl-var--)) (let* ((temp (car r))) (setq --cl-var-- (if --cl-var-- (min --cl-var-- temp) temp))) (setq --cl-var-- (cdr --cl-var--))) --cl-var--)) (if (syntax-propertize--in-process-p) (progn (message "in progress, backtrace %s" (backtrace)))) (message "flushed up to %d, %s" syntax-propertize--done syntax-ppss-wide)) (progn (save-current-buffer (set-buffer (treesit-parser-buffer parser)) (message "flushing %s up to %s" ranges (let* ((--cl-var-- ranges) (r nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq r (car --cl-var--)) (let* ((temp ...)) (setq --cl-var-- (if --cl-var-- ... temp))) (setq --cl-var-- (cdr --cl-var--))) --cl-var--)) (syntax-ppss-flush-cache (let* ((--cl-var-- ranges) (r nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq r (car --cl-var--)) (let* ((temp ...)) (setq --cl-var-- (if --cl-var-- ... temp))) (setq --cl-var-- (cdr --cl-var--))) --cl-var--)) (if (syntax-propertize--in-process-p) (progn (message "in progress, backtrace %s" (backtrace)))) (message "flushed up to %d, %s" syntax-propertize--done syntax-ppss-wide))) (if ranges (progn (save-current-buffer (set-buffer (treesit-parser-buffer parser)) (message "flushing %s up to %s" ranges (let* ((--cl-var-- ranges) (r nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq r (car --cl-var--)) (let* (...) (setq --cl-var-- ...)) (setq --cl-var-- (cdr --cl-var--))) --cl-var--)) (syntax-ppss-flush-cache (let* ((--cl-var-- ranges) (r nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq r (car --cl-var--)) (let* (...) (setq --cl-var-- ...)) (setq --cl-var-- (cdr --cl-var--))) --cl-var--)) (if (syntax-propertize--in-process-p) (progn (message "in progress, backtrace %s" (backtrace)))) (message "flushed up to %d, %s" syntax-propertize--done syntax-ppss-wide)))) python--treesit-parser-after-change(((27 . 50)) #) treesit-buffer-root-node(python) treesit-node-at(42) (let ((node (treesit-node-at (point)))) (cond ((equal (treesit-node-type node) "string_content") (put-text-property (- (point) 3) (- (point) 2) 'syntax-table (string-to-syntax "|"))) ((and (equal (treesit-node-type node) "\"") (= (treesit-node-start node) (- (point) 3))) (put-text-property (1- (point)) (point) 'syntax-table (string-to-syntax "|"))))) (cond (t (message "pt %s" (point)) (let ((node (treesit-node-at (point)))) (cond ((equal (treesit-node-type node) "string_content") (put-text-property (- (point) 3) (- (point) 2) 'syntax-table (string-to-syntax "|"))) ((and (equal (treesit-node-type node) "\"") (= (treesit-node-start node) (- ... 3))) (put-text-property (1- (point)) (point) 'syntax-table (string-to-syntax "|"))))))) (while (and (< (point) end) (re-search-forward "\\(?:\"\"\"\\|'''\\)" end t)) (cond (t (message "pt %s" (point)) (let ((node (treesit-node-at (point)))) (cond ((equal (treesit-node-type node) "string_content") (put-text-property (- ... 3) (- ... 2) 'syntax-table (string-to-syntax "|"))) ((and (equal ... "\"") (= ... ...)) (put-text-property (1- ...) (point) 'syntax-table (string-to-syntax "|")))))))) (closure (t) (start end) (goto-char start) (while (and (< (point) end) (re-search-forward "\\(?:\"\"\"\\|'''\\)" end t)) (cond (t (message "pt %s" (point)) (let ((node ...)) (cond (... ...) (... ...)))))))(39 50) funcall((closure (t) (start end) (goto-char start) (while (and (< (point) end) (re-search-forward "\\(?:\"\"\"\\|'''\\)" end t)) (cond (t (message "pt %s" (point)) (let ((node ...)) (cond (... ...) (... ...))))))) 39 50) python--treesit-syntax-propertize-function-1(39 50) syntax-propertize(42) syntax-ppss(42) electric-pair-syntax-info(39) electric-pair-post-self-insert-function() self-insert-command(1 39) funcall-interactively(self-insert-command 1 39) #(self-insert-command nil nil) call-interactively@ido-cr+-record-current-command(# self-insert-command nil nil) apply(call-interactively@ido-cr+-record-current-command # (self-insert-command nil nil)) call-interactively(self-insert-command nil nil) command-execute(self-insert-command) --------------Q0aIrxjQwHlh0z0jWLCDsSeL Content-Type: text/x-patch; charset=UTF-8; name="python--treesit-syntax-propertize-function.diff" Content-Disposition: attachment; filename="python--treesit-syntax-propertize-function.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3B5dGhvbi5lbCBiL2xpc3AvcHJvZ21vZGVz L3B5dGhvbi5lbAppbmRleCBhYjNiZjFiNGVjMC4uNjU5ZGVmMTg5OTkgMTAwNjQ0Ci0tLSBh L2xpc3AvcHJvZ21vZGVzL3B5dGhvbi5lbAorKysgYi9saXNwL3Byb2dtb2Rlcy9weXRob24u ZWwKQEAgLTEyMzcsNiArMTIzNywyOSBAQCBweXRob24tLXRyZWVzaXQtZm9udGlmeS12YXJp YWJsZQogICAgICAodHJlZXNpdC1ub2RlLXN0YXJ0IG5vZGUpICh0cmVlc2l0LW5vZGUtZW5k IG5vZGUpCiAgICAgICdmb250LWxvY2stdmFyaWFibGUtdXNlLWZhY2Ugb3ZlcnJpZGUgc3Rh cnQgZW5kKSkpCiAKKyhkZWZjb25zdCBweXRob24tLXRyZWVzaXQtc3ludGF4LXByb3BlcnRp emUtZnVuY3Rpb24KKyAgKHN5bnRheC1wcm9wZXJ0aXplLXJ1bGVzCisgICAoKHJ4IChvciAi XCJcIlwiIiAiJycnIikpCisgICAgKDAgKGlnbm9yZQorICAgICAgICAobGV0ICgobm9kZSAo dHJlZXNpdC1ub2RlLWF0IChwb2ludCkpKSkKKyAgICAgICAgICAoY29uZAorICAgICAgICAg ICAoKGVxdWFsICh0cmVlc2l0LW5vZGUtdHlwZSBub2RlKSAic3RyaW5nX2NvbnRlbnQiKQor ICAgICAgICAgICAgKHB1dC10ZXh0LXByb3BlcnR5ICgtIChwb2ludCkgMykgKC0gKHBvaW50 KSAyKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdzeW50YXgtdGFibGUgKHN0 cmluZy10by1zeW50YXggInwiKSkpCisgICAgICAgICAgICgoYW5kIChlcXVhbCAodHJlZXNp dC1ub2RlLXR5cGUgbm9kZSkgIlwiIikKKyAgICAgICAgICAgICAgICAgKD0gKHRyZWVzaXQt bm9kZS1zdGFydCBub2RlKSAoLSAocG9pbnQpIDMpKSkKKyAgICAgICAgICAgIChwdXQtdGV4 dC1wcm9wZXJ0eSAoMS0gKHBvaW50KSkgKHBvaW50KQorICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICdzeW50YXgtdGFibGUgKHN0cmluZy10by1zeW50YXggInwiKSkpKSkpKSkp KQorCisoZGVmdW4gcHl0aG9uLS10cmVlc2l0LXBhcnNlci1hZnRlci1jaGFuZ2UgKHJhbmdl cyBwYXJzZXIpCisgIDs7IE1ha2Ugc3VyZSB3ZSByZS1zeW50YXgtcHJvcGVydGl6ZSB0aGUg ZnVsbCBub2RlIHRoYXQgaXMgYmVpbmcKKyAgOzsgZWRpdGVkLiAgRm9yIHRyaXBsZS1xdW90 ZWQgc3RyaW5ncy4KKyAgKHdoZW4gcmFuZ2VzCisgICAgKHdpdGgtY3VycmVudC1idWZmZXIg KHRyZWVzaXQtcGFyc2VyLWJ1ZmZlciBwYXJzZXIpCisgICAgICAoc3ludGF4LXBwc3MtZmx1 c2gtY2FjaGUgKGNsLWxvb3AgZm9yIHIgaW4gcmFuZ2VzCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgbWluaW1pemUgKGNhciByKSkpKSkpCisKIAwKIDs7OyBJ bmRlbnRhdGlvbgogCkBAIC02ODUxLDYgKzY4NzQsMTQgQEAgcHl0aG9uLXRzLW1vZGUKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiX2RlZmluaXRp b24iKSkKICAgICAoc2V0cS1sb2NhbCB0cmVlc2l0LWRlZnVuLW5hbWUtZnVuY3Rpb24KICAg ICAgICAgICAgICAgICAjJ3B5dGhvbi0tdHJlZXNpdC1kZWZ1bi1uYW1lKQorCisgICAgKHNl dHEtbG9jYWwgc3ludGF4LXByb3BlcnRpemUtZnVuY3Rpb24KKyAgICAgICAgICAgICAgICBw eXRob24tLXRyZWVzaXQtc3ludGF4LXByb3BlcnRpemUtZnVuY3Rpb24pCisKKyAgICA7OyBN YWtlIHN1cmUgaXQncyBwbGFjZWQgYmVmb3JlIGZvbnQtbG9jaydzIG5vdGlmaWVyLgorICAg ICh0cmVlc2l0LXBhcnNlci1hZGQtbm90aWZpZXIgKGNhciAodHJlZXNpdC1wYXJzZXItbGlz dCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjJ3B5dGhvbi0tdHJlZXNp dC1wYXJzZXItYWZ0ZXItY2hhbmdlKQorCiAgICAgKHRyZWVzaXQtbWFqb3ItbW9kZS1zZXR1 cCkKIAogICAgIChweXRob24tc2tlbGV0b24tYWRkLW1lbnUtaXRlbXMpCg== --------------Q0aIrxjQwHlh0z0jWLCDsSeL-- From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 26 09:59:00 2023 Received: (at 67262) by debbugs.gnu.org; 26 Nov 2023 14:59:01 +0000 Received: from localhost ([127.0.0.1]:42558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7Gb6-0001Eu-KH for submit@debbugs.gnu.org; Sun, 26 Nov 2023 09:59:00 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:43757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7Gb3-0001Ee-AH for 67262@debbugs.gnu.org; Sun, 26 Nov 2023 09:58:59 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 57C315C011D; Sun, 26 Nov 2023 09:58:46 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 26 Nov 2023 09:58:46 -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:sender:subject:subject:to:to; s=fm3; t= 1701010726; x=1701097126; bh=e2xAuD7gOAUM8OfGtdae+BtjLwHNiZQBir5 buE9N3tI=; b=wvkD6ren/7P5o5OpDNrDYJ9pty8HiSjkkA3tPVK/MPpCxIFip5/ TuL4bx32Z/7KUcytaT0eFndeZO9cT+s7FNz6bdmHfVdl2GKst2O9qvLSs4fAp3b/ QuC46/GJMuQBZ1gzeLb/droXnPTXCnxGQLVOyZHAZDStNFsGlc5qbj7wcv5lAJ7O 84o8OPgcKFcjlfZcEQbKfset6LmAUkmDlSQxMJZ17z/G/DMZoqn6jCtHeRCH+Hmr uFryKivWml82phixUcM6kQf0KqrX2ggDLzSWH/IoMr35oB9Nm1D/TW6xrSOfhEjP SNNXW4ba7it2XpHkIkNrgfUVkCPF0YI/s4w== 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:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1701010726; x=1701097126; bh=e2xAuD7gOAUM8OfGtdae+BtjLwHNiZQBir5 buE9N3tI=; b=PiFz7EYjcJMZ/sR7ee/r7xvNru6rSRn52bKCk9UgCoLQqJp5KQA L4hYS2rl88hdMvPVirOXOVFHxK3MuJdPvR6Wj0Y7/8g2f1iRLJx3R6OepZRf4h8s 4vZhFYJJqITgExqlOMnzKRe6w3ImT2uM/hxVqHEZmC9Xyha+nh+FlJWITBh6odKt dRSruzrRi6V9xHZM5e6+um2aVlmhv2rYjV18TF1s/de+o7o3Q1DUgnLf3r0Y/mMh oIL4f/MzKRkGb/PaK4GbRTRSXHZ7cpdeS8l2SG+90a6h/av6kpJVV7+x1+TmUwCu ENHt+BZXIt1dVMAImXp4kXTXwh5g8eU5fgQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudehledgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffhvfevfhgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepjeegiedvfefghfduteeuveejgfefleeltedvtdefveekheevffeuuefhheej fffhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 26 Nov 2023 09:58:44 -0500 (EST) Message-ID: Date: Sun, 26 Nov 2023 16:58:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings Content-Language: en-US From: Dmitry Gutov To: JD Smith , Eli Zaretskii , Yuan Fu 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> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 67262 Cc: 67262@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.9 (---) On 26/11/2023 04:04, Dmitry Gutov wrote: > As for what to do about this one -- probably something involving > syntax-propertize-extend-region-functions, adding an entry which would > initialize the parser, but not call syntax-ppss-flush-cache directly (or > at least not just that). It would signal the earlier position to extend > to through some dynamic variable. This is getting tricky enough to move > from the individual major modes into treesit.el proper, I think. Alternatively, we'd trigger updates eagerly from within treesit_record_change -- that would make it slower, invalidating the comment above it. Not sure by how much, though. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 26 18:43:40 2023 Received: (at 67262) by debbugs.gnu.org; 26 Nov 2023 23:43:40 +0000 Received: from localhost ([127.0.0.1]:42899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7Omq-0007db-89 for submit@debbugs.gnu.org; Sun, 26 Nov 2023 18:43:40 -0500 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:45473) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7Omm-0007dK-Js for 67262@debbugs.gnu.org; Sun, 26 Nov 2023 18:43:39 -0500 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-2851a2b30a2so2350948a91.3 for <67262@debbugs.gnu.org>; Sun, 26 Nov 2023 15:43:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701042204; x=1701647004; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=d0jwQ5H2+gY9BA7UuH5TACFS1IuRdZ1WlFiGQ1wDnjw=; b=MGz2lfnWgDSpnClrmBlRVvlanFVCHaZlNMDy5jkpwiqfW/U1ceTK69c/6DRroEMZ4t R+DE/S2u4dJGWRTFoUp5MkXz6BQhLx+5c43dfjWE/SKwc3jb9D3unfQxYtVy1ZqIO2Ev FcWDYAzcMtjOqiogDpNBXzOlgORj857QvHmVnJnMgDjJ9uAlojIFrAcnE6wgpw9adoFw +m12vU7WNyzLcEfUmmZi1oHtEsp7OT38FISO6vR3c94HpWnY/02XES2phRWJr+bR11Ce so62TeZiStbWBZvazFbL9warueDya/XZKFuE8K16S9CXKEzgVIKkGtFMp/s3S1xBHuC5 vPPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701042204; x=1701647004; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=d0jwQ5H2+gY9BA7UuH5TACFS1IuRdZ1WlFiGQ1wDnjw=; b=ejJ66ua90CCtXlS6xtUnRtXfWqmPzx0PZgTtFafccA03NO872tjc2mbYZNLdvkXy7r lbktTu9YQy1iTy0RB3biZJn1TsYDdC6JcHsyLu+uqPL+pqxxQu2OdxRqzAjvmXK6VwoT GM6jl2CkDxZRDOU1hCcbM8CMVy5x6HovlJpqido6bVZAPFwghxJahqRqRmd5aRaZM0TU Swwwj8bGuQfTNt/H2V23WvCIHkHFSrs4jnZu7dQ/sz/mvtV/1ZfVjDOVkws8lJYnFbUc brwchOUGyQonHQJZCbTjvWkLkM21XuqXfkvehM8fOdYhS/ZeNNaOiYJK/H9vpON9Q+tW 5NZQ== X-Gm-Message-State: AOJu0Yw925VyMvoCGFZwu9Ffxzvfc2bnvkl+YjKNuHL6djyS73/KisLK imm1Rof89Zyw6rkhOG1fASI= X-Google-Smtp-Source: AGHT+IH+e2nDJHfe0nxF2MH3oLr5vgSAnEK8gC6g2kO8C2Qu3qjdjLXz/NApUpLSDJUeGTXfxXvYTA== X-Received: by 2002:a17:90b:1d0f:b0:285:a2af:31aa with SMTP id on15-20020a17090b1d0f00b00285a2af31aamr3930702pjb.37.1701042204514; Sun, 26 Nov 2023 15:43:24 -0800 (PST) Received: from [192.168.1.7] (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id gb20-20020a17090b061400b002808c9e3095sm6094106pjb.26.2023.11.26.15.43.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Nov 2023 15:43:24 -0800 (PST) Message-ID: Date: Sun, 26 Nov 2023 15:43:22 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings Content-Language: en-US To: Dmitry Gutov , JD Smith , Eli Zaretskii 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> From: Yuan Fu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67262 Cc: 67262@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 11/26/23 6:58 AM, Dmitry Gutov wrote: > On 26/11/2023 04:04, Dmitry Gutov wrote: >> As for what to do about this one -- probably something involving >> syntax-propertize-extend-region-functions, adding an entry which >> would initialize the parser, but not call syntax-ppss-flush-cache >> directly (or at least not just that). It would signal the earlier >> position to extend to through some dynamic variable. This is getting >> tricky enough to move from the individual major modes into treesit.el >> proper, I think. > > Alternatively, we'd trigger updates eagerly from within > treesit_record_change -- that would make it slower, invalidating the > comment above it. Not sure by how much, though. It seems to me that what we need is to force a re-parse at the beginning of syntax-propertize or in syntax-ppss-flush-cache; the re-parse would cause the notifier to run, which runs python--treesit-parser-after-change. I'm not quite sure about how do we cause this re-parse. The straightforward approach would be calling treesit-force-reparse[1] in syntax-propertize/syntax-ppss-flush-cache. But ideally I'd like to keep tree-sitter transparent for syntax.el. Maybe we can add a hook in syntax-propertize/syntax-ppss-flush-cache. [1] This function doesn't exist yet, but it's easy to define in lisp. Yuan From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 26 19:05:30 2023 Received: (at 67262) by debbugs.gnu.org; 27 Nov 2023 00:05:31 +0000 Received: from localhost ([127.0.0.1]:42911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7P7y-000051-GY for submit@debbugs.gnu.org; Sun, 26 Nov 2023 19:05:30 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:43983) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7P7v-0008WJ-PH for 67262@debbugs.gnu.org; Sun, 26 Nov 2023 19:05:28 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id A43513200A5B; Sun, 26 Nov 2023 19:05:15 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 26 Nov 2023 19:05:16 -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:sender:subject:subject:to:to; s=fm3; t= 1701043515; x=1701129915; bh=SaA2idlh9VCrhYUQOTPkECkSMWtpLJG7suJ z65+TwJU=; b=FZQ4VsOJES7lwWGWIOj3HPLkDotfKhFHTnXAQrU76+e9ufLjdmR jK9WrPzRZjQnu5cSt5IMoTT5a+/1zC5+XuVq9P0B6iKoqlQLhdYZuT1yzAWqk1NM xEFQMwl/ZQ0nOv+n1Y6qiPcO6gSIajBiul7FgMJAu+KOUQXRKr2PTle4f24+II81 agfrTe4gEjTK4DDkVOJ95W9f3CxChQK0Mls5we2jt6OjFHjcDC8mIFJ4CtPlAccK K0V3T6g8fXEi2XhktawNEOOuR/XG5HWzKhVBKNy1FdT7D9zAuczX5Wgt4FdxcC3E Im+uSCEnXC2KrsVuQbzhECbLKVLlWpzqVnQ== 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:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1701043515; x=1701129915; bh=SaA2idlh9VCrhYUQOTPkECkSMWtpLJG7suJ z65+TwJU=; b=gkuNUbrA9QKxU538/DlLG98nnWUnAb9PZ/fHNM2vGH0qWh+2mTG xI7ZauDhz6xrzQ05hDb6L3u0A/OmysCHOGdYUBUWzQvJlY6FWVQ4934pLgmFDOyd b4jrAd79GVyOCZwJ7o4B1BqgazZMVblR99OkE++CpER4gsMW+waKHJrRMPbJebvN kyI7q6SThMaRXBUtFCI8Yhf443UDSXfqDLJ/PtAmHtNsQ5rTmCAf8ZDdir51BcW5 VE0ZkY2+Mp2JKfVTn6lF5y/BxPo+Ab3acfcLWInnUlX9EZlQoMtEMgzeYSoZmBoC qejXDDauaLiCRsVKEyUtHpQ6fIPS1Xvm3QQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeitddgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 26 Nov 2023 19:05:13 -0500 (EST) Message-ID: Date: Mon, 27 Nov 2023 02:05:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings Content-Language: en-US To: Yuan Fu , JD Smith , Eli Zaretskii 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> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 67262 Cc: 67262@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.9 (---) On 27/11/2023 01:43, Yuan Fu wrote: > > On 11/26/23 6:58 AM, Dmitry Gutov wrote: >> On 26/11/2023 04:04, Dmitry Gutov wrote: >>> As for what to do about this one -- probably something involving >>> syntax-propertize-extend-region-functions, adding an entry which >>> would initialize the parser, but not call syntax-ppss-flush-cache >>> directly (or at least not just that). It would signal the earlier >>> position to extend to through some dynamic variable. This is getting >>> tricky enough to move from the individual major modes into treesit.el >>> proper, I think. >> >> Alternatively, we'd trigger updates eagerly from within >> treesit_record_change -- that would make it slower, invalidating the >> comment above it. Not sure by how much, though. > > It seems to me that what we need is to force a re-parse at the beginning > of syntax-propertize or in syntax-ppss-flush-cache; the re-parse would > cause the notifier to run, which runs python--treesit-parser-after-change. syntax-ppss-flush-cache is called by edits (and by the re-parse). It seems like it will be odd to have execution the other way around and/or add some hook into it which would call the re-parse and extend the region to be invalidated. syntax-propertize could have another hook added, yes. Or an advice. But it seems better to reuse some of the existing hooks, such as syntax-propertize-extend-region-functions. It treesit.c provided a way to fetch the newly-invalidated region, the treesit-major-mode-setup could add a new function to syntax-propertize-extend-region-functions which would invoke that feature. But even now it can instantiate the parse, which would call treesit-force-reparse internally, and then collect the info from the callbacks. And yet another way - is to extend the region to be propertized from inside the major mode's syntax-propertize-function, invalidating some earlier entries too. The main problem with that, I think, is that every ts mode will have to repeat that trick. And that authors would have to know to do that. How to make that easier and more obvious, is a question. Finally, if I'm right that bug#66732 has a similar cause, then a shared solution that can be reused by syntax and font-lock (or preferably just fix both in the same place) would be ideal. > I'm not quite sure about how do we cause this re-parse. The > straightforward approach would be calling treesit-force-reparse[1] in > syntax-propertize/syntax-ppss-flush-cache. But ideally I'd like to keep > tree-sitter transparent for syntax.el. Maybe we can add a hook in > syntax-propertize/syntax-ppss-flush-cache. > > [1] This function doesn't exist yet, but it's easy to define in lisp. treesit-parser-root-node calls it anyway and does little else, so we could get by with just using it. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 30 01:27:36 2023 Received: (at control) by debbugs.gnu.org; 30 Nov 2023 06:27:36 +0000 Received: from localhost ([127.0.0.1]:52066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8aWM-00051i-85 for submit@debbugs.gnu.org; Thu, 30 Nov 2023 01:27:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8aWJ-00051K-QE; Thu, 30 Nov 2023 01:27:32 -0500 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 1r8aW6-0000oo-8T; Thu, 30 Nov 2023 01:27:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=mXbgq1t1m2Jmn+G7Ppg7XI/AQzj+R6Nurm5uNy8CXh8=; b=LiyxsedF3gW9 wo9pwAgdf/06lFQ7J4LoMcN7sJ/O8vk+roTpH4/TN+Z0QyQK4de9Fe2XxooY1dMBg3xmX74lWFeif I8NvULukUfhgWgLip7u67etp17UQdrprRh3qiVX78yFrPGGMQZLH/DTuIJolHk5ARmPXbB7YvxZoL h0HrHX77SHM3TRt7flYcd4toC0kidB32ln6DT9ClfIFx9b1esLl9nDX/8yOPK/nSdsjsBNLqPMcY9 ahdq5JwkU3cT/Odx/dp50BTSjQpbOtciFoE22EBthtR+QmmgEOmwlfi1uskGj+d/Skr/IYZt/tHyx hoKx4xcmq1e0bIJ6aWPV2w==; Date: Thu, 30 Nov 2023 08:26:49 +0200 Message-Id: <83leaf69jq.fsf@gnu.org> From: Eli Zaretskii To: Michael Kleehammer In-Reply-To: <87il5k471p.fsf@kleehammer.com> (message from Michael Kleehammer on Wed, 29 Nov 2023 14:51:30 -0600) Subject: Re: bug#67394: 29.1.90; python-ts-mode triple quoted string fill bug References: <87zfz53uv0.fsf@kleehammer.com> <837cm9gdj2.fsf@gnu.org> <87il5k471p.fsf@kleehammer.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control Cc: 67394@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) merge 67394 67262 thanks > From: Michael Kleehammer > Date: Wed, 29 Nov 2023 14:51:30 -0600 > > Eli Zaretskii writes: > > > Is this the same as bug#67262? If so, does the change suggested there > > fix this issue as well? > > You are absolutely right Eli. I forgot to see if it was already > reported - I've apparently forgotten my mailing list manners. Thanks for checking. > It's not exactly clear to me how to close a bug I opened as a duplicate. We don't close them, we merge them. But don't worry about that, I've done that already, see above. > Am I supposed to use this: > > https://debbugs.gnu.org/server-control.html > > Or is that for Emacs developers? Is there a intro document somewhere or > is it something Emacs developers will do based on this? See admin/notes/bugtracker in the source tree. Anyone can do this stuff, not just the Emacs maintainers. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 12 03:32:36 2023 Received: (at 67262) by debbugs.gnu.org; 12 Dec 2023 08:32:36 +0000 Received: from localhost ([127.0.0.1]:55228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCyBw-0007rO-5G for submit@debbugs.gnu.org; Tue, 12 Dec 2023 03:32:36 -0500 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:44154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCyBs-0007r9-85 for 67262@debbugs.gnu.org; Tue, 12 Dec 2023 03:32:34 -0500 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6ce9c8c45a7so3315084b3a.0 for <67262@debbugs.gnu.org>; Tue, 12 Dec 2023 00:32:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702369931; x=1702974731; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=gJgzRFNGipNVfUJQbyZHG6I+vB4zLtfJxLkBUKmPFSc=; b=eNJpF4NJiYDmUHVfmiTPKza/2VOz2+0bTxO2OksZK8sRgomT0XJmyZ3JgYqLSOtfzm 0htKII/01MX5uZNGw9hCu0prz2Dfnbzo2Z3LChdChRry3uBiRTdr0ouPsTYQCF2J7+6F 44B52SO8vzk7ovUDxpx56fZrmaqcCRxqtUZjJime5f4EuuG5zYKZF9Hy7/xWsbUdQcX2 xglRp7E1HHBAbInFVgF0bkr4azYpNuKJYUeJMNGo6OQ04P8U386cWzIdZDN4DmfzPSdI wXWUKVRnFaRKhta6hDNZ3i72OvtWn3l+X83inBcbw4oknHyouEtzFS+I7m3jHif89If/ UEJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702369931; x=1702974731; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gJgzRFNGipNVfUJQbyZHG6I+vB4zLtfJxLkBUKmPFSc=; b=B7B7MEbGwgjwJ+Mi2dH1yrzbAVbWFGoChKYNMarPqc3MUDDN78qHwYT1y55ZjO6B4G 3Paq5Uff0LvDfC05LlKu4vMFpiAH1eoaoylNcwZ8ahoZII9mw+CVWvOhhbKLjpL5V/C9 3Ors1tx0bQKnyjydzWTE+ILPKMHBhknag0XdH0iXX3jRztMqTFepfbHpMVGf9wxCrb0w iVHTE0i1CYWrDSXN6OW9fP53ToOdIkA6mmg1Z6HZRvOoJICzMu/5s3lrJoQcptBYpMOa Lt9/BakR6jLfZ17ySsjesPvJ6ofqlXsvRxJ+Ia43XakcB84FYlFue1Ou3MZjLU4M14VC mtZw== X-Gm-Message-State: AOJu0Yy/xfjOWpWWeRrjecwp11taB6h9NX4/69TMgoDzs17S4CMutQXi qJcGsc1H1i5aQdLOQYaecko= X-Google-Smtp-Source: AGHT+IEagbP42RpaVPxjiC4rtiZBYE054Rq84ASHYx1d4AFmarwESJ+JmHDQ+BqLvuxYjXpVqy5nOQ== X-Received: by 2002:a05:6a20:f39c:b0:18c:92f0:69bd with SMTP id qr28-20020a056a20f39c00b0018c92f069bdmr2895210pzb.24.1702369931083; Tue, 12 Dec 2023 00:32:11 -0800 (PST) Received: from [192.168.1.7] (172-117-161-177.res.spectrum.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id b1-20020a170902d30100b001cf96a0e4e6sm8013104plc.242.2023.12.12.00.32.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Dec 2023 00:32:10 -0800 (PST) Message-ID: Date: Tue, 12 Dec 2023 00:32:09 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings Content-Language: en-US To: Dmitry Gutov , JD Smith , Eli Zaretskii 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> From: Yuan Fu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67262 Cc: 67262@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 11/26/23 4:05 PM, Dmitry Gutov wrote: > On 27/11/2023 01:43, Yuan Fu wrote: >> >> On 11/26/23 6:58 AM, Dmitry Gutov wrote: >>> On 26/11/2023 04:04, Dmitry Gutov wrote: >>>> As for what to do about this one -- probably something involving >>>> syntax-propertize-extend-region-functions, adding an entry which >>>> would initialize the parser, but not call syntax-ppss-flush-cache >>>> directly (or at least not just that). It would signal the earlier >>>> position to extend to through some dynamic variable. This is >>>> getting tricky enough to move from the individual major modes into >>>> treesit.el proper, I think. >>> >>> Alternatively, we'd trigger updates eagerly from within >>> treesit_record_change -- that would make it slower, invalidating the >>> comment above it. Not sure by how much, though. >> >> It seems to me that what we need is to force a re-parse at the >> beginning of syntax-propertize or in syntax-ppss-flush-cache; the >> re-parse would cause the notifier to run, which runs >> python--treesit-parser-after-change. > > syntax-ppss-flush-cache is called by edits (and by the re-parse). It > seems like it will be odd to have execution the other way around > and/or add some hook into it which would call the re-parse and extend > the region to be invalidated. > > syntax-propertize could have another hook added, yes. Or an advice. > > But it seems better to reuse some of the existing hooks, such as > syntax-propertize-extend-region-functions. It treesit.c provided a way > to fetch the newly-invalidated region, the treesit-major-mode-setup > could add a new function to syntax-propertize-extend-region-functions > which would invoke that feature. But even now it can instantiate the > parse, which would call treesit-force-reparse internally, and then > collect the info from the callbacks. syntax-propertize-extend-region-functions looks perfect. We just need to force a reparse in it and the notifier will do the rest. > > And yet another way - is to extend the region to be propertized from > inside the major mode's syntax-propertize-function, invalidating some > earlier entries too. The main problem with that, I think, is that > every ts mode will have to repeat that trick. And that authors would > have to know to do that. How to make that easier and more obvious, is > a question. > > Finally, if I'm right that bug#66732 has a similar cause, then a > shared solution that can be reused by syntax and font-lock (or > preferably just fix both in the same place) would be ideal. > >> I'm not quite sure about how do we cause this re-parse. The >> straightforward approach would be calling treesit-force-reparse[1] in >> syntax-propertize/syntax-ppss-flush-cache. But ideally I'd like to >> keep tree-sitter transparent for syntax.el. Maybe we can add a hook >> in syntax-propertize/syntax-ppss-flush-cache. >> >> [1] This function doesn't exist yet, but it's easy to define in lisp. > > treesit-parser-root-node calls it anyway and does little else, so we > could get by with just using it. > Yep. Yuan From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 12 16:56:12 2023 Received: (at 67262) by debbugs.gnu.org; 12 Dec 2023 21:56:13 +0000 Received: from localhost ([127.0.0.1]:57847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDAjc-000299-GJ for submit@debbugs.gnu.org; Tue, 12 Dec 2023 16:56:12 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:47709) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDAja-00028x-KC for 67262@debbugs.gnu.org; Tue, 12 Dec 2023 16:56:11 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id D0D353200AA7; Tue, 12 Dec 2023 16:55:48 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Tue, 12 Dec 2023 16:55:49 -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=fm3; t=1702418148; x=1702504548; bh=g5hQJD84+yV+rDVZNbUs4FP1ex/wD+xrOi0oGD9aA2s=; b= jivUMJnMaehS+8Mq64PcjhVJKc7dhqH5yOKGzAqueTf2Xfmeo+vpjJC1jQqS/kPf jHVs8e+0CQ+hHgV/GYUnZ8KiXvyX5BS+DdzC09DutAvOhyvzqf61RzfnyVYcXcKo XbB1HYVIDwDdUimoinPW/pKzDFPofLDaowdcgQJBTlz0wDpuxLaovo60c1Bjt2g8 x4odcTcek3DgDhhnHPrRsj1QStyOOypD9p9spMlp1vymmuqbV8UScn/8dIQRXD/H y2ZJu+rq60x9ZOAzTXkWbnjmwck5kLNJrOeBYsF9jrH6VMmXPZNZWLz+nz2Io3c6 UZBIMGg/AXRaWLOJMfQMUg== 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=fm1; t=1702418148; x= 1702504548; bh=g5hQJD84+yV+rDVZNbUs4FP1ex/wD+xrOi0oGD9aA2s=; b=S OC71ucM8pDGyw2O0Nr5J+CXUPkX6KKf3kug1Fh2LU9aWoDyWPMTF+HLjtf8g7qD5 +s2GX4eanjil/CCKHk9Zyw901KyckgoOBbBuR9LCZa028U4JFvbcN8HYcWxE45I2 bNzkRlRLrJl4aeZVYvYm8b+G2Po5j9U7yolDJseQrLvhsdTu5M/HBEh1V9+SgCXB S0j3KNDQ0nkGUef4Fx38/j5Vx7RaclXJQC3trqM0/RyrsrTr/a0l4IFzSo/GfFj+ Zxbzy7AF5oOFEFe7F6gAzD+45+N4oDVIZ6YjPAsSfvpcHscQmnOqhmqR28soH+VB o1dSoYg3cpkK5g6upBMgQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudelgedgudehvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeeigfetveehveevffehledtueekieeikeeufeegudfgfeeghfdulefgfeev ledvveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Dec 2023 16:55:46 -0500 (EST) Message-ID: Date: Tue, 12 Dec 2023 23:55:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings Content-Language: en-US To: Yuan Fu , JD Smith , Eli Zaretskii 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> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 67262 Cc: 67262@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.9 (---) On 12/12/2023 10:32, Yuan Fu wrote: >> syntax-ppss-flush-cache is called by edits (and by the re-parse). It >> seems like it will be odd to have execution the other way around >> and/or add some hook into it which would call the re-parse and extend >> the region to be invalidated. >> >> syntax-propertize could have another hook added, yes. Or an advice. >> >> But it seems better to reuse some of the existing hooks, such as >> syntax-propertize-extend-region-functions. It treesit.c provided a way >> to fetch the newly-invalidated region, the treesit-major-mode-setup >> could add a new function to syntax-propertize-extend-region-functions >> which would invoke that feature. But even now it can instantiate the >> parse, which would call treesit-force-reparse internally, and then >> collect the info from the callbacks. > syntax-propertize-extend-region-functions looks perfect. We just need to > force a reparse in it and the notifier will do the rest. >> >> And yet another way - is to extend the region to be propertized from >> inside the major mode's syntax-propertize-function, invalidating some >> earlier entries too. The main problem with that, I think, is that >> every ts mode will have to repeat that trick. And that authors would >> have to know to do that. How to make that easier and more obvious, is >> a question. >> >> Finally, if I'm right that bug#66732 has a similar cause, then a >> shared solution that can be reused by syntax and font-lock (or >> preferably just fix both in the same place) would be ideal. >> >>> I'm not quite sure about how do we cause this re-parse. The >>> straightforward approach would be calling treesit-force-reparse[1] in >>> syntax-propertize/syntax-ppss-flush-cache. But ideally I'd like to >>> keep tree-sitter transparent for syntax.el. Maybe we can add a hook >>> in syntax-propertize/syntax-ppss-flush-cache. >>> >>> [1] This function doesn't exist yet, but it's easy to define in lisp. >> >> treesit-parser-root-node calls it anyway and does little else, so we >> could get by with just using it. >> > Yep. For the casual observer: I posted a solution using the above method in comments to bug#66732 yesterday. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 16 07:48:14 2023 Received: (at 67262) by debbugs.gnu.org; 16 Dec 2023 12:48:14 +0000 Received: from localhost ([127.0.0.1]:54156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEU5W-00074l-3j for submit@debbugs.gnu.org; Sat, 16 Dec 2023 07:48:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEU5U-00073v-5d for 67262@debbugs.gnu.org; Sat, 16 Dec 2023 07:48:12 -0500 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 1rEU5N-0004Fq-QG; Sat, 16 Dec 2023 07:48:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=GxuGdMDMa7aQ5+Mq+qkIArA6E11Ae9F4I3diGCz3EY4=; b=VrYavt4rJpo+ zwWwHad75kadlHLmEr7rRMCTWjfsb9pAtsl+puloGiX9e5E4rn9JxltsaGnoOCzJjqVVOrtf+Sjp3 XkBvfyv6AtcGirciwqQ+DJhe4N0ltjwTYI5leChYVqhZLNCsSz/Gzr2zAAvJi0LLlGA93KFb4Im7h 40rG9L06UOtC277kPph/ny25XFFyWWVfT8MndMlmtUfcKB8yGj5gM+RK9FDzbDGm8sLDahH9ajCX5 Vms7Wz+jI1yT0JeNDugLf1IIrgy22MCAP81sZ5nJ+NqC1NZ+YtMa+qlSn/JYmmPc0Xz/51AHYlEgW aAQ36o3YjxZ7+bzA2XmZqw==; Date: Sat, 16 Dec 2023 14:47:46 +0200 Message-Id: <83le9umhzh.fsf@gnu.org> From: Eli Zaretskii To: casouri@gmail.com, Dmitry Gutov In-Reply-To: (message from Dmitry Gutov on Tue, 12 Dec 2023 23:55:43 +0200) Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67262 Cc: 67262@debbugs.gnu.org, jdtsmith@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) How should we make progress with this bug? I'd like to fix it before Emacs 29.2 is released. > Date: Tue, 12 Dec 2023 23:55:43 +0200 > Cc: 67262@debbugs.gnu.org > From: Dmitry Gutov > > On 12/12/2023 10:32, Yuan Fu wrote: > > >> syntax-ppss-flush-cache is called by edits (and by the re-parse). It > >> seems like it will be odd to have execution the other way around > >> and/or add some hook into it which would call the re-parse and extend > >> the region to be invalidated. > >> > >> syntax-propertize could have another hook added, yes. Or an advice. > >> > >> But it seems better to reuse some of the existing hooks, such as > >> syntax-propertize-extend-region-functions. It treesit.c provided a way > >> to fetch the newly-invalidated region, the treesit-major-mode-setup > >> could add a new function to syntax-propertize-extend-region-functions > >> which would invoke that feature. But even now it can instantiate the > >> parse, which would call treesit-force-reparse internally, and then > >> collect the info from the callbacks. > > syntax-propertize-extend-region-functions looks perfect. We just need to > > force a reparse in it and the notifier will do the rest. > >> > >> And yet another way - is to extend the region to be propertized from > >> inside the major mode's syntax-propertize-function, invalidating some > >> earlier entries too. The main problem with that, I think, is that > >> every ts mode will have to repeat that trick. And that authors would > >> have to know to do that. How to make that easier and more obvious, is > >> a question. > >> > >> Finally, if I'm right that bug#66732 has a similar cause, then a > >> shared solution that can be reused by syntax and font-lock (or > >> preferably just fix both in the same place) would be ideal. > >> > >>> I'm not quite sure about how do we cause this re-parse. The > >>> straightforward approach would be calling treesit-force-reparse[1] in > >>> syntax-propertize/syntax-ppss-flush-cache. But ideally I'd like to > >>> keep tree-sitter transparent for syntax.el. Maybe we can add a hook > >>> in syntax-propertize/syntax-ppss-flush-cache. > >>> > >>> [1] This function doesn't exist yet, but it's easy to define in lisp. > >> > >> treesit-parser-root-node calls it anyway and does little else, so we > >> could get by with just using it. > >> > > Yep. > > For the casual observer: I posted a solution using the above method in > comments to bug#66732 yesterday. > From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 16 08:37:56 2023 Received: (at 67262) by debbugs.gnu.org; 16 Dec 2023 13:37:56 +0000 Received: from localhost ([127.0.0.1]:54243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEUrb-0007tx-Uz for submit@debbugs.gnu.org; Sat, 16 Dec 2023 08:37:56 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:36735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEUrX-0007te-8q for 67262@debbugs.gnu.org; Sat, 16 Dec 2023 08:37:54 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 855EB5C0170; Sat, 16 Dec 2023 08:37:45 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sat, 16 Dec 2023 08:37:45 -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=fm3; t=1702733865; x=1702820265; bh=ngeJTW1vBP62gM8dz1+uc9gsF+BJFQ3JjeZ30Htpjzo=; b= hhxnZvBFSi0lShOsojnqgsqfUS3auEq9/9C9Vu//+PoW0+EOKeL14f8SWfqhZMHC cy+YLtd18ogs0jjkFZXAFEaM5s9L4m23C1+54S9kNt/WpPPBchelcEwj7rP7ZvL+ Ar7bcGOrPiWbQ2NNuMRABC8wwcJghLC5pSbDUbTOBWrqHLlOO7ac7uu5f1KNKbWL hKHs9AIbYdg8y0mBd5DBfPNODhZQ2Y2Yuhz+y7M17y+IS6l3MtU9WSQ4qF79WkFE bf4rL09w5dO14XcSc23+EFPL6T9l3zpoqzg58jXQpHCXbRT4nwwXWzdeLe8I2cb5 NAZJGwkevW7vgekHXlPE6A== 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=1702733865; x= 1702820265; bh=ngeJTW1vBP62gM8dz1+uc9gsF+BJFQ3JjeZ30Htpjzo=; b=g vQBpg6Z6Uo8GN5/8ssovmT/Im6hWxCOYCbbumUFnlBxiyNjWnvuLetqXt7K061A7 grfr02ePCHFrGooK+mNViDGpXX9hUyvkCZJ+KpWiTm/fuC21l6fI+Hr3m/XMLpNl PFe10wT1EXxWRCMAyckmD0/h+yMDg92+GHwBbcffUaN5NiLaIM7VhLysA+8aPAXz QZFNg3Mc/hMpqryvxahLG0PBbWxexSl6vjDEPXjQXAf/JvE8W0JaQ45vFztaaAbE wdnpYNqbQIvi0grIkZpJ/hxVmX8qSPyOPsEqzKT1IF7DUZXYTVya5/J0cLTa/QLN KtrSbbK82zbNMln1TDptw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvddtgedgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 16 Dec 2023 08:37:43 -0500 (EST) Message-ID: <6b009ad5-2a09-f4e5-8ebe-8a7744692473@gutov.dev> Date: Sat, 16 Dec 2023 15:37:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings Content-Language: en-US To: Eli Zaretskii , casouri@gmail.com 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> From: Dmitry Gutov In-Reply-To: <83le9umhzh.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 67262 Cc: 67262@debbugs.gnu.org, jdtsmith@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) On 16/12/2023 14:47, Eli Zaretskii wrote: > How should we make progress with this bug? I'd like to fix it before > Emacs 29.2 is released. We're currently working on the general issue in bug#66732. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 16 09:00:42 2023 Received: (at 67262) by debbugs.gnu.org; 16 Dec 2023 14:00:42 +0000 Received: from localhost ([127.0.0.1]:54268 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEVDe-0004Xz-BM for submit@debbugs.gnu.org; Sat, 16 Dec 2023 09:00:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEVDc-0004Jb-Iq for 67262@debbugs.gnu.org; Sat, 16 Dec 2023 09:00:41 -0500 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 1rEVDV-0005cK-VA; Sat, 16 Dec 2023 09:00:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=PS/KNHkY0znp78g/OizEbzNnCAl7aTILRQ5VH6Rg/pA=; b=XBYfQBBxRY++ UR6ni+35a2V7gjNYqWdoyofkClSbIzndJtQEWzimRjZ6jt5f6cFRELU6FBXPzUAl8JS60KicXCBo1 rMCwUS6izgHkuUIxCR3miEVjYcO3rIcvFRgP+EgSWaBLOlkXSb9QElZX6Agbm2aBSrq5bbFaaVuxs Q28BQd6g7r7GG4znh1CDjwUXqUE40aHZJTaCWg9U8WQFgU0lEaFfmqjCgry/7vT4FfSFclJczrxIT oHP9I+TYBICk8NbiSvTTUf8OnmpPfSSZKIKGKnEMXJKv7+mMq+HxtwWDwFh1Lu7NpKdwS41wWOKCJ FsFRtO364C65hcVwwkLxUg==; Date: Sat, 16 Dec 2023 15:59:57 +0200 Message-Id: <831qbmmen6.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: <6b009ad5-2a09-f4e5-8ebe-8a7744692473@gutov.dev> (message from Dmitry Gutov on Sat, 16 Dec 2023 15:37:40 +0200) Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67262 Cc: casouri@gmail.com, 67262@debbugs.gnu.org, jdtsmith@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 16 Dec 2023 15:37:40 +0200 > Cc: jdtsmith@gmail.com, 67262@debbugs.gnu.org > From: Dmitry Gutov > > On 16/12/2023 14:47, Eli Zaretskii wrote: > > How should we make progress with this bug? I'd like to fix it before > > Emacs 29.2 is released. > > We're currently working on the general issue in bug#66732. Ok, so please close this bug as well, when that general issue is resolved. And I hope bug#66732 will be solved soon? Because I'm waiting for this to be solved for Emacs 29.2. If you think I shouldn't wait, please tell. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 16 10:11:34 2023 Received: (at 67262) by debbugs.gnu.org; 16 Dec 2023 15:11:34 +0000 Received: from localhost ([127.0.0.1]:55699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEWKD-0000tH-Hc for submit@debbugs.gnu.org; Sat, 16 Dec 2023 10:11:33 -0500 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]:55670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEWKA-0000t3-K4 for 67262@debbugs.gnu.org; Sat, 16 Dec 2023 10:11:32 -0500 Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-7b701f86c3aso73967439f.3 for <67262@debbugs.gnu.org>; Sat, 16 Dec 2023 07:11:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702739484; x=1703344284; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=VxUqIMpeizXgnuHAzdo17+/8xGDf/DCrr1a2CudApqU=; b=OACVoXpTxxhz6GD6I+bb12agEUBT2DTYA1v3pLQ23XpgW9/YL8LFr1FGVUd2zSQMce PJkz+753AV2ogYtJNGTrhIGUUNV0HjGdplGnf7JsCrtVvoyRwvIiIutAX084rSzc/0yn 8s1o8Ufpda175pG0GbPZnwMCJl+T0avM/bacEvvHcL8en8W67bXeiNAtbi83drIH2vyc JL8EWM1wb89To2r705Thcu0P7/wrVScU9g18e+qQibpyx5I2kWbAl+MgKjQNPV55B6Sg Gl29qc1rElAkKYFtXKs/eYEfRMP6PIzYmiuOyTluBfP7SO5Gg2GcRfq86MlxvKMgxJhr 42MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702739484; x=1703344284; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VxUqIMpeizXgnuHAzdo17+/8xGDf/DCrr1a2CudApqU=; b=D3aKnWNgjDrpfBQCRYttytXdKdsxPL6tF4VU1d5reKgtK2CKy84AROD8NRumX1OLfJ 3Vw6+Ly9ppEhPyFnhExSwmdSoDW59KIFnKtG9xwexAb8bJTqw6sqFfBumEkSOXmgaezn eLovh1lYeP330j7eagHBEmD/s2l4IQMtwejLiE68snjNQ2NkSGG1y5xM4ewWoc9I8707 51+FYL5luDZTRMxEI9u7QzE8EJ1XzUY+Dlk1TKJeHF7FHswpwuBS9Zhh+mq1V0M9guER PlPpk7yGrhS7MczMU1D2ZV7VBm6BbYkqhAeZL2tq+w1c4GtDeYNhBl7wExBRkcNdLU+f hyTg== X-Gm-Message-State: AOJu0Yx4WFObbbz6Or3sE4ecRteYLjg2e3lpN0g+bCDgfZqGFhQrPbNp xbCa9lhyiC0syFXJO8mDGTI= X-Google-Smtp-Source: AGHT+IEvG0aEphLumnu8ipDPIBTa2Zh3P07W7sh9CNbZYykKwkEc9Db0RDVWMJFgecibIvCmhBeBNA== X-Received: by 2002:a05:6602:160b:b0:7b7:2875:6508 with SMTP id x11-20020a056602160b00b007b728756508mr14605292iow.30.1702739484092; Sat, 16 Dec 2023 07:11:24 -0800 (PST) Received: from smtpclient.apple (cm-24-53-187-34.buckeyecom.net. [24.53.187.34]) by smtp.gmail.com with ESMTPSA id w12-20020a056602034c00b007b45c1015b6sm4842762iou.31.2023.12.16.07.11.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Dec 2023 07:11:23 -0800 (PST) From: JD Smith Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_655761BA-D459-485E-9E13-F1EF6367B57A" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings Date: Sat, 16 Dec 2023 10:11:12 -0500 In-Reply-To: <831qbmmen6.fsf@gnu.org> To: Eli Zaretskii 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> <831qbmmen6.fsf@gnu.org> X-Mailer: Apple Mail (2.3774.300.61.1.2) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67262 Cc: Dmitry Gutov , casouri@gmail.com, 67262@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Apple-Mail=_655761BA-D459-485E-9E13-F1EF6367B57A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 16, 2023, at 8:59=E2=80=AFAM, Eli Zaretskii = wrote: >=20 >> Date: Sat, 16 Dec 2023 15:37:40 +0200 >> Cc: jdtsmith@gmail.com, 67262@debbugs.gnu.org >> From: Dmitry Gutov >>=20 >> On 16/12/2023 14:47, Eli Zaretskii wrote: >>> How should we make progress with this bug? I'd like to fix it = before >>> Emacs 29.2 is released. >>=20 >> We're currently working on the general issue in bug#66732. >=20 > Ok, so please close this bug as well, when that general issue is > resolved. >=20 > And I hope bug#66732 will be solved soon? Because I'm waiting for > this to be solved for Emacs 29.2. If you think I shouldn't wait, > please tell. If #66732 is not ready in time for 29.2, I=E2=80=99d suggest at least = implementing the =E2=80=9Csimple=E2=80=9D fix of returning = `python-syntax-propertize-function=E2=80=99 into service, mentioned = above. --Apple-Mail=_655761BA-D459-485E-9E13-F1EF6367B57A Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Dec 16, 2023, at 8:59=E2=80=AFAM, Eli Zaretskii = <eliz@gnu.org> wrote:

Date: Sat, 16 Dec 2023 15:37:40 +0200
Cc: = jdtsmith@gmail.com, 67262@debbugs.gnu.org
From: Dmitry Gutov = <dmitry@gutov.dev>

On 16/12/2023 14:47, Eli Zaretskii = wrote:
How should we make progress with = this bug?  I'd like to fix it before
Emacs 29.2 is = released.

We're currently working on the general = issue in bug#66732.

Ok, so please close this bug as = well, when that general issue is
resolved.

And I hope = bug#66732 will be solved soon?  Because I'm waiting for
this to = be solved for Emacs 29.2.  If you think I shouldn't wait,
please = tell.

If #66732 is not ready = in time for 29.2, I=E2=80=99d suggest at least implementing the = =E2=80=9Csimple=E2=80=9D fix of returning `python-syntax-propertize-function=E2=80=99 into service, mentioned = above.

= --Apple-Mail=_655761BA-D459-485E-9E13-F1EF6367B57A-- From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 16 10:22:06 2023 Received: (at 67262) by debbugs.gnu.org; 16 Dec 2023 15:22:06 +0000 Received: from localhost ([127.0.0.1]:55746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEWUP-0003ku-VN for submit@debbugs.gnu.org; Sat, 16 Dec 2023 10:22:06 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:59647) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEWUN-0003kQ-Gn for 67262@debbugs.gnu.org; Sat, 16 Dec 2023 10:22:04 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B529E5C00CA; Sat, 16 Dec 2023 10:21:57 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sat, 16 Dec 2023 10:21:57 -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=fm3; t=1702740117; x=1702826517; bh=E2gpr7Y5VI+OKaFezMFsYwofd8f4x0CT9IgqOBUC2NE=; b= R9dFu2334iXeY9WNU2JKtKH5gpwWEewomLYc1ptla3Elm+0D7UQLmZq0BghHf/VZ KH1QmsUKRYPmqBjRH7k6rv7iIcVtR5Bv9uBJPGa5rakj2wthaeIVnwP8jQFx5nLB 5JHbYE9L19zMfVXkkDKhUuafqSJThS9XqaATjefYLAEuj9Fmt1YYOH1YJ24MD+Du U3d4wXJcE/9pmQdFhOUujr6nvgoZu0lzYLzIHO/baq3gHJbVj+rXoMk6Mmg7+tMN mlz4wqzhTLsJ0fmZdLAU1U81NBH3ucTNWueG/UTSyLKgH8omLg+PFRExlAW531qp h9l028MaAROy21A0Ys5w7A== 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=1702740117; x= 1702826517; bh=E2gpr7Y5VI+OKaFezMFsYwofd8f4x0CT9IgqOBUC2NE=; b=a c/1XqgJ8XfBOFNsOnLUHlNKjx+XBHwLjJOlAF0nBidckafHqjKxCcRUlTivUWWw6 CHAeoZ6iT/+Uk9lYYkGWEdQxqtvWKIRtkRPVU2p7ZEbXoKZV5FNb4pK9wgKRgpfL kpQL1O4vZpQLkU9GwLEPhr8gTmmTWmwVYDfiMfUr9JyrJWkLPsFswqtjA5yxYftP OBFkVg9R0TtFqtZ7GU/MFBwWshcKKxT6gR+TMxZus3ZzflgEUphboErKWrsgK4gd OUtwfdfsv0ya8YPzxYY5uvj4i2OQ+wSfsvcflL75Cp7TPOnZssDvbYCQzQc33nu8 z1y7ebpW8W7WRESYmslVA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvddtgedgjeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 16 Dec 2023 10:21:56 -0500 (EST) Message-ID: Date: Sat, 16 Dec 2023 17:21:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings Content-Language: en-US To: Eli Zaretskii 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> <831qbmmen6.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <831qbmmen6.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 67262 Cc: casouri@gmail.com, 67262@debbugs.gnu.org, jdtsmith@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) On 16/12/2023 15:59, Eli Zaretskii wrote: >> Date: Sat, 16 Dec 2023 15:37:40 +0200 >> Cc:jdtsmith@gmail.com,67262@debbugs.gnu.org >> From: Dmitry Gutov >> >> On 16/12/2023 14:47, Eli Zaretskii wrote: >>> How should we make progress with this bug? I'd like to fix it before >>> Emacs 29.2 is released. >> We're currently working on the general issue in bug#66732. > Ok, so please close this bug as well, when that general issue is > resolved. > > And I hope bug#66732 will be solved soon? Because I'm waiting for > this to be solved for Emacs 29.2. If you think I shouldn't wait, > please tell. We have a few more days, right? From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 16 10:57:28 2023 Received: (at 67262) by debbugs.gnu.org; 16 Dec 2023 15:57:28 +0000 Received: from localhost ([127.0.0.1]:55825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEX2e-0001WL-CT for submit@debbugs.gnu.org; Sat, 16 Dec 2023 10:57:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEX2c-0001W6-Ku for 67262@debbugs.gnu.org; Sat, 16 Dec 2023 10:57:27 -0500 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 1rEX2W-0007ry-KY; Sat, 16 Dec 2023 10:57:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=G59tAQHtu1P94JtNlMseBLxvNNPytkdnu5pWYaJ0em4=; b=K/6ZPBwBpkRM S67cWD3I/Tf+97Nw1JMbo1tJkmZdd9hts08Wtv/2vHGbFT3xysGw4a4F1xRpoiHJi0V0Fi9EqUgAw Ou8ry27pdsSFofDsY5kmKeGqqf3MOkF1SsRGbMZxQhPD2ZcuzF4oF5EQ+xJm8UPlIUUgH1toYgkVw oWkNX9nJl/mD0QaMu8lVmPBy+frpIukvUzypZRNr45PpvtZ8eqy6McN5/K7Wu4j0JvdsBUDGVssS7 9/q2QokK24xpc6qMuj1FxwmeO/PZt24DiAbrZVNSIqMTlo67/ATWpCgWxhNgq7pYi3JRGXQ99jKnk mXeMC4PSweAb4rLc0577wg==; Date: Sat, 16 Dec 2023 17:57:01 +0200 Message-Id: <83ttoikunm.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: (message from Dmitry Gutov on Sat, 16 Dec 2023 17:21:55 +0200) Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings 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> <831qbmmen6.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67262 Cc: casouri@gmail.com, 67262@debbugs.gnu.org, jdtsmith@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 16 Dec 2023 17:21:55 +0200 > Cc: casouri@gmail.com, jdtsmith@gmail.com, 67262@debbugs.gnu.org > From: Dmitry Gutov > > On 16/12/2023 15:59, Eli Zaretskii wrote: > >> Date: Sat, 16 Dec 2023 15:37:40 +0200 > >> Cc:jdtsmith@gmail.com,67262@debbugs.gnu.org > >> From: Dmitry Gutov > >> > >> On 16/12/2023 14:47, Eli Zaretskii wrote: > >>> How should we make progress with this bug? I'd like to fix it before > >>> Emacs 29.2 is released. > >> We're currently working on the general issue in bug#66732. > > Ok, so please close this bug as well, when that general issue is > > resolved. > > > > And I hope bug#66732 will be solved soon? Because I'm waiting for > > this to be solved for Emacs 29.2. If you think I shouldn't wait, > > please tell. > > We have a few more days, right? Yes. Likely more than just "few days". From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 16 18:37:12 2023 Received: (at 67262) by debbugs.gnu.org; 16 Dec 2023 23:37:13 +0000 Received: from localhost ([127.0.0.1]:56339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEeDY-0002dy-Lx for submit@debbugs.gnu.org; Sat, 16 Dec 2023 18:37:12 -0500 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:54757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEeDU-0002de-80 for 67262@debbugs.gnu.org; Sat, 16 Dec 2023 18:37:11 -0500 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6ce72730548so1796733b3a.1 for <67262@debbugs.gnu.org>; Sat, 16 Dec 2023 15:37:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702769821; x=1703374621; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=cIkcffT0+koBbHbWB/J6IFJB3k6ZDVax+K/tWK6ZQeU=; b=BP7nOa/M9YC+99XeERjlKWCjE5r6ZMxmCNAOl3DCkUmPn9pcc5C6PXhhgWQngSRcjk o+fZ4qxZk9/QsKGWaCxg/kKsq1RnU/ps7aCvI8sx2i6GCV7iBI/ES8Cbm5XXbf+R2dCY UQ2jPC6PHqh4tNm6H4Ufz119z3r0gLEI9K3WTfv5S+Ik8oVMuD2XE4IbUaIJpIkhjvF0 uXXVM0wVSDoHV5F3Qq9usEGhHakxAHyQ8adLGnhWZmJwqbQ7zh1S0yRDpVeAV0ARBcIN lrGNkUXqc4EmgQFd3yYhBDpl1Gp0UM8kLLOtfyJU9eppMl0lt6Pv1RfV3FeGSRX6II1Y MwtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702769821; x=1703374621; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cIkcffT0+koBbHbWB/J6IFJB3k6ZDVax+K/tWK6ZQeU=; b=GQPFKMPfzWlRUMl3E3fjkFwVDDxmzTgJdK48RL2IWEW/CtFkRp9VKqeuaPXHxXTuV5 XHkChwqmteB2Eg7C6t07sxug617l5uYe8lkMgMvBJIFG3181G/G/kJSRonWglk+TDNkG xjNkU7kE71vpfJmDn5J2sn/fUlFq5MTSY3tFi2tFCB3W4EQ+b06OxmJCIQbH2/sWYHvQ XUODSO6OzZHvpl/gE27EnNfP2ZJm6pJEYDCZ2WwXg5fDGdE5yxfbe1V4p1suSnEsIQZO Tb8sfi3drSUhempZ2BL+K/9muOxd6oX5O3iKNL8s/UDw+C63OULUaQKdVQUanU9FAIku c8gw== X-Gm-Message-State: AOJu0YxF12C+Zv4S4CgZGDm1h62YqOLBI8HxpfG6P+TWPHwWFgGswraH VUg9OKVu56JpY9FfX9qS+1g= X-Google-Smtp-Source: AGHT+IEcuR37yQVk/5sWoBmkVlNMyIkKD9PEABwWBHNyHS9Vo2eNAloHhWqQrl7eW0sZt+A+BqfVvA== X-Received: by 2002:a05:6a20:158b:b0:190:61a1:3be2 with SMTP id h11-20020a056a20158b00b0019061a13be2mr18886787pzj.97.1702769821277; Sat, 16 Dec 2023 15:37:01 -0800 (PST) Received: from smtpclient.apple (172-117-161-177.res.spectrum.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id c12-20020a62e80c000000b006ce7e497302sm15458968pfi.21.2023.12.16.15.37.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Dec 2023 15:37:00 -0800 (PST) From: Yuan Fu Message-Id: <2C8AF27C-596F-4F7B-879C-9EB7497C45D1@gmail.com> Content-Type: multipart/mixed; boundary="Apple-Mail=_924D19E7-C6C7-4820-9304-9AB73A97A80D" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings Date: Sat, 16 Dec 2023 15:36:49 -0800 In-Reply-To: <6b009ad5-2a09-f4e5-8ebe-8a7744692473@gutov.dev> To: Dmitry Gutov 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> X-Mailer: Apple Mail (2.3731.700.6) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67262 Cc: Eli Zaretskii , 67262@debbugs.gnu.org, JD Smith X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Apple-Mail=_924D19E7-C6C7-4820-9304-9AB73A97A80D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 16, 2023, at 5:37 AM, Dmitry Gutov wrote: >=20 > On 16/12/2023 14:47, Eli Zaretskii wrote: >> How should we make progress with this bug? I'd like to fix it before >> Emacs 29.2 is released. >=20 > We're currently working on the general issue in bug#66732. How do you think of this patch? This extends the patch in bug#66732, and = adds correct text property to the quotes (I think). It doesn=E2=80=99t handle the case of =E2=80=9C=E2=80=9D=E2=80=9D=E2=80=9D= =E2=80=9D=E2=80=9D (no content inside the quotes), but I think that=E2=80=99= s fine? --Apple-Mail=_924D19E7-C6C7-4820-9304-9AB73A97A80D Content-Disposition: attachment; filename=python-triple-quote.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="python-triple-quote.patch" Content-Transfer-Encoding: quoted-printable =46rom=20b4fffdeb808f372463dca9b78814d9f6432fe13c=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Yuan=20Fu=20=0ADate:=20Sat,=20= 16=20Dec=202023=2015:35:23=20-0800=0ASubject:=20[PATCH]=20wip=0A=0A---=0A= =20lisp/progmodes/python.el=20|=2019=20+++++++++++++++++++=0A=20= lisp/treesit.el=20=20=20=20=20=20=20=20=20=20|=2028=20= +++++++++++++++++++++++++++-=0A=202=20files=20changed,=2046=20= insertions(+),=201=20deletion(-)=0A=0Adiff=20--git=20= a/lisp/progmodes/python.el=20b/lisp/progmodes/python.el=0Aindex=20= 7c5c20608bd..201b3da13f3=20100644=0A---=20a/lisp/progmodes/python.el=0A= +++=20b/lisp/progmodes/python.el=0A@@=20-1228,6=20+1228,21=20@@=20= python--treesit-fontify-variable=0A=20=20=20=20=20=20(treesit-node-start=20= node)=20(treesit-node-end=20node)=0A=20=20=20=20=20=20= 'font-lock-variable-use-face=20override=20start=20end)))=0A=20=0A+(defun=20= python--treesit-triple-quote-notifier=20(ranges=20parser)=0A+=20=20= "Propertize=20triple-quote=20strings=20in=20RANGES=20for=20PARSER."=0A+=20= =20(save-excursion=0A+=20=20=20=20(dolist=20(range=20ranges)=0A+=20=20=20= =20=20=20(goto-char=20(car=20range))=0A+=20=20=20=20=20=20(while=20= (search-forward=20"\"\"\""=20(cdr=20range)=20t)=0A+=20=20=20=20=20=20=20=20= (let=20((node=20(treesit-node-at=20(point)=20parser)))=0A+=20=20=20=20=20= =20=20=20=20=20(when=20(equal=20(treesit-node-type=20node)=20= "string_content")=0A+=20=20=20=20=20=20=20=20=20=20=20=20(let=20((start=20= (treesit-node-start=20node))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(end=20(treesit-node-end=20node)))=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(put-text-property=20(1-=20start)=20start=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20'syntax-table=20(string-to-syntax=20"|=20"))=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(put-text-property=20end=20(min=20(1+=20end)=20= (point-max))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20'syntax-table=20= (string-to-syntax=20"|=20")))))))))=0A+=0A=20=0C=0A=20;;;=20Indentation=0A= =20=0A@@=20-6729,6=20+6744,10=20@@=20python-ts-mode=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20#'python--treesit-defun-name)=0A=20=20=20=20= =20(treesit-major-mode-setup)=0A=20=0A+=20=20=20=20= (treesit-parser-add-notifier=0A+=20=20=20=20=20(car=20= (treesit-parser-list))=0A+=20=20=20=20=20= #'python--treesit-triple-quote-notifier)=0A+=0A=20=20=20=20=20= (python-skeleton-add-menu-items)=0A=20=0A=20=20=20=20=20(when=20= python-indent-guess-indent-offset=0Adiff=20--git=20a/lisp/treesit.el=20= b/lisp/treesit.el=0Aindex=208a07f5023a9..638faf6c535=20100644=0A---=20= a/lisp/treesit.el=0A+++=20b/lisp/treesit.el=0A@@=20-1088,6=20+1088,28=20= @@=20treesit--font-lock-notifier=0A=20=20=20=20=20=20=20= (with-silent-modifications=0A=20=20=20=20=20=20=20=20=20= (put-text-property=20(car=20range)=20(cdr=20range)=20'fontified=20= nil)))))=0A=20=0A+(defun=20treesit--pre-redisplay=20(&rest=20_)=0A+=20=20= "Force=20redisplay=20and=20consequently=20run=20all=20notifiers.=0A+=0A= +One=20of=20the=20notifiers=20is=20`treesit--font-lock-notifier',=20= which=20will=0A+mark=20the=20region=20whose=20syntax=20has=20changed=20= to=20\"need=20to=20refontify\".=0A+=0A+For=20example,=20when=20the=20= user=20types=20the=20final=20slash=20of=20a=20C=20block=0A+comment=20/*=20= xxx=20*/,=20not=20only=20do=20we=20need=20to=20fontify=20the=20slash,=20= but=0A+also=20the=20whole=20block=20comment,=20which=20previously=20= wasn't=20fontified=0A+as=20comment=20due=20to=20incomplete=20parse=20= tree."=0A+=20=20(treesit-update-ranges)=0A+=20=20(dolist=20(parser=20= (treesit-parser-list=20nil=20nil=20t))=0A+=20=20=20=20= (treesit-parser-root-node=20parser)))=0A+=0A+(defun=20= treesit--pre-syntax-ppss=20(&rest=20_)=0A+=20=20"Force=20redisplay=20and=20= consequently=20run=20all=20notifiers.=0A+=0A+Similar=20to=20font-lock,=20= we=20want=20to=20update=20the=20syntax=20text=20property=0A+before=20= `syntax-ppss'=20starts=20working=20on=20the=20text."=0A+=20=20= (treesit--pre-redisplay)=0A+=20=20nil)=0A+=0A=20;;;=20Indent=0A=20=0A=20= (define-error=20'treesit-indent-error=0A@@=20-2392,7=20+2414,11=20@@=20= treesit-major-mode-setup=0A=20=20=20=20=20= (treesit-font-lock-recompute-features)=0A=20=20=20=20=20(dolist=20= (parser=20(treesit-parser-list))=0A=20=20=20=20=20=20=20= (treesit-parser-add-notifier=0A-=20=20=20=20=20=20=20parser=20= #'treesit--font-lock-notifier)))=0A+=20=20=20=20=20=20=20parser=20= #'treesit--font-lock-notifier))=0A+=20=20=20=20(add-hook=20= 'pre-redisplay-functions=20#'treesit--pre-redisplay=200=20t))=0A+=20=20= ;;=20Syntax=0A+=20=20(add-hook=20= 'syntax-propertize-extend-region-functions=0A+=20=20=20=20=20=20=20=20=20= =20=20=20#'treesit--pre-syntax-ppss=200=20t)=0A=20=20=20;;=20Indent.=0A=20= =20=20(when=20treesit-simple-indent-rules=0A=20=20=20=20=20(setq-local=20= treesit-simple-indent-rules=0A--=20=0A2.41.0=0A=0A= --Apple-Mail=_924D19E7-C6C7-4820-9304-9AB73A97A80D-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 17 08:46:42 2023 Received: (at 67262) by debbugs.gnu.org; 17 Dec 2023 13:46:42 +0000 Received: from localhost ([127.0.0.1]:56774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rErTe-0006N0-4g for submit@debbugs.gnu.org; Sun, 17 Dec 2023 08:46:42 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:33845) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rErTc-0006Mn-S9 for 67262@debbugs.gnu.org; Sun, 17 Dec 2023 08:46:41 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5BC845C0110; Sun, 17 Dec 2023 08:46:34 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 17 Dec 2023 08:46:34 -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=fm3; t=1702820794; x=1702907194; bh=wwgxtHDH4VKMnAOb0FyDOIaE82uGM74kRmAv/n0xCmo=; b= oeHp4KJ/wEKkGH7nJxOEqUmapeM6JfHp4zM2Bicrs0KWLWet44OUxeaRO5EplSYM a+VvvEKuccraBVIn1WyNRMc0zDTKfJ1S6r4VaTPOvHSyZWuAarDEn+7Us3TKpqHp IRsOMztizSpmzKA43oU9u3rBliSRUaph3Lh7DhX4df6lcCYR+PUrgdoZ53zVCcOs Akl/gQZWQQZ9X158Y42PLa/wW36W21shgjYKWwaxGSff2k6j0G888dYyIRRo838o +bkBtHN9J74qVeg2T/kVGOr+4CcunBmgjRgloifmt+p1ZdrxGtKHudD+3mDj2peN +UyK0hhY7mTNLaFl8DP47A== 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=1702820794; x= 1702907194; bh=wwgxtHDH4VKMnAOb0FyDOIaE82uGM74kRmAv/n0xCmo=; b=o h/l0jNUkN1ImeYZgKtoFcUJeeQ4yV7l9P9vtBw/t4KmdBH2Ohuuw9flVniWZNVWX SSDCL+XuxkQhb4wuq7nHsW7xOyhGaXD14XA34KRY5YIAGHWYh9fqTeKeAfCr0Wbf 2FxlyvDYHjIybKv6LUN142BjCqCFzroCGeF/kQgl65T9rfSTaviCZ31jHIgYorWU ypJZCODmGjSsgjjiCo2TbTqaM+MP9LkGlvsDTmYk4WOLkxaOmwtLZEUkaan/yAk2 9kyNr8pjXvW4kbkJ1GY03FrC12XN0k91c7WF4SkTGUFPSZMCWKRGcEmtvx4+4mmw J8mUuTCkXhuj5MHcGTyJA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvddtiedgheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 17 Dec 2023 08:46:32 -0500 (EST) Message-ID: Date: Sun, 17 Dec 2023 15:46:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings Content-Language: en-US To: Yuan Fu 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> From: Dmitry Gutov In-Reply-To: <2C8AF27C-596F-4F7B-879C-9EB7497C45D1@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 67262 Cc: Eli Zaretskii , 67262@debbugs.gnu.org, JD Smith X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 23 04:52:34 2023 Received: (at 67262) by debbugs.gnu.org; 23 Dec 2023 09:52:34 +0000 Received: from localhost ([127.0.0.1]:48612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGygL-000622-JA for submit@debbugs.gnu.org; Sat, 23 Dec 2023 04:52:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39310) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGygJ-00061o-0e for 67262@debbugs.gnu.org; Sat, 23 Dec 2023 04:52:31 -0500 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 1rGyg8-0000ds-Ha; Sat, 23 Dec 2023 04:52:20 -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=AoOd8idIzwu9HglK8XD+ICqYI4V5sPie76uVm4B+/fE=; b=jkOXMOp7RxPLr2Po3VE4 Dnrr4OPQV6WJcWhLF6c1ubIYNJYQRanVbffKY+Vyt1PNCgCLNX9zjCDieDwwyexg05y2HDyaAAA/4 ScaZBQ0fysAse1FTfi7JXXhWH15vr1NGVTTK+baWwbd5HMOM7z4MuwDFUgFbRWtV+/fzY5rD3mUnG yHSoNEHgeLpJKUOxMkBdjwF0RPQjXVcfvdcXMFPAjyWRAS8/3+W3de+hxKalzxWLa9y/dS0mE8NiW UUP/XmVbqtKlzCSd0pfzv6e2z/UomZM28LIhdn3LO9V/U/dH+b4p3kXKlF3fLgun/zC/l1G/13DNs hMGHcM2JmpUWLQ==; Date: Sat, 23 Dec 2023 11:52:11 +0200 Message-Id: <83edfddz5g.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: (message from Dmitry Gutov on Sun, 17 Dec 2023 15:46:29 +0200) Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings 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> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67262 Cc: casouri@gmail.com, 67262@debbugs.gnu.org, jdtsmith@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ping! Can we please make further progress here to resolve this issue? > Date: Sun, 17 Dec 2023 15:46:29 +0200 > Cc: Eli Zaretskii , JD Smith , > 67262@debbugs.gnu.org > From: Dmitry Gutov > > 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. > From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 23 13:04:09 2023 Received: (at 67262) by debbugs.gnu.org; 23 Dec 2023 18:04:09 +0000 Received: from localhost ([127.0.0.1]:51195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rH6M5-0004up-Dl for submit@debbugs.gnu.org; Sat, 23 Dec 2023 13:04:09 -0500 Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]:47276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rH6M3-0004uK-1Y for 67262@debbugs.gnu.org; Sat, 23 Dec 2023 13:04:07 -0500 Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-35fe9a6609eso8064255ab.2 for <67262@debbugs.gnu.org>; Sat, 23 Dec 2023 10:04:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703354636; x=1703959436; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/8FUrZQ0dttii8enPPA5A55AM8FL9+FBZU5I1SNw5+c=; b=HNwKHRxEWe/CyJ9W5QEkWrtpr3BODfjmLh693Xx90DMz3g9Mune4m+wkVODAYLl57/ vJLTn6Vhrxg0IQNm54JzYR+1daDgHBbkvVQ3qiCnbuTLgRfWwHn5JF3pOBSYt49hDwXU bCoDh4bPNQYjVJ9z6UEPil0nxlUXFrmnhCX7l3nHxMxbDgCTAv7gGi28M0da5eX1IFFq z8bc8lCaN4oauoI8OMaqrk3cVbBgudlEZvjDMiDQX3Yj0tFwKzOF4H8iLyATlaTgiX1B vYkHDrYaIfSdDO0XDJ2DwnJ2h8bXcWJ2RNl95EzhQ6dXZO7ylqUESDILqw+f8ZZ3dUWP IpMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703354636; x=1703959436; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/8FUrZQ0dttii8enPPA5A55AM8FL9+FBZU5I1SNw5+c=; b=w35lnDHbqrOxpAjbaVxufKE9nkL6R2H6Xt6lgQqzKVmEwgreSbomkCwaJ/APHsuFJQ GF1P02eYNig+YgAf9bkzRfT7e3elRex3KrsY5+WNLZSiuUJI3K1UrHiMuD/3VYGzUPSZ 0uVsa7J3XPBtCi6ZfLQI35I0Ue8JBwezcS/M4ljk1eTPDdMFYjhpuImF/1CA67rL36Gh faK4qA13p7MQJrg7APXD8lptTItJYK1yWh2VxubDs6SLgtEvJ6ToceN2z2nHgtvnbFgi y96mH+1orU0SSREYQ00EX3TEy1uhiEagTG+srR11vfZkbcuu1G/zUZ+60LLm/tWlCoYj eShA== X-Gm-Message-State: AOJu0Yxe91bjMi9vWsaQyncUDqdIeYdjEMdfTjK+cpmavKACS1lw5JzH q8OPSoGkcwIaznJEnXEfqxE= X-Google-Smtp-Source: AGHT+IGHyNPzkecDcWneTWjzLiLoJ+XjfA2jYtw40doyC/9jo76dvKs3+tvOAOJ52iv+Ce7DuNYUdQ== X-Received: by 2002:a05:6e02:1523:b0:35f:b232:f72f with SMTP id i3-20020a056e02152300b0035fb232f72fmr5391509ilu.22.1703354635951; Sat, 23 Dec 2023 10:03:55 -0800 (PST) Received: from smtpclient.apple (172-117-161-177.res.spectrum.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id o23-20020a63e357000000b005c66a7d70fdsm4859082pgj.61.2023.12.23.10.03.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Dec 2023 10:03:54 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings From: Yuan Fu In-Reply-To: <83edfddz5g.fsf@gnu.org> Date: Sat, 23 Dec 2023 10:03:42 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <4E036F58-8190-42BF-A6EC-7967BE3921B2@gmail.com> 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> To: Eli Zaretskii X-Mailer: Apple Mail (2.3731.700.6) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67262 Cc: Dmitry Gutov , 67262@debbugs.gnu.org, JD Smith X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Dec 23, 2023, at 1:52 AM, Eli Zaretskii wrote: >=20 > Ping! Can we please make further progress here to resolve this issue? Once we merge the fix for bug#66732, we can proceed on this. I have a = patch for this bug too. Yuan= From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 23 16:01:52 2023 Received: (at 67262) by debbugs.gnu.org; 23 Dec 2023 21:01:52 +0000 Received: from localhost ([127.0.0.1]:51327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rH984-00078T-FF for submit@debbugs.gnu.org; Sat, 23 Dec 2023 16:01:52 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:53403) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rH982-00078G-Ia for 67262@debbugs.gnu.org; Sat, 23 Dec 2023 16:01:50 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id F1E465C012E; Sat, 23 Dec 2023 16:01:39 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 23 Dec 2023 16:01:39 -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=1703365299; x=1703451699; bh=+4xTXpsRsWksTVB1+T/eV2tjd0i46RyKIPcvZ2jFyic=; b= jtZwUgHYXl+NBvrWI+qZzX9Q24+42ewog7VJcXghxkTX/8hvU1lAJqAZZNotWNsc rDIiqRYi19OMke/x3RrBkWIrc6tqJ07GxUo4l9BMRq+eRp1x/tiD1XVdq0t0ZOI6 jvIn1a06vxGN8Ti2qISXFS0vqNlga1h8vgIzJO7ZmOxUv3JtLChSTWHMjlzfYTno ECnd3Sv/iKABiUVkD1qHWXdw4/s9rwCIEgRka8oILOQJV9K/4uwT9Sjpxh8mePqD nz1Jyg4SUeWqy0JseKBq+LBAQxXiIlOghEBXhoPcr/mMNpMvHpAc1RofLhS1cP0c GfZHFtizK8HhcP/Rf3NHsQ== 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=1703365299; x= 1703451699; bh=+4xTXpsRsWksTVB1+T/eV2tjd0i46RyKIPcvZ2jFyic=; b=4 g3btMFAL/o5XsX3l+YfONtKuWG6N2a9VnCQvkMrS4zeloUvclzVs7FPyWMIdRcXc Q7YXmrNmOW+rYyCkCCXmL4K53ihCF16e5XtCuXVnKQyp/uydPzLJ0UJcx3bADniE oWck+T0VpzYKOPHpqVAb/EpREfRZ35VwmLW6y1F6F5C5OE440N6pEKKdLLLvI4AW fhIg76UlcmFGv5pGXAcKvTX1yHb2pJ8lNn0iHOr6me3mwYYpSwtndPzVM+tBdsbd JdILL7WH+yUfPVQ2UdhyNfJyNVLwyl6IXBANY2eA2BO/yOAveOVjdp63qiAWE1VB Jig3AjyuxyaVNZZluMlcg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdduledgudegiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeffieefvdelueektdfgleeigedugfevkeefjeevjeffteffueeuueeghfev ieduvdenucffohhmrghinhepghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 23 Dec 2023 16:01:38 -0500 (EST) Message-ID: Date: Sat, 23 Dec 2023 23:01:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings Content-Language: en-US To: Yuan Fu , Eli Zaretskii 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> From: Dmitry Gutov In-Reply-To: <4E036F58-8190-42BF-A6EC-7967BE3921B2@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 67262 Cc: 67262@debbugs.gnu.org, JD Smith X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 23/12/2023 20:03, Yuan Fu wrote: >> On Dec 23, 2023, at 1:52 AM, Eli Zaretskii wrote: >> >> Ping! Can we please make further progress here to resolve this issue? > Once we merge the fix for bug#66732, we can proceed on this. I have a patch for this bug too. FWIW, I suggest using the first half of the patch attached to https://debbugs.gnu.org/67262#23 Only adjusting the positions to add the property to the "inner" pair of quotes rather than the outer one (to match python-mode). From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 23 18:51:54 2023 Received: (at 67262) by debbugs.gnu.org; 23 Dec 2023 23:51:55 +0000 Received: from localhost ([127.0.0.1]:51461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rHBmc-0006Nm-I4 for submit@debbugs.gnu.org; Sat, 23 Dec 2023 18:51:54 -0500 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:59707) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rHBmZ-0006NY-Rp for 67262@debbugs.gnu.org; Sat, 23 Dec 2023 18:51:53 -0500 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6d9af1f12d5so254584b3a.3 for <67262@debbugs.gnu.org>; Sat, 23 Dec 2023 15:51:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703375500; x=1703980300; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=yuv4AsMl3xPAFYo5rItr/JCdeN4/301FZHSMojP3Gc4=; b=YVpUBgDb47nsU6/hidBdyOwHUzpI/9mTzI56uF2pF2MKt0bv6Baz2e+y5lSuqKjCte ju83a2mux9/OPplmIPh/JuW+92uAnBAGZ5AJqu1zPhxHXJTqTxWoUe70qpo6X2rvEbFq g/E0eBYAwqVD27dMCgY/rT00Eq1uBAUXKlDGceXQjCZNfn+8wmchcwCTMoRh2SVnERHi 0u4G1fJ1CTwBYyioRWeYv7gZkfpoW82HtFOnR+dGEQKm8+WIXCkmanFXoUEfR1nbeIgY 1UuX0NlhHsZUevfSJnpTyOT/aJbayVCWxOjIZaKFM0ZD3xWwEd6ATmLGnmIUGxoe8GBz gHKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703375500; x=1703980300; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yuv4AsMl3xPAFYo5rItr/JCdeN4/301FZHSMojP3Gc4=; b=ABUqbeo5RrbcTzCGav+CXuliX96DhWovH7Tjl7RgE5My0jLsFgp7YoDTKMyB03YRao pXLWa8Ut2nSsvVvaf9qUawmpOT43Hr9GuEmaog4i8l4oGGWC+spiI60DMKzNgSfLO6mm F8M8GA6p5EnBGAJV2ZfTGUhLyV2gnuBnoX1Q2PTEHqqyPzMtnsN2H/q6Ob/xIyEOYC1S CVmHBwTO44KFno+BhL0adNeKpfUNY2YFV7IbOP0wayoHDkVOFaAFwlItVh8B9dThf909 ELGQqTXXqMebGiafSNuN8OBk0zPHV8p0nZU4w8kh5RKV5mLCofilmksn9Qs2caKWDK50 zbnQ== X-Gm-Message-State: AOJu0Yyu2sZg4z5ZuvLEOPQ/pjYaCLuC89KjLTkdD2djePBveuRI78KO F059YS8avozAYX0gWHlsTuU= X-Google-Smtp-Source: AGHT+IEDK1+HaA4g1VgAjNlKkK+ELSxPHKg5ObQy7B0N0hPNODYXa4tKh4LSSD35/lP/0zAceldncA== X-Received: by 2002:aa7:8003:0:b0:6d2:66a3:64ee with SMTP id j3-20020aa78003000000b006d266a364eemr3955120pfi.47.1703375500106; Sat, 23 Dec 2023 15:51:40 -0800 (PST) Received: from smtpclient.apple (172-117-161-177.res.spectrum.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id d6-20020a056a00198600b006d93afd243asm5534768pfl.72.2023.12.23.15.51.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Dec 2023 15:51:39 -0800 (PST) From: Yuan Fu Message-Id: <90B31D18-7607-4D37-A6B4-5CFE3C4F40A9@gmail.com> Content-Type: multipart/mixed; boundary="Apple-Mail=_D8CD5540-69D1-4FB6-9893-862CD26E285C" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings Date: Sat, 23 Dec 2023 15:51:24 -0800 In-Reply-To: To: Dmitry Gutov 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> X-Mailer: Apple Mail (2.3731.700.6) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67262 Cc: Eli Zaretskii , 67262@debbugs.gnu.org, JD Smith X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Apple-Mail=_D8CD5540-69D1-4FB6-9893-862CD26E285C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Dec 23, 2023, at 1:01 PM, Dmitry Gutov wrote: >=20 > On 23/12/2023 20:03, Yuan Fu wrote: >>> On Dec 23, 2023, at 1:52 AM, Eli Zaretskii wrote: >>>=20 >>> Ping! Can we please make further progress here to resolve this = issue? >> Once we merge the fix for bug#66732, we can proceed on this. I have a = patch for this bug too. >=20 > FWIW, I suggest using the first half of the patch attached to = https://debbugs.gnu.org/67262#23 >=20 > Only adjusting the positions to add the property to the "inner" pair = of quotes rather than the outer one (to match python-mode). Something like this? IMHO the code is easier to understand without the = syntax-propertize-rules. Yuan --Apple-Mail=_D8CD5540-69D1-4FB6-9893-862CD26E285C Content-Disposition: attachment; filename=python-syntax.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="python-syntax.patch" Content-Transfer-Encoding: quoted-printable =46rom=201a54e754074e7785d853d5821811d37fa837165c=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Yuan=20Fu=20=0ADate:=20Sat,=20= 23=20Dec=202023=2015:49:32=20-0800=0ASubject:=20[PATCH]=20Fix=20= python-ts-mode=20triple=20quote=20syntax=20(bug#67262)=0A=0A*=20= lisp/progmodes/python.el=20(python--treesit-syntax-propertize):=20New=20= function.=0A(python-ts-mode):=20Activate=20= python--treesit-syntax-propertize.=0A---=0A=20lisp/progmodes/python.el=20= |=2017=20+++++++++++++++++=0A=201=20file=20changed,=2017=20insertions(+)=0A= =0Adiff=20--git=20a/lisp/progmodes/python.el=20= b/lisp/progmodes/python.el=0Aindex=207c5c20608bd..7d2db64a988=20100644=0A= ---=20a/lisp/progmodes/python.el=0A+++=20b/lisp/progmodes/python.el=0A@@=20= -1228,6=20+1228,21=20@@=20python--treesit-fontify-variable=0A=20=20=20=20= =20=20(treesit-node-start=20node)=20(treesit-node-end=20node)=0A=20=20=20= =20=20=20'font-lock-variable-use-face=20override=20start=20end)))=0A=20=0A= +(defun=20python--treesit-syntax-propertize=20(start=20end)=0A+=20=20= "Propertize=20triple-quote=20strings=20between=20START=20and=20END."=0A+=20= =20(save-excursion=0A+=20=20=20=20(goto-char=20start)=0A+=20=20=20=20= (while=20(search-forward=20"\"\"\""=20end=20t)=0A+=20=20=20=20=20=20(let=20= ((node=20(treesit-node-at=20(point))))=0A+=20=20=20=20=20=20=20=20;;=20= The=20triple=20quotes=20surround=20a=20non-empty=20string.=0A+=20=20=20=20= =20=20=20=20(when=20(equal=20(treesit-node-type=20node)=20= "string_content")=0A+=20=20=20=20=20=20=20=20=20=20(let=20((start=20= (treesit-node-start=20node))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(end=20(treesit-node-end=20node)))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20(put-text-property=20(1-=20start)=20start=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= 'syntax-table=20(string-to-syntax=20"|=20"))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20(put-text-property=20end=20(min=20(1+=20end)=20(point-max))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20'syntax-table=20(string-to-syntax=20"|=20"))))))))=0A+=0A=20= =0C=0A=20;;;=20Indentation=0A=20=0A@@=20-6729,6=20+6744,8=20@@=20= python-ts-mode=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= #'python--treesit-defun-name)=0A=20=20=20=20=20= (treesit-major-mode-setup)=0A=20=0A+=20=20=20=20(setq-local=20= syntax-propertize-function=20#'python--treesit-syntax-propertize)=0A+=0A=20= =20=20=20=20(python-skeleton-add-menu-items)=0A=20=0A=20=20=20=20=20= (when=20python-indent-guess-indent-offset=0A--=20=0A2.41.0=0A=0A= --Apple-Mail=_D8CD5540-69D1-4FB6-9893-862CD26E285C-- From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 23 19:45:45 2023 Received: (at 67262) by debbugs.gnu.org; 24 Dec 2023 00:45:45 +0000 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 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 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) 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 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 23 Dec 2023 19:45:28 -0500 (EST) Message-ID: <2d6c8f44-e59e-4752-811a-ce7eebd3ee09@gutov.dev> Date: Sun, 24 Dec 2023 02:45:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings Content-Language: en-US To: Yuan Fu 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> From: Dmitry Gutov In-Reply-To: <90B31D18-7607-4D37-A6B4-5CFE3C4F40A9@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 67262 Cc: Eli Zaretskii , 67262@debbugs.gnu.org, JD Smith X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 23 22:10:35 2023 Received: (at 67262-done) by debbugs.gnu.org; 24 Dec 2023 03:10:36 +0000 Received: from localhost ([127.0.0.1]:51556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rHEst-0003Jx-Ji for submit@debbugs.gnu.org; Sat, 23 Dec 2023 22:10:35 -0500 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]:44280) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rHEss-0003Ji-2C for 67262-done@debbugs.gnu.org; Sat, 23 Dec 2023 22:10:34 -0500 Received: by mail-oi1-x235.google.com with SMTP id 5614622812f47-3ba52d0f9feso2372877b6e.0 for <67262-done@debbugs.gnu.org>; Sat, 23 Dec 2023 19:10:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703387422; x=1703992222; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=dYpZA3gWKY4X/pLs8HvbWHFMYSjWjreW3e70Rc5CtEQ=; b=AROCjNas+4h8a6+hM1TG/NAYRGGuHyiFLw7jvdOqbR1KSQDHa/Bra/klbWyQr+SgXR vi7kN/P3RuOOX0sa56VGXAQo6hrsbBd9uL0O3Ow0oefyO1o23g5nwq5Q74n5yI1ChAnq CkpCN8wsddUmDCPw+JExdG6EjcIa3U4eozE+bhaVj7V4bh3Axop5on7ldLaaphyH3GEB MfdJNJ29ZQNr+Mj8vLvnjhGiwPMAEhmvnXx1UgEB9sslM9v7AVjMtmWqSiLZ8qmoCelI UHC67irtYljLbzWQgT26kpQ71Idr4scULi4Q67fJWo7vmqydefqoBf9BCDdyOjxupyBc Wpmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703387422; x=1703992222; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dYpZA3gWKY4X/pLs8HvbWHFMYSjWjreW3e70Rc5CtEQ=; b=gielXWE7lwP6wD4mLmFs2FxEpWfGhazzEmMTQwQv8oFbXQwMzKkEiGtagUEExSuual f9JFGm2zVYQxP23bS18786d6cycrGtvk2e0ZRaRIomPsgAeZy7S0UfxZfF6TFxc5tDtu 4bzOXSF6seWQDtkbKMjO7LuYwDp3KotdJ+B8gOMM/oWEE9lyZ8xrxsqOYPEaUKZfsSiu bCuIcVu1B/ct+lvoC1NhpgFHUWqFc5Fq7sICICh2cshRXtuujoRV6xwu0WPxnl/H4rtp vM4i2dVAXzUBTmRfZ3PKgWW306hgrk7PveCyDSwaKodmf56gTfK/KSgd/i3+tqumwLfU S0uQ== X-Gm-Message-State: AOJu0Yx5VUfNgVeocLJ+c+8XqFHLyUAvUE2CUvYvxKcz0016YyMFkKCo 7kKE9dcqtCc6TL20DoxxenQ= X-Google-Smtp-Source: AGHT+IHKFshmLibFdO6FIDiiAADFbSEyfyMsR7lMjsA6Bzg/Nx9PZQYJLt1ByGi4Zl44nvw8PtAMkQ== X-Received: by 2002:a05:6808:17aa:b0:3b9:fc7c:b585 with SMTP id bg42-20020a05680817aa00b003b9fc7cb585mr4315056oib.32.1703387422447; Sat, 23 Dec 2023 19:10:22 -0800 (PST) Received: from smtpclient.apple (172-117-161-177.res.spectrum.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id v10-20020a056a00148a00b006d96ad39308sm410819pfu.165.2023.12.23.19.10.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Dec 2023 19:10:22 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: bug#67262: python-ts-mode cannot identify triple-quoted-strings From: Yuan Fu In-Reply-To: <2d6c8f44-e59e-4752-811a-ce7eebd3ee09@gutov.dev> Date: Sat, 23 Dec 2023 19:10:05 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <50F7C069-4750-42E0-9B65-66CE31850C51@gmail.com> 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> <2d6c8f44-e59e-4752-811a-ce7eebd3ee09@gutov.dev> To: Dmitry Gutov X-Mailer: Apple Mail (2.3731.700.6) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67262-done Cc: Eli Zaretskii , 67262-done@debbugs.gnu.org, JD Smith X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Dec 23, 2023, at 4:45 PM, Dmitry Gutov wrote: >=20 > On 24/12/2023 01:51, Yuan Fu wrote: >> Something like this? IMHO the code is easier to understand without = the syntax-propertize-rules. >=20 > Sure, fine with me. >=20 >> + (while (search-forward "\"\"\"" end t)+ = (put-text-property (1- start) start >=20 > I think we also should support the triple-single-quotes, like = python-syntax-propertize-function does. >=20 >> + 'syntax-table (string-to-syntax "| = ")) >> + (put-text-property end (min (1+ end) (point-max)) >> + 'syntax-table (string-to-syntax "| = ")))))))) >=20 > The spaces after "|" seem unnecessary. Thanks, fixed those things and pushed to emacs-29. Yuan= From unknown Sun Jun 22 03:52:12 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 21 Jan 2024 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator