home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!agate!doc.ic.ac.uk!news!dbh
- From: dbh@doc.ic.ac.uk (Denis Howe)
- Newsgroups: gnu.emacs.help
- Subject: Re: Read-Only Mode in Emacs
- Date: 9 Nov 92 18:16:34
- Organization: Computing Department, Imperial College, London, UK
- Lines: 26
- Message-ID: <DBH.92Nov9181634@wombat.doc.ic.ac.uk>
- References: <1992Nov9.104519.12975@fzi.de> <BxGH8y.LMA.1@cs.cmu.edu>
- NNTP-Posting-Host: wombat.doc.ic.ac.uk
- In-reply-to: rudis+@cs.cmu.edu's message of 9 Nov 92 15:48:30 GMT
-
- In article <BxGH8y.LMA.1@cs.cmu.edu> rudis+@cs.cmu.edu (Rujith S
- DeSilva) wrote:
-
- >In article <1992Nov9.104519.12975@fzi.de> fzi.de writes: could
- >>someone tell me if there is any option for Read-Only mode in Emacs
- >>like the view editor. I couldn't find them in the manuel.
- >
- >Two things that you may find useful:
- >
- >(1) The view-mode, conveniently accessed by using view-file or view-buffer.
- >(2) The variable buffer-read-only. I use this via find-file-read-only.
- >
- >I prefer (2), because the commands work as usual, but anything that would
- >modify the buffer simply generates an error and a warning beep.
-
- I wrote the following because I was always hitting space to view the
- next screenful of read-only files (I'm easily confused like that :-).
-
- (defun insert-or-scroll (arg) "Insert a space or scroll-forward"
- (interactive "p")
- (if buffer-read-only (scroll-up ()) (self-insert-command arg)))
-
- (define-key global-map " " 'insert-or-scroll)
- --
- Denis Howe <dbh@doc.ic.ac.uk>
- So Biggs, you're the idiot who bought all these IBM PCs. You're fired!
-