From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.help Subject: Re: Stream-based Scanning of File-Buffers Date: Fri, 25 Sep 2009 14:55:34 +0200 Message-ID: References: <5f0abd5c-159d-4d59-bd13-62eb178c7633@g6g2000vbr.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1253883421 7908 80.91.229.12 (25 Sep 2009 12:57:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Sep 2009 12:57:01 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?UTF-8?B?Tm9yZGzDtnc=?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 25 14:56:54 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MrAM2-0003ki-BL for geh-help-gnu-emacs@m.gmane.org; Fri, 25 Sep 2009 14:56:54 +0200 Original-Received: from localhost ([127.0.0.1]:34053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrALz-0003o2-Fr for geh-help-gnu-emacs@m.gmane.org; Fri, 25 Sep 2009 08:56:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MrALC-0003nd-EQ for help-gnu-emacs@gnu.org; Fri, 25 Sep 2009 08:56:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MrAL6-0003mk-Mg for help-gnu-emacs@gnu.org; Fri, 25 Sep 2009 08:56:01 -0400 Original-Received: from [199.232.76.173] (port=51214 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrAL6-0003mh-6J for help-gnu-emacs@gnu.org; Fri, 25 Sep 2009 08:55:56 -0400 Original-Received: from mail-bw0-f220.google.com ([209.85.218.220]:32814) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MrAL5-0006I2-P9 for help-gnu-emacs@gnu.org; Fri, 25 Sep 2009 08:55:55 -0400 Original-Received: by bwz20 with SMTP id 20so2151907bwz.42 for ; Fri, 25 Sep 2009 05:55:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=rn4yCsl7Y2JENsnNTvIBSYFNZWG+WF0o4V/PHGJ+nsE=; b=eow5nPEQ2Ub8CYpA8OOXk/A+QFcIUhQtRyIKDhljN+kOIGtRkklG9pENPBwjydX/0e L7YB2n9uu0Q7pgkEe0sbEmcndxxWzUskhiDd6BuevywZssskS+GCoKk5vO4AO9jbCdIx NjqZcUR40x1m0aiN9Vewr0GsKkiYjAPD+xhvI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=EBPP/ERxldgZKTELjrsCjLfAQ9WfW2yf9tG7Z8cXfjjX4UDQ5SW5vr0cKq6cRnW707 4qulxgs/qpbcwBWO8jykPhk2pcvSYfPfv6k/gBKQaws28bOG4j8zFnHsPAhBG4/HxNkg qSORrDsArTpvmofTWqMuEzQ1KXsAcZixqpShk= Original-Received: by 10.239.139.148 with SMTP id t20mr9336hbt.93.1253883354119; Fri, 25 Sep 2009 05:55:54 -0700 (PDT) In-Reply-To: <5f0abd5c-159d-4d59-bd13-62eb178c7633@g6g2000vbr.googlegroups.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:68470 Archived-At: On Fri, Sep 25, 2009 at 14:12, Nordl=C3=B6w 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. You can use `insert-file-contents' to implement something like that; presumably, the only tricky part is taking care of matches across block boundaries. Juanma