[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs-30 1fd7957bc72: ; cperl-mode.el: Add a test for Bug#74245
From: |
Harald Jörg |
Subject: |
Re: emacs-30 1fd7957bc72: ; cperl-mode.el: Add a test for Bug#74245 |
Date: |
Tue, 14 Jan 2025 15:10:10 +0000 |
Peter Oliver <p.d.oliver@mavit.org.uk> writes:
> On Tue, 14 Jan 2025, Harald Jörg wrote:
>
>> Michael Albinus <michael.albinus@gmx.de> writes:
>>
>>> This breaks perl-mode-tests:
>>
>> Ouch, thanks. The test is not supposed to be run with perl-mode.
>> I failed to check that. Fixed!
>
> Since the bug is still present in perl-mode, is the following better?
>
> :expected-result (if (eq cperl-test-mode #'perl-mode) :failed :passed)
I'd rather not do that, for several reasons.
In the general case, having a common set of tests for both perl modes
makes sense, but indentation is a special beast. perl-mode and
cperl-mode have different default settings, so without explicit
specification of the settings, both modes will give different results,
both correct within their defaults. Many indentation tests are
therefore restricted run under to cperl-mode only.
Also, the test explicitly invokes cperl-indent-command, which is not
supposed to be used in perl-mode.
perl-mode indeed has the same bug, and it apparently sneaked in when
support for subroutine signatures was added (Bug#26037, commit
a184a7edc58e). Someone could try to fix this, but the fix would be
different from what has been done in cperl-mode. As has been said
elsewhere, maintaining two different modes for Perl is not very
rewarding in the long run.
Additional note: Perl code run through perltidy will not show this bug
in neither mode: perltidy inserts a space around items in a parameter
list, so "($first, $)" is reformatted to "( $first, $ )", eliminating
the toxic "$)".
--
Cheers,
haj