unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Roland Winkler <winkler@tfkp07.physik.uni-erlangen.de>
Subject: Re: forward-sexp for strings
Date: Thu, 10 Nov 2005 21:51:29 +0100	[thread overview]
Message-ID: <m37jbg9qge.fsf@tfkp07.physik.uni-erlangen.de> (raw)
In-Reply-To: 87k6fg1ddq.fsf@thalassa.informatimago.com

Pascal Bourguignon <spam@mouse-potato.com> writes:
> Roland Winkler <roland.winkler@physik.uni-erlangen.de> 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

  reply	other threads:[~2005-11-10 20:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-10 18:43 forward-sexp for strings Roland Winkler
2005-11-10 20:01 ` Pascal Bourguignon
2005-11-10 20:51   ` Roland Winkler [this message]
2005-11-10 21:04     ` Henrik Enberg
     [not found]     ` <mailman.14777.1131656654.20277.help-gnu-emacs@gnu.org>
2005-11-10 21:16       ` Roland Winkler
2005-11-22 20:14   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m37jbg9qge.fsf@tfkp07.physik.uni-erlangen.de \
    --to=winkler@tfkp07.physik.uni-erlangen.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).