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 21:51:29 +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 1131656142 27682 80.91.229.2 (10 Nov 2005 20:55:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 10 Nov 2005 20:55:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 10 21:55:40 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EaJS3-0000n6-Sc for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Nov 2005 21:55:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EaJS3-0002V3-BO for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Nov 2005 15:55:19 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 23 Original-X-Trace: news.dfncis.de KOu0nT95QU9Pxz6PnazVCAAwnTlAOR1zR2cRNu67DrPX6x User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:SxRU6Zul2Ycq3wOv0PhbB/8KYDU= Original-Xref: shelby.stanford.edu gnu.emacs.help:135376 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:30970 Archived-At: Pascal Bourguignon writes: > Roland Winkler writes: > >> The function forward-sexp requires a buffer. Is there something >> similar for parsing strings? Of course, I can always use >> with-temp-buffer. > > (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. Thanks! Roland