Commit e109c4a6 authored by Chong Yidong's avatar Chong Yidong
Browse files

Doc updates for read-only-mode.

* buffers.texi (Misc Buffer): Replace toggle-read-only with
read-only-mode.

* files.texi (Visiting): Likewise.

* backups.texi (Auto-Saving): Refer to Minor Mode Conventions for
calling conventions.

* buffers.texi (Read Only Buffers): Document read-only-mode.

* keymaps.texi (Alias Menu Items): Replace toggle-read-only with
read-only-mode.
parent 9a930676
2012-09-23 Chong Yidong <cyd@gnu.org>
* buffers.texi (Misc Buffer): Replace toggle-read-only with
read-only-mode.
* files.texi (Visiting): Likewise.
2012-09-22 Paul Eggert <eggert@cs.ucla.edu> 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
* trouble.texi (Crashing): Document ulimit -c. * trouble.texi (Crashing): Document ulimit -c.
......
...@@ -212,7 +212,7 @@ unless they visit files: such buffers are used internally by Emacs. ...@@ -212,7 +212,7 @@ unless they visit files: such buffers are used internally by Emacs.
@table @kbd @table @kbd
@item C-x C-q @item C-x C-q
Toggle read-only status of buffer (@code{toggle-read-only}). Toggle read-only status of buffer (@code{read-only-mode}).
@item M-x rename-buffer @key{RET} @var{name} @key{RET} @item M-x rename-buffer @key{RET} @var{name} @key{RET}
Change the name of the current buffer. Change the name of the current buffer.
@item M-x rename-uniquely @item M-x rename-uniquely
...@@ -231,9 +231,9 @@ buffers are usually made by subsystems such as Dired and Rmail that ...@@ -231,9 +231,9 @@ buffers are usually made by subsystems such as Dired and Rmail that
have special commands to operate on the text; also by visiting a file have special commands to operate on the text; also by visiting a file
whose access control says you cannot write it. whose access control says you cannot write it.
@findex toggle-read-only @findex read-only-mode
@vindex view-read-only @vindex view-read-only
The command @kbd{C-x C-q} (@code{toggle-read-only}) makes a read-only The command @kbd{C-x C-q} (@code{read-only-mode}) makes a read-only
buffer writable, and makes a writable buffer read-only. This works by buffer writable, and makes a writable buffer read-only. This works by
setting the variable @code{buffer-read-only}, which has a local value setting the variable @code{buffer-read-only}, which has a local value
in each buffer and makes the buffer read-only if its value is in each buffer and makes the buffer read-only if its value is
......
...@@ -246,7 +246,7 @@ Archives}, for more about these features. ...@@ -246,7 +246,7 @@ Archives}, for more about these features.
or that is marked read-only, Emacs makes the buffer read-only too, so or that is marked read-only, Emacs makes the buffer read-only too, so
that you won't go ahead and make changes that you'll have trouble that you won't go ahead and make changes that you'll have trouble
saving afterward. You can make the buffer writable with @kbd{C-x C-q} saving afterward. You can make the buffer writable with @kbd{C-x C-q}
(@code{toggle-read-only}). @xref{Misc Buffer}. (@code{read-only-mode}). @xref{Misc Buffer}.
@kindex C-x C-r @kindex C-x C-r
@findex find-file-read-only @findex find-file-read-only
......
2012-09-23 Chong Yidong <cyd@gnu.org>
* buffers.texi (Read Only Buffers): Document read-only-mode.
* keymaps.texi (Alias Menu Items): Replace toggle-read-only with
read-only-mode.
* backups.texi (Auto-Saving): Refer to Minor Mode Conventions for
calling conventions.
2012-09-22 Chong Yidong <cyd@gnu.org> 2012-09-22 Chong Yidong <cyd@gnu.org>
* searching.texi (Replacing Match): Minor clarification. * searching.texi (Replacing Match): Minor clarification.
......
...@@ -441,12 +441,14 @@ buffer-auto-save-file-name ...@@ -441,12 +441,14 @@ buffer-auto-save-file-name
@end defvar @end defvar
@deffn Command auto-save-mode arg @deffn Command auto-save-mode arg
When used interactively without an argument, this command is a toggle This is the mode command for Auto Save mode, a buffer-local minor
switch: it turns on auto-saving of the current buffer if it is off, mode. When Auto Save mode is enabled, auto-saving is enabled in the
and vice versa. When called from Lisp with no argument, it turns buffer. The calling convention is the same as for other minor mode
auto-saving on. With an argument @var{arg}, it turns auto-saving on commands (@pxref{Minor Mode Conventions}).
if the value of @var{arg} is @code{t}, a nonempty list, or a positive
integer; otherwise, it turns auto-saving off. Unlike most minor modes, there is no @code{auto-save-mode} variable.
Auto Save mode is enabled if @code{buffer-auto-save-file-name} is
non-@code{nil} and @code{buffer-saved-size} (see below) is non-zero.
@end deffn @end deffn
@defun auto-save-file-name-p filename @defun auto-save-file-name-p filename
......
...@@ -740,31 +740,25 @@ properties have no effect. If @code{inhibit-read-only} is a list, then ...@@ -740,31 +740,25 @@ properties have no effect. If @code{inhibit-read-only} is a list, then
of the list (comparison is done with @code{eq}). of the list (comparison is done with @code{eq}).
@end defvar @end defvar
@deffn Command toggle-read-only &optional arg message @deffn Command read-only-mode &optional arg
This command toggles whether the current buffer is read-only, by This is the mode command for Read Only minor mode, a buffer-local
setting the variable @code{buffer-read-only}. If @var{arg} is minor mode. When the mode is enabled, @code{buffer-read-only} is
non-@code{nil}, it should be a raw prefix argument; the command then non-@code{nil} in the buffer; when disabled, @code{buffer-read-only}
makes the buffer read-only if the numeric value of that prefix is @code{nil} in the buffer. The calling convention is the same as
argument is positive, and makes the buffer writable otherwise. for other minor mode commands (@pxref{Minor Mode Conventions}).
@xref{Prefix Command Arguments}.
This minor mode mainly serves as a wrapper for
If called interactively, or if called from Lisp with @var{message} is @code{buffer-read-only}; unlike most minor modes, there is no separate
non-@code{nil}, the command prints a message reporting the buffer's @code{read-only-mode} variable. Even when Read Only mode is disabled,
new read-only status. characters with non-@code{nil} @code{read-only} text properties remain
read-only. To temporarily ignore all read-only states, bind
When making the buffer read-only, this command also enables View mode @code{inhibit-read-only}, as described above.
When enabling Read Only mode, this mode command also enables View mode
if the option @code{view-read-only} is non-@code{nil}. @xref{Misc if the option @code{view-read-only} is non-@code{nil}. @xref{Misc
Buffer,,Miscellaneous Buffer Operations, emacs, The GNU Emacs Manual}. Buffer,,Miscellaneous Buffer Operations, emacs, The GNU Emacs Manual}.
When making the buffer writable, it disables View mode if View mode When disabling Read Only mode, it disables View mode if View mode was
was enabled. enabled.
Lisp programs should only call @code{toggle-read-only} if they really
intend to do the same thing as the user command, including possibly
enabling or disabling View mode. Note also that this command works by
setting @code{buffer-read-only}, so even if you make the buffer
writable, characters with non-@code{nil} @code{read-only} text
properties will remain read-only. To temporarily ignore all read-only
states, bind @code{inhibit-read-only}, as described above.
@end deffn @end deffn
@defun barf-if-buffer-read-only @defun barf-if-buffer-read-only
......
...@@ -2288,12 +2288,12 @@ command but with different enable conditions. The best way to do this ...@@ -2288,12 +2288,12 @@ command but with different enable conditions. The best way to do this
in Emacs now is with extended menu items; before that feature existed, in Emacs now is with extended menu items; before that feature existed,
it could be done by defining alias commands and using them in menu it could be done by defining alias commands and using them in menu
items. Here's an example that makes two aliases for items. Here's an example that makes two aliases for
@code{toggle-read-only} and gives them different enable conditions: @code{read-only-mode} and gives them different enable conditions:
@example @example
(defalias 'make-read-only 'toggle-read-only) (defalias 'make-read-only 'read-only-mode)
(put 'make-read-only 'menu-enable '(not buffer-read-only)) (put 'make-read-only 'menu-enable '(not buffer-read-only))
(defalias 'make-writable 'toggle-read-only) (defalias 'make-writable 'read-only-mode)
(put 'make-writable 'menu-enable 'buffer-read-only) (put 'make-writable 'menu-enable 'buffer-read-only)
@end example @end example
...@@ -2310,7 +2310,7 @@ itself). To request this, give the alias symbol a non-@code{nil} ...@@ -2310,7 +2310,7 @@ itself). To request this, give the alias symbol a non-@code{nil}
@noindent @noindent
causes menu items for @code{make-read-only} and @code{make-writable} to causes menu items for @code{make-read-only} and @code{make-writable} to
show the keyboard bindings for @code{toggle-read-only}. show the keyboard bindings for @code{read-only-mode}.
@node Toolkit Differences @node Toolkit Differences
@subsubsection Toolkit Differences @subsubsection Toolkit Differences
......
...@@ -94,7 +94,7 @@ respectively, without exiting from the prompt. ...@@ -94,7 +94,7 @@ respectively, without exiting from the prompt.
next and previous path separator, respectively. next and previous path separator, respectively.
** Mode line changes ** Mode line changes
---
*** New option `mode-line-default-help-echo' specifies the help text *** New option `mode-line-default-help-echo' specifies the help text
(shown in a tooltip or in the echo area) for any part of the mode line (shown in a tooltip or in the echo area) for any part of the mode line
that does not have its own specialized help text. that does not have its own specialized help text.
...@@ -143,6 +143,7 @@ or expression to evaluate. ...@@ -143,6 +143,7 @@ or expression to evaluate.
** In the Package Menu, newly-available packages are listed as "new", ** In the Package Menu, newly-available packages are listed as "new",
and sorted above the other "available" packages by default. and sorted above the other "available" packages by default.
+++
** `C-x C-q' is now bound to the new minor mode `read-only-mode'. ** `C-x C-q' is now bound to the new minor mode `read-only-mode'.
This minor mode replaces `toggle-read-only', which is now obsolete. This minor mode replaces `toggle-read-only', which is now obsolete.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment