From: Ted Zlatanov <tzz@lifelogs.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Stream-based Scanning of File-Buffers
Date: Fri, 25 Sep 2009 15:07:23 -0500 [thread overview]
Message-ID: <87y6o2kcuc.fsf@lifelogs.com> (raw)
In-Reply-To: mailman.7515.1253883365.2239.help-gnu-emacs@gnu.org
On Fri, 25 Sep 2009 14:55:34 +0200 Juanma Barranquero <lekktu@gmail.com> wrote:
JB> On Fri, Sep 25, 2009 at 14:12, Nordlöw <per.nordlow@gmail.com> wrote:
>> Is there a way to perform string/regexp scanning (using search-forward
>> or re-search-forward) in a file-buffer whose contents is loaded only
>> when it's needed, kind of like file streams in C, so that I only do a
>> physical read on the blocks that I actually scan and then skip the
>> rest of the file as soon as I get a hit.
JB> You can use `insert-file-contents' to implement something like that;
JB> presumably, the only tricky part is taking care of matches across
JB> block boundaries.
Unicode character boundaries are also a little nasty, since the offsets
for insert-file-contents are always byte-based. A good stream layer
would abstract all of that away, but I think it has to be at least
partly implemented at the C level to be efficient.
Ted
prev parent reply other threads:[~2009-09-25 20:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-25 12:12 Stream-based Scanning of File-Buffers Nordlöw
2009-09-25 12:55 ` Juanma Barranquero
2009-09-25 13:16 ` Pascal J. Bourguignon
[not found] ` <mailman.7515.1253883365.2239.help-gnu-emacs@gnu.org>
2009-09-25 20:07 ` Ted Zlatanov [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y6o2kcuc.fsf@lifelogs.com \
--to=tzz@lifelogs.com \
--cc=help-gnu-emacs@gnu.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.