From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jeff Spencer Newsgroups: gmane.emacs.bugs Subject: bug#51362: python font-lock-mode in emacs 28 seems broken Date: Sun, 24 Oct 2021 17:37:39 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000ee567805cf20e4f0" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23811"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51362@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 25 00:38:11 2021 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 1mem82-0005zN-TR for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Oct 2021 00:38:11 +0200 Original-Received: from localhost ([::1]:46958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mem81-0001tb-2a for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Oct 2021 18:38:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mem7u-0001tT-Lg for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 18:38:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57931) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mem7u-0003An-Cn for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 18:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mem7t-0003Bc-V5 for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2021 18:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jeff Spencer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Oct 2021 22:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51362 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 51362-submit@debbugs.gnu.org id=B51362.163511507712236 (code B ref 51362); Sun, 24 Oct 2021 22:38:01 +0000 Original-Received: (at 51362) by debbugs.gnu.org; 24 Oct 2021 22:37:57 +0000 Original-Received: from localhost ([127.0.0.1]:41244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mem7o-0003BG-UH for submit@debbugs.gnu.org; Sun, 24 Oct 2021 18:37:57 -0400 Original-Received: from mail-ot1-f54.google.com ([209.85.210.54]:42650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mem7o-0003B2-3n for 51362@debbugs.gnu.org; Sun, 24 Oct 2021 18:37:56 -0400 Original-Received: by mail-ot1-f54.google.com with SMTP id l24-20020a9d1c98000000b00552a5c6b23cso12307593ota.9 for <51362@debbugs.gnu.org>; Sun, 24 Oct 2021 15:37:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Uythkwes07o8az0LgDBb0bkzLQMs0j5iSTyyNGlzB18=; b=eGbvpGF8Cc98yPZUGsF13mINwsVLVv5c5olwrpXc23f1ua06f9fNCObYRb1g2MmnWg XOXXiKljGrDlPZ7iPw2ShRLVt8cFi2mhdtBw5dR6Rwa3VyJJ6zySrEnNzCidqehwHQJ8 QefU0odJhEqdnvhsXTX4KReUFzldiTwKzVXn/DrKRf2E7P2mYehFdEn75v7MTn45UMl4 amHQ6X9N7guBLJnb79P30RBZvmlPEm0nfY1Nie89mpmP+GS7+dL9DCsBADhtNHCMFBJj pB9q8bvE9jw7Uta9yS+KPtDR6jGtfcSVE9MFeCw2pXa8GHNJ7jzMx8T0io9/cbYEV+MR BQ6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Uythkwes07o8az0LgDBb0bkzLQMs0j5iSTyyNGlzB18=; b=GkTVT7Xl58O0WiJ8Xs9GGHeI8jrGjAxk4gvxVbtTMTZwIOiH+36VkzOf2NBRWMN6TI vEnDlwI8uPVyVV0D32tKXvx1Y8M9dhGrdek9oA7efZoixxHxjFbFj9kHhxIya1hcZn3W 3ZfK8dl/tUgd9ilVSxfC8EgxTczzmGtzNw+a3kBwIzhBmRT3YtVeePxr1hxA7PFFWYZh XFNY5KcnGgFL9aAOzsKG8Tguyw6G7ZknvTVoxS6wCRAGN5svKPVCVvBV+xl7ZzznV+td Q4QouDOlg1CDo+6mjUFuP5PordUZ5Ky0ZwDg48YETOrQry8tLVd0QC693YA7uVkIvDJu cO6g== X-Gm-Message-State: AOAM530COp4dBpCbq9jAHi/SVl3zzxtujot6I3A4of9rWcGLlFodsUeQ gYauJguV9xiPz7vkTRk0LO5OQuscxVWUixr/m7pekPWgAqJAZg== X-Google-Smtp-Source: ABdhPJx6ObLdQHwfe6wGcmMEiCtZmxiuLNci1sKJo1zkVbKTKBTiGzOZJ/1+tSIjlKafC+Y/ji5jkNsWGJiRfKs2ET0= X-Received: by 2002:a05:6830:922:: with SMTP id v34mr10915857ott.223.1635115070280; Sun, 24 Oct 2021 15:37:50 -0700 (PDT) In-Reply-To: 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" Xref: news.gmane.io gmane.emacs.bugs:218230 Archived-At: --000000000000ee567805cf20e4f0 Content-Type: text/plain; charset="UTF-8" Here is a somewhat minimal example. What is weird is it is inconsistent. If I save this as `test.py` and load it none of the `snapshot_spec` are colored, but they are just normal text. If on the line where snapshot_spec is defined I delete the tuple part of input_tuple it will be highlighted correctly and remains that way. Then if I go back up and I for example delete `| datetime` then it goes back to no color. ``` from __future__ import annotations from datetime import datetime import pandas as pd def make_snapshot_temp(input_tuple: tuple, window: int, date: str | datetime) -> None: snapshot_spec = pd.DataFrame(input_tuple, columns=["lead_id"]) snapshot_spec["snapshot_to_date"] = pd.to_datetime(date) if window == 0: snapshot_spec["snapshot_from_date"] = pd.to_datetime("2017-04-01") snapshot_spec["snapshot_window"] = "all-time" return snapshot_spec ``` On Sun, Oct 24, 2021 at 7:45 AM Stefan Kangas wrote: > Jeff Spencer writes: > > > If you look at the link below it doesn't highlight the `post_split_...` > > variable but it does highlight the `df_train` variable below it > > correctly. The link shows my settings, but this happens when starting > > with emacs -Q as well. It seems the syntax highlighting got messed up > > with the addition of the f-strings code. > > Do you have an example file or snippet where font-lock fails? > --000000000000ee567805cf20e4f0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Here is a somewhat minimal example. What is weird is = it is inconsistent. If I save this as `test.py` and load it none of the `sn= apshot_spec` are colored, but they are just normal text. If on the line whe= re snapshot_spec is defined I delete the tuple part of input_tuple it will = be highlighted correctly and remains that way. Then if I go back up and I f= or example delete `| datetime` then it goes back to no color.
```
from __future__ import annotations

from datetim= e import datetime

import pandas as pd


def make_snapshot_t= emp(input_tuple: tuple, window: int, date: str | datetime) -> None:
<= br>=C2=A0 =C2=A0 snapshot_spec =3D pd.DataFrame(input_tuple, columns=3D[&qu= ot;lead_id"])
=C2=A0 =C2=A0 snapshot_spec["snapshot_to_date&qu= ot;] =3D pd.to_datetime(date)

=C2=A0 =C2=A0 if window =3D=3D 0:
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 snapshot_spec["snapshot_from_date"] = =3D pd.to_datetime("2017-04-01")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 s= napshot_spec["snapshot_window"] =3D "all-time"

= =C2=A0 =C2=A0 return snapshot_spec
```

On Sun, Oct 24, 2021 at= 7:45 AM Stefan Kangas <stefan@marx= ist.se> wrote:
Jeff Spencer <jeffspencerd@gmail.com> writes:

> If you look at the link below it doesn't highlight the `post_split= _...`
> variable but it does highlight the `df_train` variable below it
> correctly. The link shows my settings, but this happens when starting<= br> > with emacs -Q as well. It seems the syntax highlighting got messed up<= br> > with the addition of the f-strings code.

Do you have an example file or snippet where font-lock fails?
--000000000000ee567805cf20e4f0--