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

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

Re: Shell-script mode indentation not hip to && and probably || too


From: Kevin Rodgers
Subject: Re: Shell-script mode indentation not hip to && and probably || too
Date: Thu, 06 Mar 2003 09:27:00 -0700
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Dan Jacobson wrote:

Well, there I was typing away in Shell-script[sh] mode, hitting tab
all the while to ensure proper indentation, when all the sudden, I
noticed that the lines after a && were not more indented, like it was
no big deal.
{
    for i in ${@?}
      do
      grep -i \\b$i\\b /usr/share/edict/enamdict &&
      at_least_one_found=1 &&
      echo =====
    done
} > $T.1


IMHO they should not be further indented, because the commands that make up a
compound command (joined by "&&" or "||") are at the same syntactic/structural
level (just like commands that form a pipeline joined by "|").

The thing that looks wrong to me above is that "do" is indented further than
"for ..." and "done".

--
<a href="mailto:&lt;kevin.rodgers&#64;ihs.com&gt;";>Kevin Rodgers</a>





reply via email to

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