unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Michael Ekstrand <michael@elehack.net>
To: help-gnu-emacs@gnu.org
Subject: Re: Help in Emacs
Date: Sat, 18 Oct 2008 09:32:01 -0500	[thread overview]
Message-ID: <87abd2oty6.fsf@elehack.net> (raw)
In-Reply-To: mailman.1419.1224301974.25473.help-gnu-emacs@gnu.org

"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	other threads:[~2008-10-18 14:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1419.1224301974.25473.help-gnu-emacs@gnu.org>
2008-10-18 14:32 ` Michael Ekstrand [this message]
     [not found] <20081017095807.BB30CD5074@spunkymail-mx9.g.dreamhost.com>
2008-10-17 20:03 ` Help in Emacs Chong Yidong
2008-10-18  4:47   ` Kevin Rodgers
2008-10-17  9:57 Rupam Jaiswal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87abd2oty6.fsf@elehack.net \
    --to=michael@elehack.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).