[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#22867: cperl-mode: Commit d0ad6306 suppresses fontification of hash/
From: |
Harald Jörg |
Subject: |
bug#22867: cperl-mode: Commit d0ad6306 suppresses fontification of hash/array declarations |
Date: |
Fri, 4 Sep 2020 18:04:07 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 |
On 9/4/20 5:46 AM, Lars Ingebrigtsen wrote:
> Harald Jörg <haj@posteo.de> writes:
>
>>> 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.
> [...]
> After poking around a bit, I came up with this patch:
>
> diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
> index 5dee5007e2..7a1c2e4d24 100644
> --- a/lisp/progmodes/cperl-mode.el
> +++ b/lisp/progmodes/cperl-mode.el
> @@ -5776,8 +5776,8 @@ cperl-init-faces
> t-font-lock-keywords)
> cperl-font-lock-keywords cperl-font-lock-keywords-1
> cperl-font-lock-keywords-2 (append
> - cperl-font-lock-keywords-1
> - t-font-lock-keywords-1)))
> + t-font-lock-keywords-1
> + cperl-font-lock-keywords-1)))
> (if (fboundp 'ps-print-buffer) (cperl-ps-print-init))
> (if (or (featurep 'choose-color) (featurep 'font-lock-extra))
> (eval ; Avoid a warning
>
>
> It seems to fix all the test cases in Harald's .pl file, and the cperl
> test file still passes (but its coverage isn't, ahem, extensive).
>
> Does anybody see any problems with just doing fixing it like this? I
> had a peek at a couple of other perl files here, and nothing immediately
> looked wonky, but I'm a bit out of practice writing perl...
That change is fine with me!
--
Cheers,
haj