all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: bolega <gnuist006@gmail.com>
To: help-gnu-emacs@gnu.org
Cc: bolega <gnuist006@gmail.com>
Subject: Re: How to structure looking-at with error conditions
Date: Wed, 24 Nov 2010 09:44:22 -0800 (PST)	[thread overview]
Message-ID: <1c1892e2-2556-407f-b7c4-b81e895ca5c5@j18g2000yqd.googlegroups.com> (raw)
In-Reply-To: fe88468f-9fac-423b-baac-d39d1bd46f75@z9g2000yqz.googlegroups.com

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



      parent reply	other threads:[~2010-11-24 17:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fe88468f-9fac-423b-baac-d39d1bd46f75@z9g2000yqz.googlegroups.com>
2010-11-24 13:33 ` How to structure looking-at with error conditions Barry Margolin
2010-11-24 17:44 ` bolega [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1c1892e2-2556-407f-b7c4-b81e895ca5c5@j18g2000yqd.googlegroups.com \
    --to=gnuist006@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.