all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Harald Jörg" <haj@posteo.de>
To: 22867@debbugs.gnu.org
Subject: bug#22867: cperl-mode: Commit d0ad6306 suppresses fontification of hash/array declarations
Date: Tue, 1 Sep 2020 18:02:18 +0200	[thread overview]
Message-ID: <793881bc-c77d-8ddd-61b2-d20d94107eed@posteo.de> (raw)
In-Reply-To: <87ziui3d2f.fsf@jidanni.org>

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






  parent reply	other threads:[~2020-09-01 16:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01  6:52 bug#22867: cperl mode highlights %d, but misses %.6f 積丹尼 Dan Jacobson
2016-04-10 23:17 ` Alexis
2020-08-07 10:09 ` Lars Ingebrigtsen
2020-08-07 11:13   ` Andreas Schwab
2020-08-07 12:07     ` Lars Ingebrigtsen
2020-09-01 16:02 ` Harald Jörg [this message]
2020-09-01 16:34   ` bug#22867: cperl-mode: Commit d0ad6306 suppresses fontification of hash/array declarations Stefan Kangas
2020-09-01 19:44     ` Harald Jörg
2020-09-04  3:46       ` Lars Ingebrigtsen
2020-09-04 16:04         ` Harald Jörg
2020-09-05 12:37           ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=793881bc-c77d-8ddd-61b2-d20d94107eed@posteo.de \
    --to=haj@posteo.de \
    --cc=22867@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.