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

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

Re: How to break out of an emacs lisp loop ?


From: Jason
Subject: Re: How to break out of an emacs lisp loop ?
Date: Wed, 24 Oct 2007 12:59:27 -0700
User-agent: G2/1.0

On Oct 23, 1:10 pm, address@hidden wrote:
> On Oct 23, 11:29 am, address@hidden wrote:
>
> > (while (not (forward-char))
> >     (if (looking-at "a") break )
>
> > When I run this sexp, I get error at break. So break is wrong syntax.

(progn
  (insert "\nbefore")
  (do ((i 0 (+ i 1)))
      ((> i 10) (insert "\ndone"))
    (progn
      (insert "\n")
      (insert (int-to-string i))
      (if (> i 5)
          (return i))))
  (insert "\nafter"))

-Jason



reply via email to

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