From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Roland Winkler Newsgroups: gmane.emacs.help Subject: Re: forward-sexp for strings Date: Thu, 10 Nov 2005 22:16:57 +0100 Organization: FAU Erlangen-Nuernberg Message-ID: References: <87k6fg1ddq.fsf@thalassa.informatimago.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1131657779 418 80.91.229.2 (10 Nov 2005 21:22:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 10 Nov 2005 21:22:59 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 10 22:22:50 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EaJr6-0000SL-0j for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Nov 2005 22:21:12 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EaJr5-0003x5-EV for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Nov 2005 16:21:11 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news1.google.com!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 22 Original-X-Trace: news.dfncis.de B2FskxjqP7K3SjggzJaLpQL56E8teLGG+JcAYF8SHNRC4B User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:Kfog6JpK91rE4K/m1WAJhVG/b/w= Original-Xref: shelby.stanford.edu gnu.emacs.help:135379 Original-To: help-gnu-emacs@gnu.org 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:30973 Archived-At: Henrik Enberg writes: >>> (require 'cl) >>> (loop with s = "(sexp 1) (sexp 2) \"sexp 3\" sexp-4" >>> with e = 0 >>> for oe = (read-from-string s e) >>> do (print (car oe)) >>> while (< (setf e (cdr oe)) (length s))) > >> Do I need here the (require 'cl)? It seems to me that >> read-from-string is really the important thing in your example. And >> if this function obeys the current syntax-table (the doc string >> doesn't say anything about that) it should be exactly what I am >> looking for. > > the `loop' macro is defined in cl.el, so you'll need it. Personally, > I'd just use with-temp-buffer. It's far more straightforward. If I strictly implement the above example, I'll need cl.el. But it seems to me that `while' can do the job, too. (Haven't tried yet what I want to do with this.) Roland