Subject: bug#40076: 26.3; [shell script mode/bash] Wrong indentation for extended pattern "case" switches

From: Stefan Kangas <[email-masked]>
Date: Sun, 23 Aug 2020 08:34:14 -0400

severity 40076 minor
found 40076 28.0.50
tags 40076 + confirmed
thanks

Bruno Raoult <[email-masked]> writes:

> I have an issue with indentation of "case" switches containing extended patterns
> such as +(pattern-list). Same occurs with "emacs -Q".
>
> Below if an example of indentation I get:
> ========================================
> #!/bin/bash
> shopt -s extglob
>
> case $1 in
>     A)
>         echo indent OK. case 'A'
>         ;;
>     [a-z])
>         echo indent OK. Case '[a-z]'
>         ;;
>     +([1-9]))
>              echo indent NOK. Case '+([1-9])', extended pattern.
>              ;;
>              *)
>                  echo still NOK. Case '*', after extended pattern
>                  ;;
>              esac # still NOK
> ========================================

I can reproduce this on current master starting from "emacs -Q".

Best regards,
Stefan Kangas