From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vitalie Spinu Newsgroups: gmane.emacs.devel Subject: Re: feature request: view part of file Date: Sat, 19 Jan 2013 00:52:50 +0100 Organization: EUR Message-ID: <8738xykq0d.fsf@gmail.com> References: <87lijrszn0.fsf@gnu.org> <87y5npeg4p.fsf@gnu.org> <877gnakr1d.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1358553186 26346 80.91.229.3 (18 Jan 2013 23:53:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Jan 2013 23:53:06 +0000 (UTC) Cc: emacs-devel@gnu.org To: sds@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 19 00:53:24 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TwLkQ-0000GJ-Sg for ged-emacs-devel@m.gmane.org; Sat, 19 Jan 2013 00:53:23 +0100 Original-Received: from localhost ([::1]:52168 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwLkA-0008FI-6r for ged-emacs-devel@m.gmane.org; Fri, 18 Jan 2013 18:53:06 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwLk5-0008Ex-3Q for emacs-devel@gnu.org; Fri, 18 Jan 2013 18:53:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TwLk2-0002cu-MW for emacs-devel@gnu.org; Fri, 18 Jan 2013 18:53:01 -0500 Original-Received: from mail-wi0-f171.google.com ([209.85.212.171]:52620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwLjy-0002c3-Jw; Fri, 18 Jan 2013 18:52:54 -0500 Original-Received: by mail-wi0-f171.google.com with SMTP id hn14so5646854wib.4 for ; Fri, 18 Jan 2013 15:52:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=m+7xePMQhHJzfu4V5GgfRLmRrF/Soqj009j8wOf1Xek=; b=uKjurOsp2kAYrzHQxjUuDNvTOQ9DzedNgEU9lZ362+U/oGAWs1FB8qpGkSeQ0Dq+r+ u3+t5/NfZWnYr7NMIwDdJUHMcvzRCMXzfi5HX/8IZbR285WKSFQ//w1AI34Hrx8pdnKV VXi1bAEkzywx7aMGj5wSy5LJcw0sUrfgKhMt7hv1sW04OOaWJjTPSmVWKh7wlkQddqss KU0NQtX45JuBnMLkOifY621x3iejss4TNMWoa/72C7JNcMqRQt0YNOeU6ZWnHReLjEPD zvrKvMe0jGL0qUSaNnbzJbvpH06HIJiJLdA32eqJJgEOHqGt3zFKCy/B9QJ2X9kIoqWl 6iDg== X-Received: by 10.180.88.138 with SMTP id bg10mr6096779wib.13.1358553173691; Fri, 18 Jan 2013 15:52:53 -0800 (PST) Original-Received: from localhost (i108036.upc-i.chello.nl. [62.195.108.36]) by mx.google.com with ESMTPS id l5sm6276068wia.10.2013.01.18.15.52.52 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Jan 2013 15:52:52 -0800 (PST) In-Reply-To: <877gnakr1d.fsf@gmail.com> (Vitalie Spinu's message of "Sat, 19 Jan 2013 00:30:38 +0100") User-Agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.2.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.212.171 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:156464 Archived-At: >> Vitalie Spinu >> on Sat, 19 Jan 2013 00:30:38 +0100 wrote: >> Sam Steingold >> on Thu, 14 Jun 2012 17:29:58 -0400 wrote: >> I put vlf.el by Mathias into elpa. I rewrote it almost completely >> (bzr still has the original version at revno 233). it works for me. VS> It doesn't work for me. vlf-next-batch pops: VS> Debugger entered--Lisp error: (wrong-type-argument file-offset 204= 8.0) VS> insert-file-contents("/home/vitoshka/test/foo.csv" nil 1024 2048= .0) VS> vlf-next-batch(nil) VS> call-interactively(vlf-next-batch nil nil) So it is really a bug in emacs, insert-file-contents accepts integer values only, but for big files the size and positions are floats. In my case 802200060.0.=20 It happens because vlf-file-size if float: =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80 #143 =E2=94=80 /home/vitoshka/Dropbox/ELPA/vlf-0.2/vlf.el =E2=94=80= =E2=94=80 =E2=94=82 vlf-file-size ((nth 7 (file-attributes file))) =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80 #143 =E2=94=80 and=20 =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80 #102 =E2=94=80 /home/vitoshka/Dropbox/ELPA/vlf-0.2/vlf.el =E2=94=80= =E2=94=80 =E2=94=82 (end (min vlf-file-size (+ vlf-end-pos vlf-batch-size)))) =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80 #102 =E2=94=80 returns float which is passed down to insert-file-contents. So I am stuck here, I just cannot technically access the last piece of my (700MB) file. Thanks,=20 Vitalie VS> Would be nice to actually write the batch into a local file and put t= he VS> buffer into the appropriate mode. So if the file is csv I view it in VS> csv-mode. Then get a special command to write the contents into the VS> original file. VS> The dired integration could be improved by making it pop into vlf mode VS> whenever the file exceeds some user specified size. VS> Vitalie >> I wish I knew how to hook it into files.el, but I don't... >> vlf.el has 2 issues: >> 1. insert-file-contents hangs emacs (see `vlf-next-batch'): >> ;; replacing `erase-buffer' with replace arg to `insert-file-contents' >> ;; hangs emacs >> (unless append (erase-buffer)) >> (insert-file-contents buffer-file-name nil vlf-end-pos end) >> 2. I have this: >> (define-key map [C-+] 'vlf-change-batch-size) >> When I do C-+ (by pressing Ctrl, Shift, and the "+=3D" key to the left= of >> backspace), I get "C-+ is undefined". >> when I do M-x vlf-change-batch-size RET, I get >> "You can run the command `vlf-change-batch-size' with " >> The "+" in both messages is the same character (43, #o53, #x2b).