[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

view/edit large files (was: map-file-lines)

From: Ted Zlatanov
Subject: view/edit large files (was: map-file-lines)
Date: Fri, 06 Feb 2009 12:42:59 -0600
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

On Thu, 05 Feb 2009 00:40:40 -0500 Richard M Stallman <address@hidden> wrote: 

RMS> The main point of my message is the UI proposal.  You're right that
RMS> it's good to use byte offsets.  I had not thought about that, but it
RMS> could be done by specifying the -b option for grep.

RMS> I proposed a specific UI for specifying which part of the file to
RMS> edit, one I think will be convenient.

Could you please explain, with code or text, what using your UI would
look like?  I looked over your suggestions and I still think we have the
same idea, just expressed differently.  You do seem to want `grep'
instead of dynamic offsets, but see my comments later.

Here's the "window"[1] API I'm suggesting, as a detailed list of TODO

1) a buffer-local set of offset variables that indicate the beginning
and the end of the current window into the file.

2) override all write-file functions to write the buffer at the starting
offset.  I don't think there's a write-file-contents analogous to

3) override all insert-file* functions to respect the offsets as well

3) disable insertion, always in overwrite mode for better performance
(maybe allow insert at end of file...).  Force save when the "window" is

4) "window" management functions: set/get-window-offset,
set/get-window-length, etc.  These operate on the (1) buffer-local

As you can see, it requires no grep calls to pre-scan the file, and
should be consistent with the existing Emacs code.  Pre-scanning a large
file with grep can be very expensive, and it's inaccurate if the large
file is growing (e.g. a log file).

Thanks to anyone with suggestions...


[1] I still can't think of a better term than "window."
large-file-window is too verbose.  boffset?  byte-offset?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]