[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

27.7 Read-Only Buffers

If a buffer is read-only, then you cannot change its contents, although you may change your view of the contents by scrolling and narrowing.

Read-only buffers are used in two kinds of situations:

Variable: buffer-read-only

This buffer-local variable specifies whether the buffer is read-only. The buffer is read-only if this variable is non-nil.

Variable: inhibit-read-only

If this variable is non-nil, then read-only buffers and, depending on the actual value, some or all read-only characters may be modified. Read-only characters in a buffer are those that have non-nil read-only properties (either text properties or overlay properties). Voir la section Properties with Special Meanings, for more information about text properties. Voir la section Overlays, for more information about overlays and their properties.

If inhibit-read-only is t, all read-only character properties have no effect. If inhibit-read-only is a list, then read-only character properties have no effect if they are members of the list (comparison is done with eq).

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 buffer-read-only explicitly to the proper value, t or nil.

If arg is non-nil, it should be a raw prefix argument. toggle-read-only sets buffer-read-only to t if the numeric value of that prefix argument is positive and to nil otherwise. Voir la section Prefix Command Arguments.

Function: barf-if-buffer-read-only

This function signals a buffer-read-only error if the current buffer is read-only. Voir la section Using interactive, for another way to signal an error if the current buffer is read-only.


[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

Ce document a été généré par Eric Reinbold le 13 Octobre 2007 en utilisant texi2html 1.78.