Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Viewing file in emacs that exceeds maximum buffer size

Is it possible to view part of the file at a time? BTW I am on 64-bit Ubuntu

like image 700
smuggledPancakes Avatar asked Nov 29 '10 18:11

smuggledPancakes


2 Answers

From comp.emacs:

You can load only part of a file with: insert-file-contents-literally and: insert-file-contents

and you can save part of a buffer with: append-to-file and: write-region

You can pass an integer seek position to write-region for the append parameter to update a record in the middle of the file.

You may be able to install a 64-bit Emacs package (or build one yourself) to up the buffer size limit to about a million terrabytes.

like image 139
nmichaels Avatar answered Nov 13 '22 07:11

nmichaels


Not really, no. See VLF and EmacsFileSizeLimit for discussion.

Not to be a wise-guy, but perhaps you should think about if looking at a giant file in an editor is really what you want to do. Can you get whatever you want done using grep (perhaps with additional context lines) or sed if it's a one time thing, or a simple script if you are going to be do it over and over?

like image 26
scottfrazer Avatar answered Nov 13 '22 07:11

scottfrazer