From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
Date: Tue, 09 Jan 2007 08:24:52 -0700
(defun view-large-file-contents (file beg end)
"View FILE contents from bytes BEG through END, in View mode."
(interactive "fView file: \nnFrom byte: \nnTo byte: ")
(switch-to-buffer
(generate-new-buffer (format "%s[%d,%d]"
(file-name-nondirectory file) beg end)))
(insert-file-contents file nil beg end)
(view-mode 1))
Does this really work? I think it won't: the underlying problem is
that for large files, END overflows the limits of the ELisp integer
type, and your suggestion doesn't resolve this fundamental problem.
So insert-file-contents will still barf with large files.
Or am I missing something?