[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: forward-sexp for strings
From: |
Roland Winkler |
Subject: |
Re: forward-sexp for strings |
Date: |
Thu, 10 Nov 2005 22:16:57 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Henrik Enberg <henrik.enberg@telia.com> 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