aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/errors.texi7
-rw-r--r--doc/lispref/variables.texi13
2 files changed, 18 insertions, 2 deletions
diff --git a/doc/lispref/errors.texi b/doc/lispref/errors.texi
index 1f67819c34e..cd22b70800d 100644
--- a/doc/lispref/errors.texi
+++ b/doc/lispref/errors.texi
@@ -172,8 +172,11 @@ The message is @samp{Search failed}. @xref{Searching and Matching}.
172 172
173@item setting-constant 173@item setting-constant
174The message is @samp{Attempt to set a constant symbol}. This happens 174The message is @samp{Attempt to set a constant symbol}. This happens
175when attempting to assign values to @code{nil}, @code{t}, and keyword 175when attempting to assign values to @code{nil}, @code{t},
176symbols. @xref{Constant Variables}. 176@code{most-positive-fixnum}, @code{most-negative-fixnum}, and keyword
177symbols. It also happens when attempting to assign values to
178@code{enable-multibyte-characters} and some other symbols whose direct
179assignment is not allowed for some reason. @xref{Constant Variables}.
177 180
178@c simple.el 181@c simple.el
179@item text-read-only 182@item text-read-only
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 99bbfc91243..a871352b004 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -139,6 +139,13 @@ Variables}). A @code{defconst} form serves to inform human readers
139that you do not intend to change the value of a variable, but Emacs 139that you do not intend to change the value of a variable, but Emacs
140does not raise an error if you actually change it. 140does not raise an error if you actually change it.
141 141
142@cindex read-only variables
143A small number of additional symbols are made read-only for various
144practical reasons. These include @code{enable-multibyte-characters},
145@code{most-positive-fixnum}, @code{most-negative-fixnum}, and a few
146others. Any attempt to set or bind these also signals a
147@code{setting-constant} error.
148
142@node Local Variables 149@node Local Variables
143@section Local Variables 150@section Local Variables
144@cindex binding local variables 151@cindex binding local variables
@@ -1355,6 +1362,9 @@ is not current either on entry to or exit from the @code{let}. This is
1355because @code{let} does not distinguish between different kinds of 1362because @code{let} does not distinguish between different kinds of
1356bindings; it knows only which variable the binding was made for. 1363bindings; it knows only which variable the binding was made for.
1357 1364
1365It is an error to make a constant or a read-only variable
1366buffer-local. @xref{Constant Variables}.
1367
1358If the variable is terminal-local (@pxref{Multiple Terminals}), this 1368If the variable is terminal-local (@pxref{Multiple Terminals}), this
1359function signals an error. Such variables cannot have buffer-local 1369function signals an error. Such variables cannot have buffer-local
1360bindings as well. 1370bindings as well.
@@ -1394,6 +1404,9 @@ in a void buffer-local value and leave the default value unaffected.
1394 1404
1395The value returned is @var{variable}. 1405The value returned is @var{variable}.
1396 1406
1407It is an error to make a constant or a read-only variable
1408buffer-local. @xref{Constant Variables}.
1409
1397@strong{Warning:} Don't assume that you should use 1410@strong{Warning:} Don't assume that you should use
1398@code{make-variable-buffer-local} for user-option variables, simply 1411@code{make-variable-buffer-local} for user-option variables, simply
1399because users @emph{might} want to customize them differently in 1412because users @emph{might} want to customize them differently in