GNU bug report logs - #23461
perl mode uses same color for comments and here documents

Previous Next

Package: emacs;

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

Date: Thu, 5 May 2016 21:05:02 UTC

Severity: wishlist

Tags: fixed

Fixed in version 28.1

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: haj <at> posteo.de (Harald Jörg)
To: 23461 <at> debbugs.gnu.org
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#23461: perl-mode: Displaying HERE-docs as strings instead of comments [PATCH]
Date: Tue, 05 Jan 2021 00:43:55 +0100
[Message part 1 (text/plain, inline)]
Stefan Monnier writes:

>> I have some doubts here regarding the effort and the side effects....
>
> No doubt.

:)

In the meantime I found that just ignoring the edge case of a lone "#"
at the end of a line starting HERE-docs breaks indentation after the
HERE-doc, so I no longer consider this as a valid option.

I just failed to get all cases covered when the HERE-doc starter is
moved to the next line.

So here's another attempt to show HERE-docs with their own face, treat
"normal" line-end comments correctly, and work around lines which end
with the comment starter.  It is a kludge, but maybe for such a rare
edge case a kludge is acceptable.

The trick: The lone "#" is now syntaxified as "whitespace" and
font-lock-faced as comment.  This is ugly, but also well-contained in
the offending line, so should not have unwanted effects at a distance.

The tests are designed for, and pass, for both Perl mode and CPerl mode.
-- 
Cheers,
haj

[0001-perl-mode-Display-here-docs-as-strings-instead-of-co.patch (text/x-diff, attachment)]

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

Previous Next


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