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

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

bug#28962: A workaround to this issue is available in cperl-mode


From: Harald Jörg
Subject: bug#28962: A workaround to this issue is available in cperl-mode
Date: Thu, 27 Aug 2020 10:58:51 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

On 8/26/20 10:21 PM, Stefan Kangas wrote:
> Harald Jörg writes:
> 
>> The root cause is that within HERE documents and PODs there's no
>> syntax re-checking for every character inserted.
>>
>> To recover from such a situation, cperl-mode offers a
>> command `cperl-find-pods-heres', also available from the menu
>> 'Perl' -> 'Refresh "hard" constructions'.  A function which inserts
>> text in a POD or HERE document should call cperl-find-pods-heres
>> afterwards to avoid the issue.
> 
> Is that something we should work on improving, or does that mean that we
> should close this as wontfix?

After some more digging (my experience with elisp is still limited)
I found that the problem can be avoided by using `insert-and-inherit'
instead of `insert'.  cperl-mode uses text properties to detect the
HEREiness of buffer contents - and `insert' just doesn't provide them.

So, the problem only occurs when text is inserted via elisp code. It
can be avoided by using `insert-and-inherit', or, if one can't modify
the function, recovered from by calling `cperl-find-pods-heres'.  In
my eyes this is good enough.  It seems that the reporter wasn't aware
of either possibility, so maybe they're happy if we tell them about
the workarounds - and then close as wontfix.
-- 
Cheers,
haj








reply via email to

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