GNU bug report logs - #50320
28.0.50; Recent changes cause functions in sh-script-mode to be indented incorrectly

Previous Next

Package: emacs;

Reported by: Diego <dieggsy <at> pm.me>

Date: Wed, 1 Sep 2021 15:27:02 UTC

Severity: normal

Found in version 28.0.50

Fixed in version 28.1

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

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 50320 in the body.
You can then email your comments to 50320 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#50320; Package emacs. (Wed, 01 Sep 2021 15:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Diego <dieggsy <at> pm.me>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 01 Sep 2021 15:27:02 GMT) Full text and rfc822 format available.

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

From: Diego <dieggsy <at> pm.me>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 28.0.50;
 Recent changes cause functions in sh-script-mode to be indented
 incorrectly
Date: Wed, 01 Sep 2021 04:15:12 +0000
I'm not quite sure when this behavior was introduced, but I suspect commits 4bb70549 or 6392bc37a may be responsible:

With emacs built from git on commit 03dcceeee if I have a function, say:

myecho () {
    echo "foo"
}

And I call M-x indent-region on it, it gets indented to:

myecho () {
echo "foo"
}

Which I don't think is the correct indentation for functions in shell scripts.

Diego




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50320; Package emacs. (Thu, 02 Sep 2021 06:17:01 GMT) Full text and rfc822 format available.

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

From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: 50320 <at> debbugs.gnu.org
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Diego <dieggsy <at> pm.me>
Subject: Re: bug#50320: 28.0.50; Recent changes cause functions in
 sh-script-mode to be indented incorrectly
Date: Thu, 02 Sep 2021 08:16:22 +0200
Diego via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs <at> gnu.org> writes:

> I'm not quite sure when this behavior was introduced, but I suspect
> commits 4bb70549 or 6392bc37a may be responsible:

Seems to be 6392bc37a; reverting it makes your test case pass again.

As things stand, I don't know enough about SMIE to understand what the
correct fix is.  A plain revert might be the best immediate action,
unless someone knowledgeable enough can reconcile my commit with Diego's
example.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50320; Package emacs. (Thu, 02 Sep 2021 06:46:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
Cc: Diego <dieggsy <at> pm.me>, 50320 <at> debbugs.gnu.org
Subject: Re: bug#50320: 28.0.50; Recent changes cause functions in
 sh-script-mode to be indented incorrectly
Date: Thu, 02 Sep 2021 08:44:54 +0200
Kévin Le Gouguec <kevin.legouguec <at> gmail.com> writes:

>> I'm not quite sure when this behavior was introduced, but I suspect
>> commits 4bb70549 or 6392bc37a may be responsible:
>
> Seems to be 6392bc37a; reverting it makes your test case pass again.

I've now reverted the change and added a test.

> As things stand, I don't know enough about SMIE to understand what the
> correct fix is.  A plain revert might be the best immediate action,
> unless someone knowledgeable enough can reconcile my commit with Diego's
> example.

My understanding of SMIE is ... pretty vague.  :-)

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




bug marked as fixed in version 28.1, send any further explanations to 50320 <at> debbugs.gnu.org and Diego <dieggsy <at> pm.me> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 02 Sep 2021 06:46:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50320; Package emacs. (Thu, 02 Sep 2021 07:55:02 GMT) Full text and rfc822 format available.

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

From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Diego <dieggsy <at> pm.me>, 50320 <at> debbugs.gnu.org
Subject: Re: bug#50320: 28.0.50; Recent changes cause functions in
 sh-script-mode to be indented incorrectly
Date: Thu, 02 Sep 2021 09:54:05 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I've now reverted the change and added a test.

Thanks!

> My understanding of SMIE is ... pretty vague.  :-)

I'll push (info "(elisp) SMIE") to the top of the stack on my
nightstand, then :)




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 30 Sep 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 207 days ago.

Previous Next


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