GNU bug report logs - #43916
$$, $@, $bla colors in Perl mode vs. Shell-script mode

Previous Next

Package: emacs;

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

Date: Sun, 11 Oct 2020 00:07:02 UTC

Severity: minor

Full log


View this message in rfc822 format

From: Corwin Brust <corwin <at> bru.st>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 43916 <at> debbugs.gnu.org
Subject: bug#43916: $$, $@, $bla colors in Perl mode vs. Shell-script mode
Date: Wed, 21 Oct 2020 01:25:23 -0500
[Message part 1 (text/plain, inline)]
Hi!

On Tue, Oct 20, 2020 at 6:42 AM 積丹尼 Dan Jacobson <jidanni <at> jidanni.org> wrote:
>
> >>>>> "LI" == Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> LI> 積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:
>
> >> OK but that doesn't explain the inconsistencies within the same language seen.
>
> LI> The $ is the same colour in Perl mode, so you'll have to be more
> LI> specific about what inconsistencies you're referring to.
>
> All I know is in perl mode,
> $$, $@, $bla
> BB, BB, BTTT (Black, Tan)
>
> So it should be
> BT, BT, BTTT like Shell-script mode,
> or
> BB, BB, BBBB
> or
> TT, TT, TTTT.

I think what we have now makes sense.  I've tried to attach a
screenshot of a -Q session but with (setq cperl-hairy t)

In essence, what I think I see is that cperl will color the whole
array or hash variable including the @ or % sigil when it used as
such, however, when a sigil is used to dereference only sigils is
colored for the hash or array - the scalar being derefered is colored
per scalar (e.g. tan).   This is perhaps the most immediately obvious
difference between perl and cperl-mode and probably a big part of why
I think that cperl provides much better visual feedback than
perl-mode.   (As an aside, I've long wondered if there are people who
perl-mode to cperl-mode and if disagreement about this drives that
preference.)

One thing I could wish for is that scalars used within hash and array
access would be colored just as they are otherwise, e.g. using the tan
color for the $scalar in $arr[$scalar] and $hash{$scalar}.

Otherwise I'm pretty happy; I've not found a better Perl editing
experience than Emacs cperl-mode.

Thanks for your work on this feature!

Corwin
[emacs_4h1pZBfvyO.png (image/png, attachment)]

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

Previous Next


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