From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: gnuist006@gmail.com Newsgroups: gmane.emacs.help Subject: How to break out of an emacs lisp loop ? Date: Tue, 23 Oct 2007 18:29:00 -0000 Organization: http://groups.google.com Message-ID: <1193164140.500795.322030@t8g2000prg.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: ger.gmane.org 1193164942 2124 80.91.229.12 (23 Oct 2007 18:42:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 23 Oct 2007 18:42:22 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 23 20:42:23 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IkOhe-0006sn-W1 for geh-help-gnu-emacs@m.gmane.org; Tue, 23 Oct 2007 20:42:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IkOhW-0000Zp-Tg for geh-help-gnu-emacs@m.gmane.org; Tue, 23 Oct 2007 14:42:02 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!t8g2000prg.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 19 Original-NNTP-Posting-Host: 75.28.129.58 Original-X-Trace: posting.google.com 1193164144 11915 127.0.0.1 (23 Oct 2007 18:29:04 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 23 Oct 2007 18:29:04 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.8) Gecko/20071008 Firefox/2.0.0.8,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: t8g2000prg.googlegroups.com; posting-host=75.28.129.58; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Original-Xref: shelby.stanford.edu gnu.emacs.help:153242 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:48729 Archived-At: (while (not (forward-char)) (if (looking-at "a") break ) When I run this sexp, I get error at break. So break is wrong syntax. But this is the way many C loops are written. while ((c=(getchar()) != EOF){ if (c=='a') break; } as in compilable running file: #include main(){ int c; while ((c=getchar()) != EOF){ if (c=='a') break; } } So how do I break out of a loop in lisp ?