[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reading from a buffer
From: |
Stefan Monnier |
Subject: |
Re: Reading from a buffer |
Date: |
Wed, 01 Jul 2020 17:10:31 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> The function 'buffer-substring-no-properties' is certainly a step in the
> right direction, thank you. I've now got it down to:
> (setq count (car (read-from-string (buffer-substring-no-properties (mark)
> (point)))))
> But I'm nothing short of astonished that there is not yet anything in
> standard Emacs Lisp that is comparable to a formatted read-from-buffer
> statement in a more conventional programming language like Fortran or C.
> I'm imagining something akin to '(insert (format...' but working in the
> opposite direction, something like '(unformat (read...'. Perhaps I'll just
> create my own library of intuitive and easy-to-use buffer I/O functions
> since I expect to be doing quite a bit of this sort of thing in the future.
Maybe you're looking for:
looking-at or re-search-forward
followed by
match-string
?
Stefan