bug-gnu-emacs
[Top][All Lists]
Advanced

[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: Tue, 1 Sep 2020 18:02:18 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0

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):

   my @arr = (1,2,3); # @arr fontified as a scalar - bad
   push @arr, 4;      # @arr fontified as an array - good
   print $arr[4];     # $arr fontified as an array - good

   my %hash = ( foo => 'bar' ); # %hash fontified as a scalar - bad
   $hash{baz => 'quux'};        # $hash fontified as a hash - good

Can this be easily fixed?

---

Of minor importance: There are some cases where fontification of an
array in a string makes sense, but is gone now:

   my $mail = "me@somewhere.net";

This was previously fontified as an array.  This makes sense because
in doubly-quoted strings, the value of arrays (here: @somewhere) will
be interpolated into the string.  In the example above, the
fontification of @somewhere as an array was a welcome warning that
this is not what you want.

Fontification of a hash in a string, on the other hand, never makes
sense because hashes aren't interpolated.

---

Also, this bug can be merged with (Bug#11054), which in turn had been
merged with (Bug#3091).






reply via email to

[Prev in Thread] Current Thread [Next in Thread]