From: Ted Zlatanov <tzz@lifelogs.com>
To: emacs-devel@gnu.org
Subject: Re: docs for insert-file-contents use 'bytes'
Date: Fri, 03 Oct 2008 08:55:40 -0500 [thread overview]
Message-ID: <864p3t236r.fsf@lifelogs.com> (raw)
In-Reply-To: jwvskreomn6.fsf-monnier+emacs@gnu.org
On Thu, 02 Oct 2008 14:55:10 -0400 Stefan Monnier <monnier@IRO.UMontreal.CA> wrote:
KH> How about reading a file in a unibyte buffer with
KH> no-conversion, and decode one page by one into a view
KH> buffer. Except for UTF-16 encoding, it is safe to set the
KH> decoding boundary at newline positions.
>> That could work, but I'd have to grab more than one page every time, so
>> the math could get tricky. I'll have to play with this when it comes up
>> on my TODO list :)
SM> I'm not sure why you'd need such trick anyway. Supposedly when you need
SM> to read a new chunk, it's because the user bumped into the end of the
SM> previous chunk, so you've read the previous chunk and from that read you
SM> should be able to compute the byte-position of the last
SM> complete character.
SM> If that doesn't work in some cases (e.g. because the encoding has state
SM> so you can't just start reading from the byte position of the last
SM> complete char), maybe insert-file-contents should return a "decoder
SM> state" object when can then be passed back in.
You're right, usually the user will ask for sequential access to large
files so these optimizations should work.
It needs to be as fast as possible regardless, because searching through
large amounts of data is painful (especially if the search fails) and I
expect searching to be one of the most common needs when viewing large
files.
Editing is another really nasty problem, of course, so I plan to make
the mode read-only at first.
Ted
next prev parent reply other threads:[~2008-10-03 13:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-29 19:58 docs for insert-file-contents use 'bytes' Ted Zlatanov
2008-09-29 20:12 ` Eli Zaretskii
2008-09-29 21:04 ` Ted Zlatanov
2008-09-30 6:06 ` Miles Bader
2008-09-30 7:19 ` Eli Zaretskii
2008-09-30 13:48 ` Ted Zlatanov
2008-09-30 15:58 ` Stefan Monnier
2008-09-30 16:29 ` Eli Zaretskii
2008-10-01 0:44 ` Kenichi Handa
2008-10-01 16:54 ` Ted Zlatanov
2008-10-02 1:33 ` Kenichi Handa
2008-10-02 13:42 ` Ted Zlatanov
2008-10-02 18:55 ` Stefan Monnier
2008-10-03 13:55 ` Ted Zlatanov [this message]
2008-10-02 1:58 ` Kenichi Handa
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=864p3t236r.fsf@lifelogs.com \
--to=tzz@lifelogs.com \
--cc=emacs-devel@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.