GNU bug report logs - #35925
perl-mode wrecks formats

Previous Next

Package: emacs;

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

Date: Mon, 27 May 2019 13:59:02 UTC

Severity: minor

Tags: patch

Fixed in version 30.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35925 in the body.
You can then email your comments to 35925 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#35925; Package emacs. (Mon, 27 May 2019 13:59:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 27 May 2019 13:59:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <at> gnu.org
Subject: perl-mode wrecks formats
Date: Mon, 27 May 2019 21:11:05 +0800
In perl-mode,

format FH =
@<< @# @<< @### @<<<<< @# @<<<< @#
(split)[0..5, 7..8]
.
write FH;

becomes

format FH =
    @<< @# @<< @### @<<<<< @# @<<<< @#
    (split)[0..5, 7..8]
    .
    write FH;

wrecking output indentation and even introducing a syntax error on the "." line.

(See man perlform.)

Seen with C-x h TAB, emacs-version "26.1".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35925; Package emacs. (Tue, 09 Jul 2019 02:12:01 GMT) Full text and rfc822 format available.

Message #8 received at 35925 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 35925 <at> debbugs.gnu.org
Subject: Re: bug#35925: perl-mode wrecks formats
Date: Tue, 09 Jul 2019 04:11:30 +0200
積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:

> In perl-mode,
>
> format FH =
> @<< @# @<< @### @<<<<< @# @<<<< @#
> (split)[0..5, 7..8]
> .
> write FH;
>
> becomes
>
> format FH =
>     @<< @# @<< @### @<<<<< @# @<<<< @#
>     (split)[0..5, 7..8]
>     .
>     write FH;
>
> wrecking output indentation and even introducing a syntax error on the "." line.

Does this work better for you in cperl-mode?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35925; Package emacs. (Tue, 09 Jul 2019 10:23:02 GMT) Full text and rfc822 format available.

Message #11 received at 35925 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 35925 <at> debbugs.gnu.org
Subject: Re: bug#35925: perl-mode wrecks formats
Date: Tue, 09 Jul 2019 17:06:12 +0800
>>>>> "LI" == Lars Ingebrigtsen <larsi <at> gnus.org> writes:
LI> Does this work better for you in cperl-mode?
OK it stays put in cperl-mode. So the bug is in perl-mode.
C-x h
TAB
to test.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35925; Package emacs. (Tue, 09 Jul 2019 12:09:02 GMT) Full text and rfc822 format available.

Message #14 received at 35925 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Cc: 35925 <at> debbugs.gnu.org
Subject: Re: bug#35925: perl-mode wrecks formats
Date: Tue, 09 Jul 2019 14:08:19 +0200
積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:

>>>>>> "LI" == Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> LI> Does this work better for you in cperl-mode?
> OK it stays put in cperl-mode. So the bug is in perl-mode.

Yes, and that should be fixed, but you've reported a series of edge case
bugs in perl-mode, and I wondered whether you knew that there's a
different Perl mode in Emacs that has none of the problems you're
experiencing.

(Why is there two Perl modes in Emacs, anyway?)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35925; Package emacs. (Tue, 09 Jul 2019 12:22:02 GMT) Full text and rfc822 format available.

Message #17 received at 35925 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 35925 <at> debbugs.gnu.org
Subject: Re: bug#35925: perl-mode wrecks formats
Date: Tue, 09 Jul 2019 20:18:53 +0800
I used to use cperl-mode but now I use perl-mode.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35925; Package emacs. (Tue, 09 Jul 2019 15:12:02 GMT) Full text and rfc822 format available.

Message #20 received at 35925 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 35925 <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: Re: bug#35925: perl-mode wrecks formats
Date: Tue, 09 Jul 2019 18:11:35 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Tue, 09 Jul 2019 14:08:19 +0200
> Cc: 35925 <at> debbugs.gnu.org
> 
> (Why is there two Perl modes in Emacs, anyway?)

You don't want to know. ;-)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35925; Package emacs. (Sat, 16 Sep 2023 23:04:02 GMT) Full text and rfc822 format available.

Message #23 received at 35925 <at> debbugs.gnu.org (full text, mbox):

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: 35925 <at> debbugs.gnu.org
Cc: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Subject: Re: bug#35925: perl-mode wrecks formats
Date: Sat, 16 Sep 2023 20:03:14 -0300
[Message part 1 (text/plain, inline)]
tags 35925 patch
quit


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

> In perl-mode,
>
> format FH =
> @<< @# @<< @### @<<<<< @# @<<<< @#
> (split)[0..5, 7..8]
> .
> write FH;
>
> becomes
>
> format FH =
>     @<< @# @<< @### @<<<<< @# @<<<< @#
>     (split)[0..5, 7..8]
>     .
>     write FH;
>
> wrecking output indentation and even introducing a syntax error on 
the "." line.
>
> (See man perlform.)
>
> Seen with C-x h TAB, emacs-version "26.1".

AFAICS, perl-mode doesn't recognize a format declaration when indenting.
I attach a patch that adds a check, plus some tests.
[0001-Fix-indentation-in-perl-mode-Bug-35925.patch (text/x-patch, attachment)]

Added tag(s) patch. Request was from Mauro Aranda <maurooaranda <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 16 Sep 2023 23:04:02 GMT) Full text and rfc822 format available.

Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Sun, 01 Oct 2023 02:18:02 GMT) Full text and rfc822 format available.

Notification sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
bug acknowledged by developer. (Sun, 01 Oct 2023 02:18:02 GMT) Full text and rfc822 format available.

Message #30 received at 35925-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>,
 35925-done <at> debbugs.gnu.org
Subject: Re: bug#35925: perl-mode wrecks formats
Date: Sat, 30 Sep 2023 19:17:01 -0700
Version: 30.1

Mauro Aranda <maurooaranda <at> gmail.com> writes:

> 積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:
>
>> In perl-mode,
>>
>> format FH =
>> @<< @# @<< @### @<<<<< @# @<<<< @#
>> (split)[0..5, 7..8]
>> .
>> write FH;
>>
>> becomes
>>
>> format FH =
>>     @<< @# @<< @### @<<<<< @# @<<<< @#
>>     (split)[0..5, 7..8]
>>     .
>>     write FH;
>>
>> wrecking output indentation and even introducing a syntax error on the "."
>  line.
>>
>> (See man perlform.)
>>
>> Seen with C-x h TAB, emacs-version "26.1".
>
> AFAICS, perl-mode doesn't recognize a format declaration when indenting.
> I attach a patch that adds a check, plus some tests.

Thanks, installed on master.

[1: 7caa3f5499b]: 2023-10-01 04:13:17 +0200
  Fix indentation in perl-mode (Bug#35925)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=7caa3f5499b1ca4b6d66c1655a4e0d6903755679




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 29 Oct 2023 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 193 days ago.

Previous Next


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