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

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

Re: How to structure looking-at with error conditions


From: bolega
Subject: Re: How to structure looking-at with error conditions
Date: Wed, 24 Nov 2010 09:44:22 -0800 (PST)
User-agent: G2/1.0

Barry has explained quite well.

when and cond have different sets of parentheses also. The bare
structure is below :

(when test1 action1)

(cond (test1 action1) (test2 action2) (t default))

If each of the test is like this

(looking-at "regexp1")

then you have two adjacent parens in cond while no adjacent parens in
when.

Similarly, if your action is like this

(setq var1 "string1")

then you have to adjacent parens after "string1"

Hence, the indentation is best done while keeping two adjacent parens
together.

(cond () () ) is more general but not the most readable unless some of
these indentation rules are followed which dont occur in (when).

Bolega



reply via email to

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