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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23461: perl-mode: Displaying HERE-docs as strings instead of comment


From: Harald Jörg
Subject: bug#23461: perl-mode: Displaying HERE-docs as strings instead of comments [PATCH]
Date: Tue, 05 Jan 2021 00:43:55 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

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

Attachment: 0001-perl-mode-Display-here-docs-as-strings-instead-of-co.patch
Description: perl-mode: Display HERE-docs with their own face


reply via email to

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