From: Daniel Finster
Subject: IF indentation styles
Date: 
Message-ID: <3jnamh$ocj@utic.unicomp.net>
Zmacs (as probably all of you know) indents IF statements to look
like:

  (IF (TEST-FORM)
      (THEN-FORM)
      (ELSE-FORM))

And this indentation style can be seen in all the older Lisp code I
see as well.  But GNU Emacs, contrary to other code I see, likes to
indent IF statements to look like:

  (IF (TEST-FORM)
      (THEN-FORM)
    (ELSE-FORM))

I was wondering where GNUEMA got this style from?  And why?

From: Barry Margolin
Subject: Re: IF indentation styles
Date: 
Message-ID: <3joue7$eo5@tools.near.net>
In article <··········@utic.unicomp.net> ···@utic.unicomp.net (Daniel Finster) writes:
>But GNU Emacs, contrary to other code I see, likes to
>indent IF statements to look like:
>
>  (IF (TEST-FORM)
>      (THEN-FORM)
>    (ELSE-FORM))

GNU Emacs Lisp allows the else-clause to be an implicit PROGN, e.g.

(if (test-form)
    (then-form)
  (else-form-1)
  (else-form-2)
  ...
  (else-form-N))

In this case, it's useful for all the else-forms to be set off from the
then-form.
-- 
Barry Margolin
BBN Internet Services Corp.
······@near.net
From: Kevin Rodgers
Subject: Re: IF indentation styles
Date: 
Message-ID: <3k2hii$m0e@firewall.ihs.com>
Barry Margolin (······@nic.near.net) wrote:
>GNU Emacs Lisp allows the else-clause to be an implicit PROGN, e.g.
>
>(if (test-form)
>    (then-form)
>  (else-form-1)
>  (else-form-2)
>  ...
>  (else-form-N))

If you use an explicit PROGN, the else-forms coincidentally line up
under the then-form:

(if test-form
    then-form
  (progn
    else-form-1
    ...
    else-form-N))
-- 
Kevin Rodgers <·············@ihs.com>   Project Engineer
Information Handling Services           Electronic Systems Development
15 Inverness Way East, M/S A203         GO BUFFS!
Englewood CO 80112 USA                  1+ (303) 397-2807[voice]/-2779[fax]
From: Pete Halverson
Subject: Re: IF indentation styles
Date: 
Message-ID: <pch-1303950915110001@198.3.157.142>
In article <··········@utic.unicomp.net>, ···@utic.unicomp.net (Daniel
Finster) wrote:
> Zmacs (as probably all of you know) indents IF statements to look
> like:
> 
>   (IF (TEST-FORM)
>       (THEN-FORM)
>       (ELSE-FORM))
> 
> And this indentation style can be seen in all the older Lisp code I
> see as well.  But GNU Emacs, contrary to other code I see, likes to
> indent IF statements to look like:
> 
>   (IF (TEST-FORM)
>       (THEN-FORM)
>     (ELSE-FORM))
> 
> I was wondering where GNUEMA got this style from?  And why?

Because the E-Lisp syntax is actually

     (if (TEST-FORM)
         (THEN-FORM)
       (ELSE-FORM-1)
       (ELSE-FORM-2)
       ...)

the "else" clause actually being an implicit PROGN of everything after the
"then" clause.   Hence the non-uncommon E-Lisp idiom for WHEN as

    (if (not x)
        nil
      do
      lots
      of
      things)

ZetaLisp also had this "extended-else" syntax (how does Zmacs indent ZL:IF
?), and probably other older Lisp variants as well. 

pch