help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help in Emacs


From: Kevin Rodgers
Subject: Re: Help in Emacs
Date: Fri, 17 Oct 2008 22:47:28 -0600
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

Chong Yidong wrote:
"Rupam Jaiswal" <rupamj@rediff.co.in> writes:

In order to avoid editing. Is there any way to open emacs in view mode
and not edit mode.(Just like in vi editior,where file can be open in
view mode by command view FileName).

C-x C-r visits a file in read-only mode.

Or from the command line:

emacs --eval "(find-file-read-only \"Please Hammer Don't Hurt 'Em.txt\")"

You can also define a new command line option, like this:

;; Usage: emacs --read-only FILE

(defun command-line-find-file-read-only (switch)
  (find-file-read-only (pop command-line-args-left)))

(add-to-list 'command-switch-alist
             '("--read-only" . command-line-find-file-read-only))

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

[Prev in Thread] Current Thread [Next in Thread]