Subject: Re: bug#18380: 24.3.93; sh-script multiline quoted subshell wreaks havoc with indentation
From: Stefan Kangas <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: [email-masked], Carlos Pita <[email-masked]>, [email-masked]
Date: Mon, 30 Sep 2019 04:54:33 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Stefan Monnier <[email-masked]> writes:

>> This will see the { as quoted:
>> "$(echo  "{")"
>>
>> while this will not:
>>
>> "$(echo
>>    "{")"
>
> Actually, it depends: sometimes it will sometimes it won't :-(
>
>> after this line indentation is broken as Emacs thinks there is an
>> unclosed open brace.
>>
>> The problem with multiline quoted subshells is more general, as
>> remarked by this comment in sh-script.el:
>>
>>   ;; FIXME: This can (and often does) match multiple lines, yet it makes no
>>   ;; effort to handle multiline cases correctly, so it ends up being
>>   ;; rather flaky.
>
> Indeed, the problem you show is the direct result of the problem alluded
> to in the above comment.  I installed the patch below which seems to help.

I can't reproduce the original problem on current master.

Since there also has been no further updates here in 5 years, I'm going
to close this bug report.  If any of this is still an issue, please
reopen the bug report.

Best regards,
Stefan Kangas