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

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

Re: Help in Emacs


From: Michael Ekstrand
Subject: Re: Help in Emacs
Date: Sat, 18 Oct 2008 09:32:01 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

"Rupam Jaiswal" <rupamj@rediff.co.in> writes:
> I am using emacs. Many times, I have to open files just for viewing
> and not
> for editing.but by mistake some or the other lines get edited.

> 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).

There is the command `view-file' which will open a file read-only; in my
Emacs, it does not seem to be bound to any key, but you could bind it to
some convenient key in your .emacs.

Also, after opening a file, you can type C-x C-q (`toggle-read-only') to
put it in read-only mode.  In the default mode line, this will also
result in two % characters in the left end of the mode line, indicating
that the file is read-only.

- Michael

-- 
mouse, n: A device for pointing at the xterm in which you want to type.
Confused by the strange files?  I cryptographically sign my messages.
For more information see <http://www.elehack.net/resources/gpg>.


reply via email to

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