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

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

bug#55764: 29.0.50; sh-mode: Support mksh's alternate case brace syntax


From: Stefan Kangas
Subject: bug#55764: 29.0.50; sh-mode: Support mksh's alternate case brace syntax
Date: Sat, 30 Sep 2023 19:30:53 -0700

Visuwesh <visuweshm@gmail.com> writes:

> [வியாழன் ஜூன் 02, 2022] Lars Ingebrigtsen wrote:
>
>> Visuwesh <visuweshm@gmail.com> writes:
>>
>>> mksh and OpenBSD's ksh support an alternative case syntax for historical
>>> reasons [1],
>>>
>>>     case $i {
>>>     *pattern) do ;;
>>>     *pattern2) do2 ;;
>>>     }
>>>
>>> Currently, sh-mode cannot handle this and the easy way out of writing a
>>> semicolon after $i is out since,
>>>
>>>    % case "foo"; { *o) echo 1;; }
>>>    /bin/mksh: syntax error: unexpected ';'
>>>
>>> I came with the attached patch after a bit of trial and error but I'm
>>> not sure if it is the right way to do it.
>>
>> I think that might make sense, but perhaps Stefan has some comments here
>> (added to the CCs).
>
> To no one's surprise, the patch is not the right approach.  IIUC, when I
> use braces, *pattern) thingies are not recognised as "case-)" anymore so
> sh-indent-for-case-label does not get applied.  I tried a bit more but I
> only got it to respect the first line but still it is definitely not the
> right approach,

Did you make any further progress here?





reply via email to

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