From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: kobarity Newsgroups: gmane.emacs.bugs Subject: bug#45897: [PATCH] 27.1; python mode font-lock confused by string concatenation Date: Sun, 21 Jan 2024 00:41:22 +0900 Message-ID: References: <875z3ydqlz.fsf@tromey.com> <83bk9gtixd.fsf@gnu.org> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: multipart/mixed; boundary="Multipart_Sun_Jan_21_00:41:21_2024-1" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1847"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Cc: 45897@debbugs.gnu.org, Eli Zaretskii To: Jakub =?UTF-8?Q?Je=C4=8Dm=C3=ADnek?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 20 16:42:12 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rRDU3-0000JJ-El for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Jan 2024 16:42:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rRDTs-0005TA-Rx; Sat, 20 Jan 2024 10:42:00 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rRDTr-0005Q9-IT for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 10:41:59 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rRDTr-00019Q-7z for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 10:41:59 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rRDTt-00043Z-U6 for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 10:42:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: kobarity Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Jan 2024 15:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45897 X-GNU-PR-Package: emacs Original-Received: via spool by 45897-submit@debbugs.gnu.org id=B45897.170576529515543 (code B ref 45897); Sat, 20 Jan 2024 15:42:01 +0000 Original-Received: (at 45897) by debbugs.gnu.org; 20 Jan 2024 15:41:35 +0000 Original-Received: from localhost ([127.0.0.1]:35525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRDTS-00042b-IX for submit@debbugs.gnu.org; Sat, 20 Jan 2024 10:41:35 -0500 Original-Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:42031) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRDTQ-00042E-0e for 45897@debbugs.gnu.org; Sat, 20 Jan 2024 10:41:32 -0500 Original-Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6dbc9dab55dso750609b3a.0 for <45897@debbugs.gnu.org>; Sat, 20 Jan 2024 07:41:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705765283; x=1706370083; darn=debbugs.gnu.org; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=BxFsDzWaF7P5iCLbhW1AtSke2xU7srpubqQQqbL32yQ=; b=Q+gLwl+evCHaxg0mbrttI8rw7Gm7HEXrQwFKiA0iXCIyOSdprxBBdQsqAl0N+na00t c0Js8pTHgi2V3Z/CIX6DEc/h/554wDjExJoH7IRbA53R+za61yWyI1+lXIHxqpzpGcg8 b1pE+y8LWm+70SOB+QIGakN/bELYyV2+Jjgb/Ts7VuFRXnNV8cmBhslUO0cafTCmRT2+ /CZP0NyTZiy7ihV/j2t2L7aQVHFOWl8cnCCousmTXgEBIHo3KktHN7dF6ASLEfDfOwaC zMzq1/qGx9T0XQE+xBLLrTX6UsChQoLC9H6k1JlHtKpsXtXMJjwXyYA07bmjHXnJIqeG ujSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705765283; x=1706370083; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BxFsDzWaF7P5iCLbhW1AtSke2xU7srpubqQQqbL32yQ=; b=C+LyJz02EsmbhCSF19eXYGrhC4Eo/6kGXgQwGKBjAHFrFWQ7Q/YfGvb/9SC0XU5IBa fq6ERse3szzU36p8W2yh9oxIzNbGCpbDEGyzI2E2WHZlhXU4DZ7UnWBFGPs41i0OhLSP nLQgnZZD2P22c8GqgmkInUmJmDnLcdul1yUtuJe8fBeO6UygbUzgyrfjQa5/KSbeUfce Ic/g+vuuebgVLzhMP5ztyfw8KWqZz9YQG/nxPfHcNQzI4e3RvVVMCyOYtMOD0lxRHM38 vt/Jp77Jp0e6Hg8+OaJjy1ix/pa1ffpJML/VfGamx4kiOwMqsFjqmjxZq5jDD/86G+20 Wkiw== X-Gm-Message-State: AOJu0YyzgoiZfw4KHtfGNpK3q7oyIEGS8viU0k5pGt2wZX84J2uDqPbn BhehHlAYZ9gINjL31q07f384jfv7sgcFN5r7M28kIDuoEMDYkFZJ X-Google-Smtp-Source: AGHT+IH0MDDnz7hBV4BLYX7GsU0aPG/5eRPMryBJ6C0xt4AM2IK6ucr5HZ+yGqkDSt+IeOOc9RS3tQ== X-Received: by 2002:a05:6a00:130f:b0:6da:bed1:c8b with SMTP id j15-20020a056a00130f00b006dabed10c8bmr3385061pfu.20.1705765283092; Sat, 20 Jan 2024 07:41:23 -0800 (PST) Original-Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id s5-20020a056a00194500b006da96503d9fsm6876191pfk.109.2024.01.20.07.41.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jan 2024 07:41:22 -0800 (PST) In-Reply-To: <83bk9gtixd.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:278612 Archived-At: --Multipart_Sun_Jan_21_00:41:21_2024-1 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable On Sat, 20 Jan 2024 19:09:50 +0900, Eli Zaretskii wrote: >=20 > > From: Jakub Je=E8m=EDnek > > Date: Fri, 19 Jan 2024 18:25:57 +0100 > >=20 > > Tags: patch > >=20 > > I'm sending the patch once again with correct indentation and patch tag > > (I'm still figuring out how the bug tracker works). >=20 > Thanks. >=20 > Kobarity, any comments? Thank you for the patch. I tried it and confirmed that the example shown by Tom Tromey is fixed. I think ppss and line-ppss would be the same in this example. Can you give an example of a case where ppss and line-ppss are different? I noticed an error in the commit-msg hook when applying the patch. CONTRIBUTE states the following: - Lines in ChangeLog entries should preferably be not longer than 63 characters, and must not exceed 78 characters, unless they consist of a single word of at most 140 characters; this 78/140 limit is enforced by a commit hook. Also, the indentation still looks wrong to me. It might be better to attach the patch instead of pasting it into the body of the mail. Attached is a patch to add an ERT that identifies this issue. Please add it to your patch if you like. --Multipart_Sun_Jan_21_00:41:21_2024-1 Content-Type: text/plain; type=patch; name="0001-Add-an-ERT-for-bug-45897.patch"; charset=US-ASCII Content-Disposition: attachment; filename="0001-Add-an-ERT-for-bug-45897.patch" Content-Transfer-Encoding: 7bit >From af56c8c9f6e056d84b604ffc2ab85f029a74aa17 Mon Sep 17 00:00:00 2001 From: kobarity Date: Sun, 21 Jan 2024 00:05:04 +0900 Subject: [PATCH] Add an ERT for bug#45897 * test/lisp/progmodes/python-tests.el (python-font-lock-string-literal-concatenation): New test. --- test/lisp/progmodes/python-tests.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index 97ffd5fe20f..59957ff0712 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -660,6 +660,18 @@ python-font-lock-raw-escape-sequence (3 . font-lock-string-face) (14) (16 . font-lock-string-face)))) +(ert-deftest python-font-lock-string-literal-concatenation () + "Test for bug#45897." + (python-tests-assert-faces + "x = \"hello\"\"\" +y = \"confused\"" + '((1 . font-lock-variable-name-face) (2) + (3 . font-lock-operator-face) (4) + (5 . font-lock-string-face) (14) + (15 . font-lock-variable-name-face) (16) + (17 . font-lock-operator-face) (18) + (19 . font-lock-string-face)))) + ;;; Indentation -- 2.34.1 --Multipart_Sun_Jan_21_00:41:21_2024-1--