all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dan Jacobson <jidanni@dman.ddts.net>
Subject: view-read-only causes read-write
Date: Thu, 17 Apr 2003 09:59:22 +0800	[thread overview]
Message-ID: <87r88128at.fsf@jidanni.org> (raw)

I did
$ emacs --no-site-file -q -nw -eval '
  (and(setq view-read-only t) (describe-variable (quote
  view-read-only)))'

Notes:
1. Ok, the help buffer says View mode in the modeline, but how about
   turning on the -%%- marker in the modeline?

2. Hey, real view-mode doesn't let me eat text with C-k etc, and then
   you can't repair the damage with undo because no undo record is
   kept for that buffer.

3. OK, trying again without messing first with view-read-only
   gives what one expects.

   Do I smell someone toggling read-only once too much?

4. view-read-only's docstring: "*Non-nil means buffers visiting files
   read-only, do it in view mode." (P.S. I assume the "*" means
   "Chef's choice".)

   OK, but what about read-only buffers not visiting files? Obviously
   you are over affecting those and at the same time not mentioning them.

P.S. I am no lisp pro but above I had to use an "(and ...)" or else
only one sexp was used, without any warning to the user.

PSS, while we are here, let's examine this docstring:
  toggle-read-only is an interactive compiled Lisp function in `files'.
  (toggle-read-only &optional ARG)

  Change whether this buffer is visiting its file read-only.
  With arg, set read-only iff arg is positive.

Ok, but it doesn't say what will happen if you give it a non positive
arg.  One can't just assume "common sense".  E.g. me, any common sense
and I wouldn't be hanging around this pop stand.

  If visiting file read-only and `view-read-only' is non-nil, enter view mode.

Hold on a second. We came here to toggle-read-only and like wham, we
are sent into view mode. It's like I do "chmod -w file" and wham, "more
file" is invoked as a free bonus.  What if I am a batch job? Anyway,
docsting looks bad. Didn't check the code.
-- 
http://jidanni.org/ Taiwan(04)25854780

             reply	other threads:[~2003-04-17  1:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-17  1:59 Dan Jacobson [this message]
     [not found] <mailman.4772.1050547956.21513.bug-gnu-emacs@gnu.org>
2003-04-17 17:10 ` view-read-only causes read-write Kevin Rodgers
2003-04-21  1:17   ` Dan Jacobson
     [not found]   ` <mailman.4998.1050903900.21513.bug-gnu-emacs@gnu.org>
2003-04-21 16:39     ` Kevin Rodgers

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

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

  git send-email \
    --in-reply-to=87r88128at.fsf@jidanni.org \
    --to=jidanni@dman.ddts.net \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.