From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.help Subject: Re: Reading huge files Date: Thu, 11 Jan 2007 10:49:10 +0100 Message-ID: References: <8642ba650701081417n3c658d33v6dbf743a9bd30c7c@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1168512087 3793 80.91.229.12 (11 Jan 2007 10:41:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 11 Jan 2007 10:41:27 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 11 11:41:25 2007 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 1H4xMy-0007Q6-Vs for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Jan 2007 11:41:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H4xMy-0008Dy-GR for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Jan 2007 05:41:16 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 50 Original-X-Trace: individual.net qWPWjb7tPsHTovHd9uyZ9w1iiNZdcNxQHbEqjL2GuPCazTgngY User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (windows-nt) Cancel-Lock: sha1:zINtCjtySUB0kODHXQb1Kx5uo5s= Original-Xref: shelby.stanford.edu gnu.emacs.help:144630 Original-To: help-gnu-emacs@gnu.org 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:40235 Archived-At: Stefan Monnier writes: > You'll indeed need something like that. I'd recommend to use `dd' > rather than `split' or `head&tail'. Thanks for the hint, I will take a look at that. > But note that the problem is bigger than you think: the above will > need to work with floating-point arguments (since fixnums suffer > from the 2^28 limit) and the %d format also suffers from the 2^28 > limit (or 2^31 in Emacs-CVS). After I read Eli's comment about the integer problem I added back the head-tail version into the code (configurable) and then I started to notice problemd with integers in various places, so I started to look into using float, which solved some problems (I am using %.0f instead of %d now in the call to `format', for example). There still seems to be some problems though. > That's another good reason to use > `dd' since you can use a 1048576 block size and thus divide your > large floats by 1048576 before turning them into fixnums. Umm, okay... (I did not understand half of that, but I probably will after looking into it.. :) > Please just use > > (defvar vlf-mode-map > (let ((map (make-sparse-keymap))) > (define-key map [next] 'vlf-next) > (define-key map [prior] 'vlf-prev) > (define-key map "q" 'vlf-quit) > map) > "Keymap for `vlf-mode'.") Ah, of course! :) The reason I do that is that when testing and adding key bindings, I cannot simply reevaluate that defvar (because it won't "bite"), so I use a function to set the map instead and then I can reevaluate a call to this function. > Also, wrt features, it'd probably be good to "slide more smoothly": > e.g. always keep 2 or 3 blocks in the buffer at the same time so you > can comfortably look at the text at the boundaries between blocks. > Next step: use window-scroll-functions or jit-lock to detect when > reaching one of the ends so that we can automatically load in the > next consecutive block. Aaargh, all these feature-requests make me crazy! :)