# page-file(3)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

page-file - Load a large file in page mode.
page-bfile - Load a large binary file as binary data.
page-file-save-buffer - Save contents of a page mode buffer to file.
page-file-beginning-of-buffer - Move to the start of the paged file.
page-file-end-of-buffer - Move to the end of the paged file.
page-file-goto-byte - Page to the buffer byte offset.
page-file-goto-page - Move to page.
page-file-scroll-down - Scroll paged buffer down.
page-file-scroll-up - Scroll paged buffer up.
page-file-forward-line - Move forwards one line in paged buffer.
page-file-backward-line - Move backwards one line in paged buffer.
page-file-search-buffer - Search the buffer for the pattern.
page-file-search-forward - Search for a string in the forward direction.
page-file-search-backward - Search for a string in the backward direction.
page-file-isearch-forward - Search forward incrementally (interactive).
page-file-isearch-backward - Search backwards incrementally (interactive)

## SYNOPSIS

n page-file "file-name"
page-bfile file-name

page-file-save-buffer (C-x C-s)

page-file-beginning-of-buffer
page-file-end-of-buffer
page-file-goto-byte byte-offset
page-file-goto-page page-offset

n page-file-scroll-down (C-n)
n page-file-scroll-up (C-p)

n page-file-forward-line (C-n)
n page-file-backward-line (C-p)

page-file-search-buffer option pattern
page-file-search-forward (C-x s)
page-file-search-backward (C-x r)
page-file-isearch-forward (C-s)
page-file-isearch-backward (C-r)

## DESCRIPTION

The page-file commands allow large files, up to 2GB in size, to be viewed and edited. page-file operates by loading a small part (or page) of the file into a buffer for viewing and editing hence the whole file is not loaded into memory. The file may be viewed and edited while in a page mode, MicroEmacs automatically manages the page swapping and updates to the file.

While a file is being paged then a replacement set of commands are used to navigate through the buffer. These replacement commands automatically load the next page into the buffer, discarding or saving any edits from existing pages.

## File Loading

page-file finds the named file file-name. If it is already in a buffer, make that buffer active in the current window, otherwise attempt to create a new paged buffer and read the file into it. Syntax hilighting is available following any file loading. page-file is the paged equivalent of find-file(2).

The numeric argument n is used to modify the default behavior of the command, where the bits are defined as follows:

0x01

If the file does not exist and this bit is not set the command fails at this point.

0x02

If this bit is set the file will be loaded with binary(2m) mode enabled. See help on binary mode for more information on editing binary data files.

page-bfile loads a file as binary data, providing binary editing capabilities. The command operate as command page-file(3) except that it loads the given file with binary(2m) mode set.

## Saving

page-file-save-buffer saves the contents of the current buffer if the contents have been changed, writing the buffer back to the file it was read from. This command is the same as save-buffer(2) for a paged file.

## Navigation

page-file-beginning-of-buffer moves to the beginning of the buffer. If any edits have been performed at the current viewing position that need to be saved then the user is prompted to save the changes and the new pages are loaded from the file at the beginning of the buffer.

page-file-end-of-buffer moves to the end of the buffer in a similar way to page-file-beginning-of-buffer.

page-file-goto-byte advances the buffer to the byte offset specified by byte-offset. If any edits have been performed at the current viewing position that need to be saved then the user is prompted to save the changes and the new pages are loaded from the file at the specified file byte offset.

page-file-goto-page advances the buffer to the page offset specified by byte-offset. The behavior is the same as page-file-goto-byte.

page-file-scroll-up and page-file-scroll-down moves the window in the current buffer down by n lines, the default when n is omitted is 1 windows worth of lines i.e. a next page operation. The user is prompted to save changes if a file paging operation is performed.

page-file-forward-line moves the cursor down n lines, default 1. If the line is not on the current screen then display the next page and move to the line. Similarly page-file-backward-line moves the cursor up n lines, if the line is not on the current screen then display the previous page and move to the line. The user is prompted to save changes if a file paging operation is performed.

## Searching

page-file-searching-buffer is designed to be called from a macro and searches for a string in the buffer. The option specifies the search direction.

page-file-search-forward and page-file-search-backward searches for a string from the current cursor position to the end/start of the file and is simular to search-forward(2) and search-backward(2), respectively. If the search string is not found in the current buffer then the search continues by paging the file until the start/end of the file is reached. The user is prompted to save changes if a file paging operation is performed.

page-file-isearch-forward and page-file-isearch-backward perform and incremental forward and backward search in the paged file and are similar to isearch-forward(2) and isearch-backward(2), respectively. If the search string is not found in the current buffer then the search continues by paging the file until the start/end of the file is reached. The user is prompted to page and save changes if a file paging operation is performed.

## NOTES

The page-file macros are implemented in macro file `pagefile.emf`. The paging is managed in macro space and uses insert-file(2) to perform the read.

## SEE ALSO

binary(2m), find-bfile(3), find-file(2), isearch-backward(2), isearch-forward(2), save-buffer(2), search-backward(2), search-forward(2).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>