From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: view/edit large files Date: Fri, 06 Feb 2009 15:06:17 -0600 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <86k583p96e.fsf@lifelogs.com> References: <86fxiuw6u7.fsf@lifelogs.com> <86zlgzqudo.fsf_-_@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1233954327 15568 80.91.229.12 (6 Feb 2009 21:05:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Feb 2009 21:05:27 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 06 22:06:42 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LVXuB-00023w-34 for ged-emacs-devel@m.gmane.org; Fri, 06 Feb 2009 22:06:31 +0100 Original-Received: from localhost ([127.0.0.1]:58508 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVXss-0005La-1K for ged-emacs-devel@m.gmane.org; Fri, 06 Feb 2009 16:05:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LVXsY-0005FL-6l for emacs-devel@gnu.org; Fri, 06 Feb 2009 16:04:50 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LVXsW-0005EZ-Hw for emacs-devel@gnu.org; Fri, 06 Feb 2009 16:04:49 -0500 Original-Received: from [199.232.76.173] (port=44482 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVXsW-0005ES-Cd for emacs-devel@gnu.org; Fri, 06 Feb 2009 16:04:48 -0500 Original-Received: from main.gmane.org ([80.91.229.2]:51395 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LVXsV-0007Ji-KR for emacs-devel@gnu.org; Fri, 06 Feb 2009 16:04:48 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LVXsQ-0007wO-GL for emacs-devel@gnu.org; Fri, 06 Feb 2009 21:04:42 +0000 Original-Received: from 38.98.147.130 ([38.98.147.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 06 Feb 2009 21:04:42 +0000 Original-Received: from tzz by 38.98.147.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 06 Feb 2009 21:04:42 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 45 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 38.98.147.130 X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:1trJiKrEVjvc2G3WJa5spPeyw5M= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:108836 Archived-At: On Fri, 6 Feb 2009 14:20:45 +0100 Mathias Dahl wrote: MD> This is how far I got: MD> http://www.emacswiki.org/emacs/vlf.el Thank you, I looked at it and it's almost exactly what I was thinking originally (but actually implemented :). I would like it, however, to be a minor mode rather than a major one so it's more generally useful. Also writing modifications back is an interesting challenge. MD> What I do know is that it hits the roof when the file is larger than MD> that integer limit in Emacs, whatever it is. Modifying insert-file-contents to take float or list arguments to specify the file position should not be too hard--I assume that's the place where it fails. Using floats bothers me a bit. I'd really like the offet to be a pair of integers, similar to the time storage in Emacs. I also got these comments from Chetan Pandya that I wanted to answer here: CP> Is this for editing binary files or file with single byte encoding? CP> If not, it gets more complicated. It must be single-byte or binary. insert-file-contents doesn't handle multibyte encodings and Emacs doesn't have a way to ensure a random seek is to a valid sequence. I believe this is all fixable, but I don't know enough about multibyte encodings to be helpful. CP> Is this to be the major mode for the file? In that case it may be CP> OK. Otherwise it wrecks the font lock information and functions that CP> work with sexp and such syntactic information. I think as a major mode it's not very useful. You can use `more' or `less' from the shell to view a large file in a pager. hexl-mode would be a good major mode for large files, for example. I don't think the font-lock information is very useful for large files over multiple lines. The most common case (viewing logs) just needs to examine a single line. Can you think of large files that have sexps and other multiline (over 1000 lines) font-lockable data, which Emacs should handle? I can't think of any common ones. In any case, at worst the user will fall back to fundamental-mode, and that's better than nothing. Ted