GNU bug report logs - #70383
Conf-mode[toml] badly set face property

Previous Next

Package: emacs;

Reported by: Alastair Irving <alastair.j.irving <at> gmail.com>

Date: Sun, 14 Apr 2024 15:21:04 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
To: Alastair Irving <alastair.j.irving <at> gmail.com>
Cc: 70383 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, "Mr. Jostein Kjønigsen" <jostein <at> kjonigsen.net>, Yuan Fu <casouri <at> gmail.com>
Subject: bug#70383: Conf-mode[toml] badly set face property
Date: Mon, 15 Apr 2024 08:43:59 +0200
[Message part 1 (text/plain, inline)]
From what I can tell Alastair is using conf-mode, not toml-ts-mode.

Alastait: toml-ts-mode is a new builtin tree-sitter based major-mode for working with TOML files.

If you have issues with conf-mode and certain TOML files, you could try that instead. I just tried it with your test-files and I don't see any incorrect fontification, so it seems to work fairly well.

Eli: If there's a bug to fix in conf-mode, I'm going to assume it would be better to CC the conf-mode maintainer than the toml-ts-mode maintainer. It might gain more traction.

—
Kind Regards
Jostein Kjønigsen

> On 14 Apr 2024, at 21:59, Alastair Irving <alastair.j.irving <at> gmail.com> wrote:
> 
> 
> On 14/04/2024 17:46, Eli Zaretskii wrote:
>>> Date: Sun, 14 Apr 2024 11:25:08 +0100
>>> From: Alastair Irving <alastair.j.irving <at> gmail.com>
>>> 
>>> When editting TOML files with conf-mode[toml] the face property is being
>>> set badly on certain characters.  This occurs in Emacs 29.3 (running
>>> with -q) but has been present in older versions.  Steps to reproduce:
>>> 
>>> 1. Create a file test.toml containing the following:
>>> 
>>> 
>>> [package]
>>> name = "test"
>>> # See more keys and their definitions at
>>> https://doc.rust-lang.org/cargo/reference/manifest.html
>>> [dependencies]
>>> 
>>> 2. Navigate to the d in dependencies and evaluate
>>> 
>>> (text-properties-at (point))
>>> 
>>> The output for me looks like
>>> 
>>> (face (font-lock-type-face font-lock-type-face font-lock-type-face
>>> font-lock-type-face font-lock-type-face font-lock-ty\
>>> pe-face font-lock-type-face font-lock-type-face font-lock-type-face
>>> font-lock-type-face
>>> 
>>> 
>>> It looks like something is wrong in the font-lock setup and the same
>>> face is being applied very many times.
>> I cannot reproduce this here, neither in Emacs 29 nor in Emacs 30.
>> What version of the TOML grammar library are you using?
> I don't think it's using a TOML grammar library, just conf-mode bundled with EMACS "The major mode is Conf[TOML] mode defined in conf-mode.el".  I think an extra newline was inserted in the TOML I pasted (in the comment before the URL), it should be 4 lines total. I've attached the exact file.
>> 
>> Jostein and Yuan, can you please look into this?
> <test.toml>

[Message part 2 (text/html, inline)]

This bug report was last modified 1 year and 88 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.