Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: What would you say is the most-used way of indenting case labels



On 8/11/06, Peter Stephenson <pws@xxxxxxx> wrote:
"Nikolai Weibull" wrote:
> That is, is this style:
>
> case something in
> (*ome*)
>   ... ;;
> esac
>
> more common than
>
> case something in
>   (*ome*)
>     ... ;;
> esac

I use Emacs sh-script mode and I end up with things looking like this

case foo in
  (bar)
  do_foo_bar
  ;;

  (rod)
  do_foo_rod
  ;;
esac

which is pretty much your second option, except there's no additional
indentation after the test and the separate ;; serves
as a visual end marker (like a "break" in C)

Hm, actually, my examples were a bit flawed.  It should have been:

case something in
 (*ome*)
   ...
 ;;
esac

But it seems that that kind of indenting is oncommon.  Argh, so many
choices, so little to gain.

The only consensus seems to be the "(bar)" test is indented from the
"case".

Actually, I found quite a few cases where "(bar)" wasn't indented from
the "case", so that's why I asked.



Messages sorted by: Reverse Date, Date, Thread, Author