Path: utzoo!utgpu!water!watmath!clyde!burl!codas!ufcsv!gatech!udel!rochester!quiroz From: quiroz@cs.rochester.edu (Cesar Quiroz) Newsgroups: comp.emacs Subject: Re: Emulating TECO paging in EMACS Summary: Narrow to page? Message-ID: <5872@sol.ARPA> Date: 14 Jan 88 00:30:25 GMT References: <772@softg.UUCP> Reply-To: quiroz@ROCHESTER.UUCP (Cesar Quiroz) Organization: U of Rochester, CS Dept, Rochester, NY Lines: 33 Expires: Sender: Followup-To: From article <772@softg.UUCP> (dana@softg.UUCP (Eric Dana)): :Recently I have been working on a project to convert TOPS-20 :TECO macros to EMACS Lisp. One of the requirements is to read :(or yank) in a page of an input file at a time. Even though :EMACS (18.49) can handle paging in a buffer, I cannot find a :way to get the page from the input file into the buffer. :Can anyone help? Thanks in advance. There are no functions to deal with I/O directly (this is a `to do', of course). Perhaps the best approximation with the available functionality would be: 1- Read the whole file into a buffer, put point at the very beginning. 2- Narrow to the first page. Do not use narrow-to-page, but use the motion commands to find where the page ends. 3- On a Y, just change the restriction to the next page. 4- On A, narrow-to-page is no good. You have to compute the extent of the new restriction, and do the narrowing yourself. In this way your buffer is always restricted to a number of entire pages, just those TECO believed were in its buffer. No more 3K restrictions, of course... -- Cesar Augusto Quiroz Gonzalez Department of Computer Science ...allegra!rochester!quiroz University of Rochester or Rochester, NY 14627 quiroz@cs.rochester.edu