help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to read a s-exp from a buffer?


From: Michael Heerdegen
Subject: Re: How to read a s-exp from a buffer?
Date: Thu, 25 Jun 2015 21:18:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Marcin Borkowski <mbork@mbork.pl> writes:

> So, I have an s-exp in the buffer, and I want to read it into
> a variable, where it will become an Elisp list.  How do I do that?

Fortunately the reader can be invoked from Lisp via `read', just use
your buffer as STREAM argument with point at the beginning of the sexp
to read, e.g.

  (setq my-expr (read (current-buffer)))

That's already it.


Michael.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]