emacs & lisp question.

Romain Francoise romain at orebokech.com
Fri Nov 17 14:13:24 UTC 2006


Francisco Borges <f.borges at rug.nl> writes:

> Can anybody shed some light on it? How do I block multiple commands to
> run on a successful 'if'?

If you have no 'else' clause, use when:

(when cond
  (foo)
  (bar)
  (baz))

If you have both clauses, use progn to eval forms sequentially in the if
part, like this:

(if cond
    (progn
      (foo)   ; if
      (bar)   ; if
      (baz))  ; if
  (quux)      ; else
  (twap))     ; else

-- 
Romain Francoise <romain at orebokech.com> | The sea! the sea! the open
it's a miracle -- http://orebokech.com/ | sea! The blue, the fresh, the
                                        | ever free! --Bryan W. Procter





More information about the ubuntu-users mailing list