summaryrefslogtreecommitdiff
path: root/doc/lispref/buffers.texi
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2011-11-09 21:17:45 -0500
committerGlenn Morris <rgm@gnu.org>2011-11-09 21:17:45 -0500
commitb2621720c318257be0d4100d695b62986db88b4f (patch)
treeea4147a75f38b69ff7abb4ee550433e562ecaac3 /doc/lispref/buffers.texi
parentc4e7c63af11781a1c79c119ef4a2b8c2b74637d6 (diff)
downloademacs-b2621720c318257be0d4100d695b62986db88b4f.tar.gz
toggle-read-only fixes for bugs#7292, 10006.
* doc/lispref/buffers.texi (Read Only Buffers): Expand a bit on why toggle-read-only should only be used interactively. * lisp/files.el (toggle-read-only): Mention that it should only be used interactively. * lisp/emacs-lisp/bytecomp.el (byte-compile-interactive-only-functions): Add toggle-read-only.
Diffstat (limited to 'doc/lispref/buffers.texi')
-rw-r--r--doc/lispref/buffers.texi9
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi
index 816d0f9faa8..ee2ce2e2001 100644
--- a/doc/lispref/buffers.texi
+++ b/doc/lispref/buffers.texi
@@ -748,10 +748,11 @@ of the list (comparison is done with @code{eq}).
@deffn Command toggle-read-only &optional arg
This command toggles whether the current buffer is read-only. It is
-intended for interactive use; do not use it in programs. At any given
-point in a program, you should know whether you want the read-only flag
-on or off; so you can set @code{buffer-read-only} explicitly to the
-proper value, @code{t} or @code{nil}.
+intended for interactive use; do not use it in programs (it may have
+side-effects, such as enabling View mode, and does not affect
+read-only text properties). To change the read-only state of a buffer in
+a program, explicitly set @code{buffer-read-only} to the proper value.
+To temporarily ignore a read-only state, bind @code{inhibit-read-only}.
If @var{arg} is non-@code{nil}, it should be a raw prefix argument.
@code{toggle-read-only} sets @code{buffer-read-only} to @code{t} if