GNU bug report logs - #22867
cperl mode highlights %d, but misses %.6f

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Tue, 1 Mar 2016 06:53:01 UTC

Severity: minor

Tags: fixed

Merged with 3091, 11054

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #32 received at 22867 <at> debbugs.gnu.org (full text, mbox):

From: Harald Jörg <haj <at> posteo.de>
To: Stefan Kangas <stefankangas <at> gmail.com>, 22867 <at> debbugs.gnu.org
Subject: Re: bug#22867: cperl-mode: Commit d0ad6306 suppresses fontification
 of hash/array declarations
Date: Tue, 1 Sep 2020 21:44:02 +0200
On 9/1/20 6:34 PM, Stefan Kangas wrote:
> forcemerge 11054 22867
> thanks
> 
> Harald Jörg <haj <at> posteo.de> writes:
> 
>> The recent fix d0ad6306 to cperl-mode fixes a lot of unwanted
>> fontification of arrays and hashes, in particular in comments, POD,
>> and strings.  However, as a side effect it also prevents fontification
>> in a variable declaration (this has been observed by choroba):
> 
> It would be very nice to have test cases for all this.

Indeed.  That will take a while, too :)

Not too long ago I stumbled over (or was pointed to?) a suite
https://github.com/Lindydancer/font-lock-regression-suite which also
contains an example in Perl.  Testing this example against its
faceup-counterpart would fail as of today.

> Is the fix worse than the problem?  If yes, maybe it should be reverted?

The fix isn't _worse_.  Strings like "%s" and "%d" in the argument
list of printf being fontified as hashes is indeed idiotic.  Also,
more than once I was annoyed by fontification in POD sections.

On the other hand, declarations of hashes and arrays occur rather
frequently, and there's a lot more in that area that would deserve
some love and care.  So, while this fix was a necessary first step in
any case, some refinement might be desirable to cut off the rough
edges it left.  I don't see an easy way, but this might be well due to
my limited elisp experience.
-- 
Cheers,
haj




This bug report was last modified 4 years and 258 days ago.

Previous Next


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