aboutsummaryrefslogtreecommitdiffstats
path: root/lispref
diff options
context:
space:
mode:
authorKaroly Lorentey2003-12-28 16:05:28 +0000
committerKaroly Lorentey2003-12-28 16:05:28 +0000
commit8ed48c277afad174675b3d6dcb8e7b00a4bcc97d (patch)
tree53d9baa35f9420264e2f53ad4db850c400c3e2c6 /lispref
parent2e7f2ec031f1708b80df9dc1f60f6b1cb24a5c02 (diff)
parent69348b2a71cbabeb23e3b7d5dce354c5bc4bd311 (diff)
downloademacs-8ed48c277afad174675b3d6dcb8e7b00a4bcc97d.tar.gz
emacs-8ed48c277afad174675b3d6dcb8e7b00a4bcc97d.zip
Merged in changes from CVS HEAD
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-1 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-2 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-3 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-17
Diffstat (limited to 'lispref')
-rw-r--r--lispref/ChangeLog50
-rw-r--r--lispref/commands.texi10
-rw-r--r--lispref/customize.texi73
-rw-r--r--lispref/display.texi7
-rw-r--r--lispref/eval.texi58
-rw-r--r--lispref/help.texi1
-rw-r--r--lispref/internals.texi30
-rw-r--r--lispref/loading.texi3
-rw-r--r--lispref/nonascii.texi228
-rw-r--r--lispref/objects.texi4
-rw-r--r--lispref/processes.texi1
-rw-r--r--lispref/tips.texi1
-rw-r--r--lispref/variables.texi47
13 files changed, 386 insertions, 127 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 85a5f506739..1b9aabffe46 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,51 @@
12003-12-25 Markus Rost <rost@mathematik.uni-bielefeld.de>
2
3 * display.texi (Fringes): Fix typo "set-buffer-window".
4
52003-12-24 Luc Teirlinck <teirllm@auburn.edu>
6
7 * display.texi, eval.texi, help.texi, internals.texi, loading.texi:
8 * nonascii.texi, processes.texi, tips.texi, variables.texi:
9 Add or change various xrefs and anchors.
10
11 * commands.texi: Replace all occurrences of @acronym{CAR} with
12 @sc{car}, for consistency with the rest of the Elisp manual.
13 `car' and `cdr' are historically acronyms, but are no longer
14 widely thought of as such.
15
16 * internals.texi (Pure Storage): Mention that `purecopy' does not
17 copy text properties.
18 (Object Internals): Now 29 bits are used (in most implementations)
19 to address Lisp objects.
20
21 * variables.texi (Variables with Restricted Values): New node.
22
23 * objects.texi (Lisp Data Types): Mention that certain variables
24 can only take on a restricted set of values and add an xref to
25 the new node "Variables with Restricted Values".
26
27 * eval.texi (Function Indirection): Describe the errors that
28 `indirect-function' can signal.
29 (Eval): Clarify the descriptions of `eval-region' and `values'.
30 Describe `eval-buffer' instead of `eval-current-buffer' and
31 mention `eval-current-buffer' as an alias for `current-buffer'.
32 Correct the description and mention all optional arguments.
33
34 * nonascii.texi : Various small changes in addition to the
35 following.
36 (Converting Representations): Clarify behavior of
37 `string-make-multibyte' and `string-to-multibyte' for unibyte all
38 ASCII arguments.
39 (Character Sets): Document the variable `charset-list' and adapt
40 the definition of the function `charset-list' accordingly.
41 (Translation of Characters): Clarify use of generic characters in
42 `make-translation-table'. Clarify and correct the description of
43 the use of translation tables in encoding and decoding.
44 (User-Chosen Coding Systems): Correct and clarify the description
45 of `select-safe-coding-system'.
46 (Default Coding Systems): Clarify description of
47 `file-coding-system-alist'.
48
12003-11-30 Luc Teirlinck <teirllm@auburn.edu> 492003-11-30 Luc Teirlinck <teirllm@auburn.edu>
2 50
3 * strings.texi (Text Comparison): Correctly describe when two 51 * strings.texi (Text Comparison): Correctly describe when two
@@ -42,7 +90,7 @@
42 90
432003-11-20 Luc Teirlinck <teirllm@auburn.edu> 912003-11-20 Luc Teirlinck <teirllm@auburn.edu>
44 92
45 * positions.texi (Positions): Mention that, if a marker is used a 93 * positions.texi (Positions): Mention that, if a marker is used as
46 a position, its buffer is ignored. 94 a position, its buffer is ignored.
47 95
48 * markers.texi (Overview of Markers): Mention it here too. 96 * markers.texi (Overview of Markers): Mention it here too.
diff --git a/lispref/commands.texi b/lispref/commands.texi
index a2838c68bb9..a8350b88d82 100644
--- a/lispref/commands.texi
+++ b/lispref/commands.texi
@@ -1096,7 +1096,7 @@ arguments to the key-binding lookup and modification functions.
1096 1096
1097Emacs supports four kinds of mouse events: click events, drag events, 1097Emacs supports four kinds of mouse events: click events, drag events,
1098button-down events, and motion events. All mouse events are represented 1098button-down events, and motion events. All mouse events are represented
1099as lists. The @acronym{CAR} of the list is the event type; this says which 1099as lists. The @sc{car} of the list is the event type; this says which
1100mouse button was involved, and which modifier keys were used with it. 1100mouse button was involved, and which modifier keys were used with it.
1101The event type can also distinguish double or triple button presses 1101The event type can also distinguish double or triple button presses
1102(@pxref{Repeat Events}). The rest of the list elements give position 1102(@pxref{Repeat Events}). The rest of the list elements give position
@@ -1172,7 +1172,7 @@ which the click occurred. It is one of the symbols @code{mode-line},
1172 1172
1173@item @var{x}, @var{y} 1173@item @var{x}, @var{y}
1174These are the pixel-denominated coordinates of the click, relative to 1174These are the pixel-denominated coordinates of the click, relative to
1175the top left corner of @var{window}, which is @code{(0 . 0)}. 1175the top left corner of @var{window}, which is @code{(0 . 0)}.
1176For the mode or header line, @var{y} does not have meaningful data. 1176For the mode or header line, @var{y} does not have meaningful data.
1177For the vertical line, @var{x} does not have meaningful data. 1177For the vertical line, @var{x} does not have meaningful data.
1178 1178
@@ -1188,7 +1188,7 @@ an image object as returned by @code{find-image} if click was in an image.
1188 1188
1189@item @var{string} 1189@item @var{string}
1190This is the string on which the click occurred, including any 1190This is the string on which the click occurred, including any
1191properties. 1191properties.
1192 1192
1193@item @var{string-pos} 1193@item @var{string-pos}
1194This is the position in the string on which the click occurred, 1194This is the position in the string on which the click occurred,
@@ -1560,7 +1560,7 @@ into another window. That produces a pair of events like these:
1560key binding purposes. For a keyboard event, the event type equals the 1560key binding purposes. For a keyboard event, the event type equals the
1561event value; thus, the event type for a character is the character, and 1561event value; thus, the event type for a character is the character, and
1562the event type for a function key symbol is the symbol itself. For 1562the event type for a function key symbol is the symbol itself. For
1563events that are lists, the event type is the symbol in the @acronym{CAR} of 1563events that are lists, the event type is the symbol in the @sc{car} of
1564the list. Thus, the event type is always a symbol or a character. 1564the list. Thus, the event type is always a symbol or a character.
1565 1565
1566 Two events of the same type are equivalent where key bindings are 1566 Two events of the same type are equivalent where key bindings are
@@ -2583,7 +2583,7 @@ This function returns the numeric meaning of a valid raw prefix argument
2583value, @var{arg}. The argument may be a symbol, a number, or a list. 2583value, @var{arg}. The argument may be a symbol, a number, or a list.
2584If it is @code{nil}, the value 1 is returned; if it is @code{-}, the 2584If it is @code{nil}, the value 1 is returned; if it is @code{-}, the
2585value @minus{}1 is returned; if it is a number, that number is returned; 2585value @minus{}1 is returned; if it is a number, that number is returned;
2586if it is a list, the @acronym{CAR} of that list (which should be a number) is 2586if it is a list, the @sc{car} of that list (which should be a number) is
2587returned. 2587returned.
2588@end defun 2588@end defun
2589 2589
diff --git a/lispref/customize.texi b/lispref/customize.texi
index 8621cb65662..90600f410b7 100644
--- a/lispref/customize.texi
+++ b/lispref/customize.texi
@@ -1,6 +1,6 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. 3@c Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
4@c See the file elisp.texi for copying conditions. 4@c See the file elisp.texi for copying conditions.
5@setfilename ../info/customize 5@setfilename ../info/customize
6@node Customization, Loading, Macros, Top 6@node Customization, Loading, Macros, Top
@@ -373,6 +373,7 @@ equivalent to @code{(string)}.
373* Composite Types:: 373* Composite Types::
374* Splicing into Lists:: 374* Splicing into Lists::
375* Type Keywords:: 375* Type Keywords::
376* Defining New Types::
376@end menu 377@end menu
377 378
378All customization types are implemented as widgets; see @ref{Top, , 379All customization types are implemented as widgets; see @ref{Top, ,
@@ -1056,6 +1057,76 @@ arguments, which will be used when creating the @code{radio-button} or
1056@end ignore 1057@end ignore
1057@end table 1058@end table
1058 1059
1060@node Defining New Types
1061@subsection Defining New Types
1062
1063In the previous sections we have described how to construct elaborate
1064type specifications for @code{defcustom}. In some cases you may want to
1065give such a type specification a name. The obvious case is when you are
1066using the same type for many user options, rather than repeat the
1067specification for each option, you can give the type specification a
1068name once, and use that name each @code{defcustom}. The other case is
1069when a user option accept a recursive datastructure. To make it
1070possible for a datatype to refer to itself, it needs to have a name.
1071
1072Since custom types are implemented as widgets, the way to define a new
1073customize type is to define a new widget. We are not going to describe
1074the widget interface here in details, see @ref{Top, , Introduction,
1075widget, The Emacs Widget Library}, for that. Instead we are going to
1076demonstrate the minimal functionality needed for defining new customize
1077types by a simple example.
1078
1079@example
1080(define-widget 'binary-tree-of-string 'lazy
1081 "A binary tree made of cons-cells and strings."
1082 :offset 4
1083 :tag "Node"
1084 :type '(choice (string :tag "Leaf" :value "")
1085 (cons :tag "Interior"
1086 :value ("" . "")
1087 binary-tree-of-string
1088 binary-tree-of-string)))
1089
1090(defcustom foo-bar ""
1091 "Sample variable holding a binary tree of strings."
1092 :type 'binary-tree-of-string)
1093@end example
1094
1095The function to define a new widget is name @code{define-widget}. The
1096first argument is the symbol we want to make a new widget type. The
1097second argument is a symbol representing an existing widget, the new
1098widget is going to be defined in terms of difference from the existing
1099widget. For the purpose of defining new customization types, the
1100@code{lazy} widget is perfect, because it accept a @code{:type} keyword
1101argument with the same syntax as the keyword argument to
1102@code{defcustom} with the same name. The third argument is a
1103documentation string for the new widget. You will be able to see that
1104string with the @kbd{M-x widget-browse @key{ret} binary-tree-of-string
1105@key{ret}} command.
1106
1107After these mandatory arguments follows the keyword arguments. The most
1108important is @code{:type}, which describes the datatype we want to match
1109with this widget. Here a @code{binary-tree-of-string} is described as
1110being either a string, or a cons-cell whose car and cdr are themselves
1111both @code{binary-tree-of-string}. Note the reference to the widget
1112type we are currently in the process of defining. The @code{:tag}
1113attribute is a string to name the widget in the user interface, and the
1114@code{:offset} argument are there to ensure that child nodes are
1115indented four spaces relatively to the parent node, making the tree
1116structure apparent in the customization buffer.
1117
1118The @code{defcustom} shows how the new widget can be used as an ordinary
1119customization type.
1120
1121If you wonder about the name @code{lazy}, know that the other composite
1122widgets convert their inferior widgets to internal form when the widget
1123is instantiated in a buffer. This conversion is recursive, so the
1124inferior widgets will convert @emph{their} inferior widgets. If the
1125datastructure is itself recursive, this conversion will go on forever,
1126or at least until Emacs run out of stack space. The @code{lazy} widget
1127stop this recursion, it will only convert its @code{:type} argument when
1128needed.
1129
1059@ignore 1130@ignore
1060 arch-tag: d1b8fad3-f48c-4ce4-a402-f73b5ef19bd2 1131 arch-tag: d1b8fad3-f48c-4ce4-a402-f73b5ef19bd2
1061@end ignore 1132@end ignore
diff --git a/lispref/display.texi b/lispref/display.texi
index 186703b13b0..abbbab0ce79 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -805,8 +805,9 @@ If the @var{forms} do not change the major mode in the output buffer,
805so that it is still Help mode at the end of their execution, then 805so that it is still Help mode at the end of their execution, then
806@code{with-output-to-temp-buffer} makes this buffer read-only at the 806@code{with-output-to-temp-buffer} makes this buffer read-only at the
807end, and also scans it for function and variable names to make them 807end, and also scans it for function and variable names to make them
808into clickable cross-references. @xref{Documentation Tips, , Tips for 808into clickable cross-references. @xref{Docstring hyperlinks, , Tips
809Documentation Strings}. 809for Documentation Strings}, in particular the item on hyperlinks in
810documentation strings, for more details.
810 811
811The string @var{buffer-name} specifies the temporary buffer, which 812The string @var{buffer-name} specifies the temporary buffer, which
812need not already exist. The argument must be a string, not a buffer. 813need not already exist. The argument must be a string, not a buffer.
@@ -2527,7 +2528,7 @@ fringe in pixels.
2527 2528
2528 The values of these variables take effect when you display the 2529 The values of these variables take effect when you display the
2529buffer in a window. If you change them while the buffer is visible, 2530buffer in a window. If you change them while the buffer is visible,
2530you can call @code{set-buffer-window} to display it in a window again. 2531you can call @code{set-window-buffer} to display it in a window again.
2531 2532
2532@defun set-window-fringes window left &optional right outside-margins 2533@defun set-window-fringes window left &optional right outside-margins
2533This function sets the fringe widthes of window @var{window}. 2534This function sets the fringe widthes of window @var{window}.
diff --git a/lispref/eval.texi b/lispref/eval.texi
index 165889e75ed..fcfde5849dd 100644
--- a/lispref/eval.texi
+++ b/lispref/eval.texi
@@ -319,6 +319,10 @@ This function returns the meaning of @var{function} as a function. If
319definition and starts over with that value. If @var{function} is not a 319definition and starts over with that value. If @var{function} is not a
320symbol, then it returns @var{function} itself. 320symbol, then it returns @var{function} itself.
321 321
322This function signals a @code{void-function} error if the final
323symbol is unbound and a @code{cyclic-function-indirection} error if
324there is a loop in the chain of symbols.
325
322Here is how you could define @code{indirect-function} in Lisp: 326Here is how you could define @code{indirect-function} in Lisp:
323 327
324@smallexample 328@smallexample
@@ -625,32 +629,51 @@ The number of currently active calls to @code{eval} is limited to
625@code{max-lisp-eval-depth} (see below). 629@code{max-lisp-eval-depth} (see below).
626@end defun 630@end defun
627 631
632@anchor{Definition of eval-region}
628@deffn Command eval-region start end &optional stream read-function 633@deffn Command eval-region start end &optional stream read-function
629This function evaluates the forms in the current buffer in the region 634This function evaluates the forms in the current buffer in the region
630defined by the positions @var{start} and @var{end}. It reads forms from 635defined by the positions @var{start} and @var{end}. It reads forms from
631the region and calls @code{eval} on them until the end of the region is 636the region and calls @code{eval} on them until the end of the region is
632reached, or until an error is signaled and not handled. 637reached, or until an error is signaled and not handled.
633 638
634If @var{stream} is non-@code{nil}, the values that result from 639By default, @code{eval-region} does not produce any output. However,
635evaluating the expressions in the region are printed using @var{stream}. 640if @var{stream} is non-@code{nil}, any output produced by output
636@xref{Output Streams}. 641functions (@pxref{Output Functions}), as well as the values that
637 642result from evaluating the expressions in the region are printed using
638If @var{read-function} is non-@code{nil}, it should be a function, which 643@var{stream}. @xref{Output Streams}.
639is used instead of @code{read} to read expressions one by one. This 644
640function is called with one argument, the stream for reading input. You 645If @var{read-function} is non-@code{nil}, it should be a function,
641can also use the variable @code{load-read-function} (@pxref{How Programs 646which is used instead of @code{read} to read expressions one by one.
642Do Loading}) to specify this function, but it is more robust to use the 647This function is called with one argument, the stream for reading
648input. You can also use the variable @code{load-read-function}
649(@pxref{Definition of load-read-function,, How Programs Do Loading})
650to specify this function, but it is more robust to use the
643@var{read-function} argument. 651@var{read-function} argument.
644 652
645@code{eval-region} always returns @code{nil}. 653@code{eval-region} does not move point. It always returns @code{nil}.
646@end deffn 654@end deffn
647 655
648@cindex evaluation of buffer contents 656@cindex evaluation of buffer contents
649@deffn Command eval-current-buffer &optional stream 657@deffn Command eval-buffer &optional buffer-or-name stream filename unibyte print
650This is like @code{eval-region} except that it operates on the whole 658This is similar to @code{eval-region}, but the arguments provide
651buffer. 659different optional features. @code{eval-buffer} operates on the
660entire accessible portion of buffer @var{buffer-or-name}.
661@var{buffer-or-name} can be a buffer, a buffer name (a string), or
662@code{nil} (or omitted), which means to use the current buffer.
663@var{stream} is used as in @code{eval-region}, unless @var{stream} is
664@code{nil} and @var{print} non-@code{nil}. In that case, values that
665result from evaluating the expressions are still discarded, but the
666output of the output functions is printed in the echo area.
667@var{filename} is the file name to use for @code{load-history}
668(@pxref{Unloading}), and defaults to @code{buffer-file-name}
669(@pxref{Buffer File Name}). If @var{unibyte} is non-@code{nil},
670@code{read} converts strings to unibyte whenever possible.
671
672@findex eval-current-buffer
673@code{eval-current-buffer} is an alias for this command.
652@end deffn 674@end deffn
653 675
676@anchor{Definition of max-lisp-eval-depth}
654@defvar max-lisp-eval-depth 677@defvar max-lisp-eval-depth
655This variable defines the maximum depth allowed in calls to @code{eval}, 678This variable defines the maximum depth allowed in calls to @code{eval},
656@code{apply}, and @code{funcall} before an error is signaled (with error 679@code{apply}, and @code{funcall} before an error is signaled (with error
@@ -670,14 +693,17 @@ Entry to the Lisp debugger increases the value, if there is little room
670left, to make sure the debugger itself has room to execute. 693left, to make sure the debugger itself has room to execute.
671 694
672@code{max-specpdl-size} provides another limit on nesting. 695@code{max-specpdl-size} provides another limit on nesting.
673@xref{Local Variables}. 696@xref{Definition of max-specpdl-size,, Local Variables}.
674@end defvar 697@end defvar
675 698
676@defvar values 699@defvar values
677The value of this variable is a list of the values returned by all the 700The value of this variable is a list of the values returned by all the
678expressions that were read, evaluated, and printed from buffers 701expressions that were read, evaluated, and printed from buffers
679(including the minibuffer) by the standard Emacs commands which do this. 702(including the minibuffer) by the standard Emacs commands which do
680The elements are ordered most recent first. 703this. (Note that this does @emph{not} include evaluation in
704@samp{*ielm*} buffers, nor evaluation using @kbd{C-j} in
705@code{lisp-interaction-mode}.) The elements are ordered most recent
706first.
681 707
682@example 708@example
683@group 709@group
diff --git a/lispref/help.texi b/lispref/help.texi
index 7675e38e81e..343ffb66078 100644
--- a/lispref/help.texi
+++ b/lispref/help.texi
@@ -259,6 +259,7 @@ as shown above for the @code{goal-column} variable, means that it is a
259user option; see the description of @code{defvar} in @ref{Defining 259user option; see the description of @code{defvar} in @ref{Defining
260Variables}. 260Variables}.
261 261
262@anchor{Definition of Snarf-documentation}
262@defun Snarf-documentation filename 263@defun Snarf-documentation filename
263This function is used only during Emacs initialization, just before 264This function is used only during Emacs initialization, just before
264the runnable Emacs is dumped. It finds the file offsets of the 265the runnable Emacs is dumped. It finds the file offsets of the
diff --git a/lispref/internals.texi b/lispref/internals.texi
index c8cf5ed0f7c..2a4572560a7 100644
--- a/lispref/internals.texi
+++ b/lispref/internals.texi
@@ -81,8 +81,9 @@ faster. On modern machines, it is usually not advisable.
81 81
82 After @file{loadup.el} reads @file{site-load.el}, it finds the 82 After @file{loadup.el} reads @file{site-load.el}, it finds the
83documentation strings for primitive and preloaded functions (and 83documentation strings for primitive and preloaded functions (and
84variables) in the file @file{etc/DOC} where they are stored, by calling 84variables) in the file @file{etc/DOC} where they are stored, by
85@code{Snarf-documentation} (@pxref{Accessing Documentation}). 85calling @code{Snarf-documentation} (@pxref{Definition of
86Snarf-documentation,, Accessing Documentation}).
86 87
87@cindex @file{site-init.el} 88@cindex @file{site-init.el}
88 You can specify other Lisp expressions to execute just before dumping 89 You can specify other Lisp expressions to execute just before dumping
@@ -151,10 +152,10 @@ preload additional libraries or add features to the standard ones.
151@defun purecopy object 152@defun purecopy object
152This function makes a copy in pure storage of @var{object}, and returns 153This function makes a copy in pure storage of @var{object}, and returns
153it. It copies a string by simply making a new string with the same 154it. It copies a string by simply making a new string with the same
154characters in pure storage. It recursively copies the contents of 155characters, but without text properties, in pure storage. It
155vectors and cons cells. It does not make copies of other objects such 156recursively copies the contents of vectors and cons cells. It does
156as symbols, but just returns them unchanged. It signals an error if 157not make copies of other objects such as symbols, but just returns
157asked to copy markers. 158them unchanged. It signals an error if asked to copy markers.
158 159
159This function is a no-op except while Emacs is being built and dumped; 160This function is a no-op except while Emacs is being built and dumped;
160it is usually called only in the file @file{emacs/lisp/loaddefs.el}, but 161it is usually called only in the file @file{emacs/lisp/loaddefs.el}, but
@@ -367,7 +368,7 @@ until the subsequent garbage collection, at which time
367@code{garbage-collect} will set the threshold back to 10,000. 368@code{garbage-collect} will set the threshold back to 10,000.
368@end defopt 369@end defopt
369 370
370 The value return by @code{garbage-collect} describes the amount of 371 The value returned by @code{garbage-collect} describes the amount of
371memory used by Lisp data, broken down by data type. By contrast, the 372memory used by Lisp data, broken down by data type. By contrast, the
372function @code{memory-limit} provides information on the total amount of 373function @code{memory-limit} provides information on the total amount of
373memory Emacs is currently using. 374memory Emacs is currently using.
@@ -595,9 +596,9 @@ protected in the current function. It is necessary to do this explicitly.
595GC-protected; as long as the object is not recycled, all pointers to 596GC-protected; as long as the object is not recycled, all pointers to
596it remain valid. So if you are sure that a local variable points to 597it remain valid. So if you are sure that a local variable points to
597an object that will be preserved by some other pointer, that local 598an object that will be preserved by some other pointer, that local
598variable does not need a GCPRO. (Formerly, strings were an exception 599variable does not need a @code{GCPRO}. (Formerly, strings were an
599to this rule; in older Emacs versions, every pointer to a string 600exception to this rule; in older Emacs versions, every pointer to a
600needed to be marked by GC.) 601string needed to be marked by GC.)
601 602
602 The macro @code{GCPRO1} protects just one local variable. If you 603 The macro @code{GCPRO1} protects just one local variable. If you
603want to protect two, use @code{GCPRO2} instead; repeating 604want to protect two, use @code{GCPRO2} instead; repeating
@@ -612,7 +613,7 @@ Alas, we can't explain all the tricky details here.
612accept two arguments at the C level: the number of Lisp arguments, and 613accept two arguments at the C level: the number of Lisp arguments, and
613a @code{Lisp_Object *} pointer to a C vector containing those Lisp 614a @code{Lisp_Object *} pointer to a C vector containing those Lisp
614arguments. This C vector may be part of a Lisp vector, but it need 615arguments. This C vector may be part of a Lisp vector, but it need
615not be. The responsibility for using GCPRO to protecting the Lisp 616not be. The responsibility for using @code{GCPRO} to protect the Lisp
616arguments from GC if necessary rests with the caller in this case, 617arguments from GC if necessary rests with the caller in this case,
617since the caller allocated or found the storage for them. 618since the caller allocated or found the storage for them.
618 619
@@ -651,6 +652,7 @@ file, add to it a @code{syms_of_@var{filename}} (e.g.,
651of these functions are called, and add a call to 652of these functions are called, and add a call to
652@code{syms_of_@var{filename}} there. 653@code{syms_of_@var{filename}} there.
653 654
655@anchor{Defining Lisp variables in C}
654@vindex byte-boolean-vars 656@vindex byte-boolean-vars
655 The function @code{syms_of_@var{filename}} is also the place to define 657 The function @code{syms_of_@var{filename}} is also the place to define
656any C variables that are to be visible as Lisp variables. 658any C variables that are to be visible as Lisp variables.
@@ -761,9 +763,9 @@ knows about it.
761data are stored in a heap and the only access that programs have to it 763data are stored in a heap and the only access that programs have to it
762is through pointers. Pointers are thirty-two bits wide in most 764is through pointers. Pointers are thirty-two bits wide in most
763implementations. Depending on the operating system and type of machine 765implementations. Depending on the operating system and type of machine
764for which you compile Emacs, twenty-eight bits are used to address the 766for which you compile Emacs, twenty-nine bits are used to address the
765object, and the remaining four bits are used for a GC mark bit and the 767object, and the remaining three bits are used for the tag that
766tag that identifies the object's type. 768identifies the object's type.
767 769
768 Because Lisp objects are represented as tagged pointers, it is always 770 Because Lisp objects are represented as tagged pointers, it is always
769possible to determine the Lisp data type of any object. The C data type 771possible to determine the Lisp data type of any object. The C data type
diff --git a/lispref/loading.texi b/lispref/loading.texi
index 0865914c45d..e171fc70fdf 100644
--- a/lispref/loading.texi
+++ b/lispref/loading.texi
@@ -140,6 +140,7 @@ This variable is non-@code{nil} if Emacs is in the process of loading a
140file, and it is @code{nil} otherwise. 140file, and it is @code{nil} otherwise.
141@end defvar 141@end defvar
142 142
143@anchor{Definition of load-read-function}
143@defvar load-read-function 144@defvar load-read-function
144This variable specifies an alternate expression-reading function for 145This variable specifies an alternate expression-reading function for
145@code{load} and @code{eval-region} to use instead of @code{read}. 146@code{load} and @code{eval-region} to use instead of @code{read}.
@@ -150,7 +151,7 @@ functions should use @code{read}.
150 151
151Instead of using this variable, it is cleaner to use another, newer 152Instead of using this variable, it is cleaner to use another, newer
152feature: to pass the function as the @var{read-function} argument to 153feature: to pass the function as the @var{read-function} argument to
153@code{eval-region}. @xref{Eval}. 154@code{eval-region}. @xref{Definition of eval-region,, Eval}.
154@end defvar 155@end defvar
155 156
156 For information about how @code{load} is used in building Emacs, see 157 For information about how @code{load} is used in building Emacs, see
diff --git a/lispref/nonascii.texi b/lispref/nonascii.texi
index 72dd46d19eb..e66c7d15757 100644
--- a/lispref/nonascii.texi
+++ b/lispref/nonascii.texi
@@ -96,13 +96,15 @@ default value to @code{nil} early in startup.
96@defun position-bytes position 96@defun position-bytes position
97@tindex position-bytes 97@tindex position-bytes
98Return the byte-position corresponding to buffer position @var{position} 98Return the byte-position corresponding to buffer position @var{position}
99in the current buffer. 99in the current buffer. If @var{position} is out of range, the value
100is @code{nil}.
100@end defun 101@end defun
101 102
102@defun byte-to-position byte-position 103@defun byte-to-position byte-position
103@tindex byte-to-position 104@tindex byte-to-position
104Return the buffer position corresponding to byte-position 105Return the buffer position corresponding to byte-position
105@var{byte-position} in the current buffer. 106@var{byte-position} in the current buffer. If @var{byte-position} is
107out of range, the value is @code{nil}.
106@end defun 108@end defun
107 109
108@defun multibyte-string-p string 110@defun multibyte-string-p string
@@ -173,6 +175,9 @@ multibyte character. The value should be a char-table, or @code{nil}.
173If this is non-@code{nil}, it overrides @code{nonascii-insert-offset}. 175If this is non-@code{nil}, it overrides @code{nonascii-insert-offset}.
174@end defvar 176@end defvar
175 177
178The next three functions either return the argument @var{string}, or a
179newly created string with no text properties.
180
176@defun string-make-unibyte string 181@defun string-make-unibyte string
177This function converts the text of @var{string} to unibyte 182This function converts the text of @var{string} to unibyte
178representation, if it isn't already, and returns the result. If 183representation, if it isn't already, and returns the result. If
@@ -186,15 +191,23 @@ fails, this function takes just the low 8 bits of each character.
186@defun string-make-multibyte string 191@defun string-make-multibyte string
187This function converts the text of @var{string} to multibyte 192This function converts the text of @var{string} to multibyte
188representation, if it isn't already, and returns the result. If 193representation, if it isn't already, and returns the result. If
189@var{string} is a multibyte string, it is returned unchanged. 194@var{string} is a multibyte string or consists entirely of
190The function @code{unibyte-char-to-multibyte} is used to convert 195@acronym{ASCII} characters, it is returned unchanged. In particular,
191each unibyte character to a multibyte character. 196if @var{string} is unibyte and entirely @acronym{ASCII}, the returned
197string is unibyte. (When the characters are all @acronym{ASCII},
198Emacs primitives will treat the string the same way whether it is
199unibyte or multibyte.) If @var{string} is unibyte and contains
200non-@acronym{ASCII} characters, the function
201@code{unibyte-char-to-multibyte} is used to convert each unibyte
202character to a multibyte character.
192@end defun 203@end defun
193 204
194@defun string-to-multibyte string 205@defun string-to-multibyte string
195This function returns a multibyte string containing the same sequence 206This function returns a multibyte string containing the same sequence
196of character codes as @var{string}. If @var{string} is a multibyte 207of character codes as @var{string}. Unlike
197string, the value is the equal to @var{string}. 208@code{string-make-multibyte}, this function unconditionally returns a
209multibyte string. If @var{string} is a multibyte string, it is
210returned unchanged.
198@end defun 211@end defun
199 212
200@node Selecting a Representation 213@node Selecting a Representation
@@ -280,8 +293,8 @@ text representations.
280@end example 293@end example
281 294
282If the optional argument @var{genericp} is non-@code{nil}, this 295If the optional argument @var{genericp} is non-@code{nil}, this
283function returns @code{t} if @var{charcode} is a generic character 296function also returns @code{t} if @var{charcode} is a generic
284(@pxref{Splitting Characters}). 297character (@pxref{Splitting Characters}).
285@end defun 298@end defun
286 299
287@node Character Sets 300@node Character Sets
@@ -311,13 +324,19 @@ Returns @code{t} if @var{object} is a symbol that names a character set,
311@code{nil} otherwise. 324@code{nil} otherwise.
312@end defun 325@end defun
313 326
327@defvar charset-list
328The value is a list of all defined character set names.
329@end defvar
330
314@defun charset-list 331@defun charset-list
315This function returns a list of all defined character set names. 332This function returns the value of @code{charset-list}. It is only
333provided for backward compatibility.
316@end defun 334@end defun
317 335
318@defun char-charset character 336@defun char-charset character
319This function returns the name of the character set that @var{character} 337This function returns the name of the character set that @var{character}
320belongs to. 338belongs to, or the symbol @code{unknown} if @var{character} is not a
339valid character.
321@end defun 340@end defun
322 341
323@defun charset-plist charset 342@defun charset-plist charset
@@ -378,6 +397,9 @@ Return a list containing the name of the character set of
378identify @var{character} within that character set. The number of byte 397identify @var{character} within that character set. The number of byte
379values is the character set's dimension. 398values is the character set's dimension.
380 399
400If @var{character} is invalid as a character code, @code{split-char}
401returns a list consisting of the symbol @code{unknown} and @var{character}.
402
381@example 403@example
382(split-char 2248) 404(split-char 2248)
383 @result{} (latin-iso8859-1 72) 405 @result{} (latin-iso8859-1 72)
@@ -463,11 +485,11 @@ current buffer.
463@cindex character translation tables 485@cindex character translation tables
464@cindex translation tables 486@cindex translation tables
465 487
466 A @dfn{translation table} specifies a mapping of characters 488 A @dfn{translation table} is a char-table that specifies a mapping
467into characters. These tables are used in encoding and decoding, and 489of characters into characters. These tables are used in encoding and
468for other purposes. Some coding systems specify their own particular 490decoding, and for other purposes. Some coding systems specify their
469translation tables; there are also default translation tables which 491own particular translation tables; there are also default translation
470apply to all other coding systems. 492tables which apply to all other coding systems.
471 493
472@defun make-translation-table &rest translations 494@defun make-translation-table &rest translations
473This function returns a translation table based on the argument 495This function returns a translation table based on the argument
@@ -483,24 +505,30 @@ character, say @var{to-alt}, @var{from} is also translated to
483You can also map one whole character set into another character set with 505You can also map one whole character set into another character set with
484the same dimension. To do this, you specify a generic character (which 506the same dimension. To do this, you specify a generic character (which
485designates a character set) for @var{from} (@pxref{Splitting Characters}). 507designates a character set) for @var{from} (@pxref{Splitting Characters}).
486In this case, @var{to} should also be a generic character, for another 508In this case, if @var{to} is also a generic character, its character
487character set of the same dimension. Then the translation table 509set should have the same dimension as @var{from}'s. Then the
488translates each character of @var{from}'s character set into the 510translation table translates each character of @var{from}'s character
489corresponding character of @var{to}'s character set. 511set into the corresponding character of @var{to}'s character set. If
512@var{from} is a generic character and @var{to} is an ordinary
513character, then the translation table translates every character of
514@var{from}'s character set into @var{to}.
490@end defun 515@end defun
491 516
492 In decoding, the translation table's translations are applied to the 517 In decoding, the translation table's translations are applied to the
493characters that result from ordinary decoding. If a coding system has 518characters that result from ordinary decoding. If a coding system has
494property @code{character-translation-table-for-decode}, that specifies 519property @code{translation-table-for-decode}, that specifies the
495the translation table to use. Otherwise, if 520translation table to use. (This is a property of the coding system,
496@code{standard-translation-table-for-decode} is non-@code{nil}, decoding 521as returned by @code{coding-system-get}, not a property of the symbol
497uses that table. 522that is the coding system's name. @xref{Coding System Basics,, Basic
523Concepts of Coding Systems}.) Otherwise, if
524@code{standard-translation-table-for-decode} is non-@code{nil},
525decoding uses that table.
498 526
499 In encoding, the translation table's translations are applied to the 527 In encoding, the translation table's translations are applied to the
500characters in the buffer, and the result of translation is actually 528characters in the buffer, and the result of translation is actually
501encoded. If a coding system has property 529encoded. If a coding system has property
502@code{character-translation-table-for-encode}, that specifies the 530@code{translation-table-for-encode}, that specifies the translation
503translation table to use. Otherwise the variable 531table to use. Otherwise the variable
504@code{standard-translation-table-for-encode} specifies the translation 532@code{standard-translation-table-for-encode} specifies the translation
505table. 533table.
506 534
@@ -516,7 +544,8 @@ coding systems that don't specify any other translation table.
516 544
517@defvar translation-table-for-input 545@defvar translation-table-for-input
518Self-inserting characters are translated through this translation 546Self-inserting characters are translated through this translation
519table before they are inserted. 547table before they are inserted. This variable automatically becomes
548buffer-local when set.
520@end defvar 549@end defvar
521 550
522@node Coding Systems 551@node Coding Systems
@@ -686,7 +715,7 @@ systems as well.
686 715
687@defun coding-system-p object 716@defun coding-system-p object
688This function returns @code{t} if @var{object} is a coding system 717This function returns @code{t} if @var{object} is a coding system
689name. 718name or @code{nil}.
690@end defun 719@end defun
691 720
692@defun check-coding-system coding-system 721@defun check-coding-system coding-system
@@ -701,6 +730,9 @@ except for its eol conversion, which is specified by @code{eol-type}.
701@var{eol-type} should be @code{unix}, @code{dos}, @code{mac}, or 730@var{eol-type} should be @code{unix}, @code{dos}, @code{mac}, or
702@code{nil}. If it is @code{nil}, the returned coding system determines 731@code{nil}. If it is @code{nil}, the returned coding system determines
703the end-of-line conversion from the data. 732the end-of-line conversion from the data.
733
734@var{eol-type} may also be 0, 1 or 2, standing for @code{unix},
735@code{dos} and @code{mac}, respectively.
704@end defun 736@end defun
705 737
706@defun coding-system-change-text-conversion eol-coding text-coding 738@defun coding-system-change-text-conversion eol-coding text-coding
@@ -745,55 +777,79 @@ return value is just one coding system, the one that is highest in
745priority. 777priority.
746 778
747If the region contains only @acronym{ASCII} characters, the value 779If the region contains only @acronym{ASCII} characters, the value
748is @code{undecided} or @code{(undecided)}. 780is @code{undecided} or @code{(undecided)}, or a variant specifying
781end-of-line conversion, if that can be deduced from the text.
749@end defun 782@end defun
750 783
751@defun detect-coding-string string highest 784@defun detect-coding-string string &optional highest
752This function is like @code{detect-coding-region} except that it 785This function is like @code{detect-coding-region} except that it
753operates on the contents of @var{string} instead of bytes in the buffer. 786operates on the contents of @var{string} instead of bytes in the buffer.
754@end defun 787@end defun
755 788
756 @xref{Process Information}, for how to examine or set the coding 789 @xref{Coding systems for a subprocess,, Process Information}, in
757systems used for I/O to a subprocess. 790particular the description of the functions
791@code{process-coding-system} and @code{set-process-coding-system}, for
792how to examine or set the coding systems used for I/O to a subprocess.
758 793
759@node User-Chosen Coding Systems 794@node User-Chosen Coding Systems
760@subsection User-Chosen Coding Systems 795@subsection User-Chosen Coding Systems
761 796
762@cindex select safe coding system 797@cindex select safe coding system
763@defun select-safe-coding-system from to &optional default-coding-system accept-default-p 798@defun select-safe-coding-system from to &optional default-coding-system accept-default-p file
764This function selects a coding system for encoding specified text, 799This function selects a coding system for encoding specified text,
765asking the user to choose if necessary. Normally the specified text 800asking the user to choose if necessary. Normally the specified text
766is the text in the current buffer between @var{from} and @var{to}, 801is the text in the current buffer between @var{from} and @var{to}. If
767defaulting to the whole buffer if they are @code{nil}. If @var{from} 802@var{from} is a string, the string specifies the text to encode, and
768is a string, the string specifies the text to encode, and @var{to} is 803@var{to} is ignored.
769ignored.
770 804
771If @var{default-coding-system} is non-@code{nil}, that is the first 805If @var{default-coding-system} is non-@code{nil}, that is the first
772coding system to try; if that can handle the text, 806coding system to try; if that can handle the text,
773@code{select-safe-coding-system} returns that coding system. It can 807@code{select-safe-coding-system} returns that coding system. It can
774also be a list of coding systems; then the function tries each of them 808also be a list of coding systems; then the function tries each of them
775one by one. After trying all of them, it next tries the user's most 809one by one. After trying all of them, it next tries the current
776preferred coding system (@pxref{Recognize Coding, 810buffer's value of @code{buffer-file-coding-system} (if it is not
777prefer-coding-system, the description of @code{prefer-coding-system}, 811@code{undecided}), then the value of
778emacs, GNU Emacs Manual}), and after that the current buffer's value 812@code{default-buffer-file-coding-system} and finally the user's most
779of @code{buffer-file-coding-system} (if it is not @code{undecided}). 813preferred coding system, which the user can set using the command
814@code{prefer-coding-system} (@pxref{Recognize Coding,, Recognizing
815Coding Systems, emacs, The GNU Emacs Manual}).
780 816
781If one of those coding systems can safely encode all the specified 817If one of those coding systems can safely encode all the specified
782text, @code{select-safe-coding-system} chooses it and returns it. 818text, @code{select-safe-coding-system} chooses it and returns it.
783Otherwise, it asks the user to choose from a list of coding systems 819Otherwise, it asks the user to choose from a list of coding systems
784which can encode all the text, and returns the user's choice. 820which can encode all the text, and returns the user's choice.
785 821
822@var{default-coding-system} can also be a list whose first element is
823t and whose other elements are coding systems. Then, if no coding
824system in the list can handle the text, @code{select-safe-coding-system}
825queries the user immediately, without trying any of the three
826alternatives described above.
827
786The optional argument @var{accept-default-p}, if non-@code{nil}, 828The optional argument @var{accept-default-p}, if non-@code{nil},
787should be a function to determine whether the coding system selected 829should be a function to determine whether a coding system selected
788without user interaction is acceptable. If this function returns 830without user interaction is acceptable. @code{select-safe-coding-system}
789@code{nil}, the silently selected coding system is rejected, and the 831calls this function with one argument, the base coding system of the
790user is asked to select a coding system from a list of possible 832selected coding system. If @var{accept-default-p} returns @code{nil},
791candidates. 833@code{select-safe-coding-system} rejects the silently selected coding
834system, and asks the user to select a coding system from a list of
835possible candidates.
792 836
793@vindex select-safe-coding-system-accept-default-p 837@vindex select-safe-coding-system-accept-default-p
794If the variable @code{select-safe-coding-system-accept-default-p} is 838If the variable @code{select-safe-coding-system-accept-default-p} is
795non-@code{nil}, its value overrides the value of 839non-@code{nil}, its value overrides the value of
796@var{accept-default-p}. 840@var{accept-default-p}.
841
842As a final step, before returning the chosen coding system,
843@code{select-safe-coding-system} checks whether that coding system is
844consistent with what would be selected if the contents of the region
845were read from a file. (If not, this could lead to data corruption in
846a file subsequently re-visited and edited.) Normally,
847@code{select-safe-coding-system} uses @code{buffer-file-name} as the
848file for this purpose, but if @var{file} is non-@code{nil}, it uses
849that file instead (this can be relevant for @code{write-region} and
850similar functions). If it detects an apparent inconsistency,
851@code{select-safe-coding-system} queries the user before selecting the
852coding system.
797@end defun 853@end defun
798 854
799 Here are two functions you can use to let the user specify a coding 855 Here are two functions you can use to let the user specify a coding
@@ -846,17 +902,19 @@ reading and writing particular files. Each element has the form
846expression that matches certain file names. The element applies to file 902expression that matches certain file names. The element applies to file
847names that match @var{pattern}. 903names that match @var{pattern}.
848 904
849The @acronym{CDR} of the element, @var{coding}, should be either a coding 905The @sc{cdr} of the element, @var{coding}, should be either a coding
850system, a cons cell containing two coding systems, or a function name (a 906system, a cons cell containing two coding systems, or a function name (a
851symbol with a function definition). If @var{coding} is a coding system, 907symbol with a function definition). If @var{coding} is a coding system,
852that coding system is used for both reading the file and writing it. If 908that coding system is used for both reading the file and writing it. If
853@var{coding} is a cons cell containing two coding systems, its @acronym{CAR} 909@var{coding} is a cons cell containing two coding systems, its @sc{car}
854specifies the coding system for decoding, and its @acronym{cdr} specifies the 910specifies the coding system for decoding, and its @sc{cdr} specifies the
855coding system for encoding. 911coding system for encoding.
856 912
857If @var{coding} is a function name, the function must return a coding 913If @var{coding} is a function name, the function should take one
858system or a cons cell containing two coding systems. This value is used 914argument, a list of all arguments passed to
859as described above. 915@code{find-operation-coding-system}. It must return a coding system
916or a cons cell containing two coding systems. This value has the same
917meaning as described above.
860@end defvar 918@end defvar
861 919
862@defvar process-coding-system-alist 920@defvar process-coding-system-alist
@@ -923,7 +981,7 @@ performing @var{operation} with @var{arguments}. The value has this
923form: 981form:
924 982
925@example 983@example
926(@var{decoding-system} @var{encoding-system}) 984(@var{decoding-system} . @var{encoding-system})
927@end example 985@end example
928 986
929The first element, @var{decoding-system}, is the coding system to use 987The first element, @var{decoding-system}, is the coding system to use
@@ -948,7 +1006,6 @@ or port number.
948This function looks up the target in @code{file-coding-system-alist}, 1006This function looks up the target in @code{file-coding-system-alist},
949@code{process-coding-system-alist}, or 1007@code{process-coding-system-alist}, or
950@code{network-coding-system-alist}, depending on @var{operation}. 1008@code{network-coding-system-alist}, depending on @var{operation}.
951@xref{Default Coding Systems}.
952@end defun 1009@end defun
953 1010
954@node Specifying Coding Systems 1011@node Specifying Coding Systems
@@ -1040,33 +1097,41 @@ decoding functions produce sequences of bytes; the encoding functions
1040are meant to operate on sequences of bytes. All of these functions 1097are meant to operate on sequences of bytes. All of these functions
1041discard text properties. 1098discard text properties.
1042 1099
1043@defun encode-coding-region start end coding-system 1100@deffn Command encode-coding-region start end coding-system
1044This function encodes the text from @var{start} to @var{end} according 1101This command encodes the text from @var{start} to @var{end} according
1045to coding system @var{coding-system}. The encoded text replaces the 1102to coding system @var{coding-system}. The encoded text replaces the
1046original text in the buffer. The result of encoding is logically a 1103original text in the buffer. The result of encoding is logically a
1047sequence of bytes, but the buffer remains multibyte if it was multibyte 1104sequence of bytes, but the buffer remains multibyte if it was multibyte
1048before. 1105before.
1049@end defun
1050 1106
1051@defun encode-coding-string string coding-system 1107This command returns the length of the encoded text.
1108@end deffn
1109
1110@defun encode-coding-string string coding-system &optional nocopy
1052This function encodes the text in @var{string} according to coding 1111This function encodes the text in @var{string} according to coding
1053system @var{coding-system}. It returns a new string containing the 1112system @var{coding-system}. It returns a new string containing the
1054encoded text. The result of encoding is a unibyte string. 1113encoded text, except when @var{nocopy} is non-@code{nil}, in which
1114case the function may return @var{string} itself if the encoding
1115operation is trivial. The result of encoding is a unibyte string.
1055@end defun 1116@end defun
1056 1117
1057@defun decode-coding-region start end coding-system 1118@deffn Command decode-coding-region start end coding-system
1058This function decodes the text from @var{start} to @var{end} according 1119This command decodes the text from @var{start} to @var{end} according
1059to coding system @var{coding-system}. The decoded text replaces the 1120to coding system @var{coding-system}. The decoded text replaces the
1060original text in the buffer. To make explicit decoding useful, the text 1121original text in the buffer. To make explicit decoding useful, the text
1061before decoding ought to be a sequence of byte values, but both 1122before decoding ought to be a sequence of byte values, but both
1062multibyte and unibyte buffers are acceptable. 1123multibyte and unibyte buffers are acceptable.
1063@end defun
1064 1124
1065@defun decode-coding-string string coding-system 1125This command returns the length of the decoded text.
1126@end deffn
1127
1128@defun decode-coding-string string coding-system &optional nocopy
1066This function decodes the text in @var{string} according to coding 1129This function decodes the text in @var{string} according to coding
1067system @var{coding-system}. It returns a new string containing the 1130system @var{coding-system}. It returns a new string containing the
1068decoded text. To make explicit decoding useful, the contents of 1131decoded text, except when @var{nocopy} is non-@code{nil}, in which
1069@var{string} ought to be a sequence of byte values, but a multibyte 1132case the function may return @var{string} itself if the decoding
1133operation is trivial. To make explicit decoding useful, the contents
1134of @var{string} ought to be a sequence of byte values, but a multibyte
1070string is acceptable. 1135string is acceptable.
1071@end defun 1136@end defun
1072 1137
@@ -1095,22 +1160,22 @@ This function returns the coding system that is in use for decoding
1095keyboard input---or @code{nil} if no coding system is to be used. 1160keyboard input---or @code{nil} if no coding system is to be used.
1096@end defun 1161@end defun
1097 1162
1098@defun set-keyboard-coding-system coding-system 1163@deffn Command set-keyboard-coding-system coding-system
1099This function specifies @var{coding-system} as the coding system to 1164This command specifies @var{coding-system} as the coding system to
1100use for decoding keyboard input. If @var{coding-system} is @code{nil}, 1165use for decoding keyboard input. If @var{coding-system} is @code{nil},
1101that means do not decode keyboard input. 1166that means do not decode keyboard input.
1102@end defun 1167@end deffn
1103 1168
1104@defun terminal-coding-system 1169@defun terminal-coding-system
1105This function returns the coding system that is in use for encoding 1170This function returns the coding system that is in use for encoding
1106terminal output---or @code{nil} for no encoding. 1171terminal output---or @code{nil} for no encoding.
1107@end defun 1172@end defun
1108 1173
1109@defun set-terminal-coding-system coding-system 1174@deffn Command set-terminal-coding-system coding-system
1110This function specifies @var{coding-system} as the coding system to use 1175This command specifies @var{coding-system} as the coding system to use
1111for encoding terminal output. If @var{coding-system} is @code{nil}, 1176for encoding terminal output. If @var{coding-system} is @code{nil},
1112that means do not encode terminal output. 1177that means do not encode terminal output.
1113@end defun 1178@end deffn
1114 1179
1115@node MS-DOS File Types 1180@node MS-DOS File Types
1116@subsection MS-DOS File Types 1181@subsection MS-DOS File Types
@@ -1193,18 +1258,18 @@ in any fashion.) It is @code{nil} if no input method is active in the
1193buffer now. 1258buffer now.
1194@end defvar 1259@end defvar
1195 1260
1196@defvar default-input-method 1261@defopt default-input-method
1197This variable holds the default input method for commands that choose an 1262This variable holds the default input method for commands that choose an
1198input method. Unlike @code{current-input-method}, this variable is 1263input method. Unlike @code{current-input-method}, this variable is
1199normally global. 1264normally global.
1200@end defvar 1265@end defopt
1201 1266
1202@defun set-input-method input-method 1267@deffn Command set-input-method input-method
1203This function activates input method @var{input-method} for the current 1268This command activates input method @var{input-method} for the current
1204buffer. It also sets @code{default-input-method} to @var{input-method}. 1269buffer. It also sets @code{default-input-method} to @var{input-method}.
1205If @var{input-method} is @code{nil}, this function deactivates any input 1270If @var{input-method} is @code{nil}, this command deactivates any input
1206method for the current buffer. 1271method for the current buffer.
1207@end defun 1272@end deffn
1208 1273
1209@defun read-input-method-name prompt &optional default inhibit-null 1274@defun read-input-method-name prompt &optional default inhibit-null
1210This function reads an input method name with the minibuffer, prompting 1275This function reads an input method name with the minibuffer, prompting
@@ -1240,7 +1305,8 @@ it is good for.
1240@end defvar 1305@end defvar
1241 1306
1242 The fundamental interface to input methods is through the 1307 The fundamental interface to input methods is through the
1243variable @code{input-method-function}. @xref{Reading One Event}. 1308variable @code{input-method-function}. @xref{Reading One Event},
1309and @ref{Invoking the Input Method}.
1244 1310
1245@node Locales 1311@node Locales
1246@section Locales 1312@section Locales
@@ -1294,14 +1360,14 @@ through @code{MON_12}).
1294 1360
1295@item paper 1361@item paper
1296Return a list @code{(@var{width} @var{height})} for the default paper 1362Return a list @code{(@var{width} @var{height})} for the default paper
1297size measured in milimeters (locale items @code{PAPER_WIDTH} and 1363size measured in millimeters (locale items @code{PAPER_WIDTH} and
1298@code{PAPER_HEIGHT}). 1364@code{PAPER_HEIGHT}).
1299@end table 1365@end table
1300 1366
1301If the system can't provide the requested information, or if 1367If the system can't provide the requested information, or if
1302@var{item} is not one of those symbols, the value is @code{nil}. All 1368@var{item} is not one of those symbols, the value is @code{nil}. All
1303strings in the return value are decoded using 1369strings in the return value are decoded using
1304@code{locale-coding-system}. @xref{Locales,,, libc, GNU Libc Manual}, 1370@code{locale-coding-system}. @xref{Locales,,, libc, The GNU Libc Manual},
1305for more information about locales and locale items. 1371for more information about locales and locale items.
1306@end defun 1372@end defun
1307 1373
diff --git a/lispref/objects.texi b/lispref/objects.texi
index 4c905cb969e..6cb5adb72b8 100644
--- a/lispref/objects.texi
+++ b/lispref/objects.texi
@@ -42,7 +42,9 @@ it as a number; Lisp knows it is a vector, not a number.
42variable, and the type is known by the compiler but not represented in 42variable, and the type is known by the compiler but not represented in
43the data. Such type declarations do not exist in Emacs Lisp. A Lisp 43the data. Such type declarations do not exist in Emacs Lisp. A Lisp
44variable can have any type of value, and it remembers whatever value 44variable can have any type of value, and it remembers whatever value
45you store in it, type and all. 45you store in it, type and all. (Actually, a small number of Emacs
46Lisp variables can only take on values of a certain type.
47@xref{Variables with Restricted Values}.)
46 48
47 This chapter describes the purpose, printed representation, and read 49 This chapter describes the purpose, printed representation, and read
48syntax of each of the standard types in GNU Emacs Lisp. Details on how 50syntax of each of the standard types in GNU Emacs Lisp. Details on how
diff --git a/lispref/processes.texi b/lispref/processes.texi
index c991cf300e3..8e32962de67 100644
--- a/lispref/processes.texi
+++ b/lispref/processes.texi
@@ -676,6 +676,7 @@ instead of a terminal (see @code{process-connection-type} in
676@ref{Asynchronous Processes}). 676@ref{Asynchronous Processes}).
677@end defun 677@end defun
678 678
679@anchor{Coding systems for a subprocess}
679@defun process-coding-system process 680@defun process-coding-system process
680This function returns a cons cell describing the coding systems in use 681This function returns a cons cell describing the coding systems in use
681for decoding output from @var{process} and for encoding input to 682for decoding output from @var{process} and for encoding input to
diff --git a/lispref/tips.texi b/lispref/tips.texi
index 1b40685ba5d..ec53dc420dd 100644
--- a/lispref/tips.texi
+++ b/lispref/tips.texi
@@ -647,6 +647,7 @@ The argument FOO can be either a number
647This prevents the open-parenthesis from being treated as the start of a 647This prevents the open-parenthesis from being treated as the start of a
648defun (@pxref{Defuns,, Defuns, emacs, The GNU Emacs Manual}). 648defun (@pxref{Defuns,, Defuns, emacs, The GNU Emacs Manual}).
649 649
650@anchor{Docstring hyperlinks}
650@item 651@item
651@iftex 652@iftex
652When a documentation string refers to a Lisp symbol, write it as it 653When a documentation string refers to a Lisp symbol, write it as it
diff --git a/lispref/variables.texi b/lispref/variables.texi
index 36cc2e47fe4..bbe7358b5d7 100644
--- a/lispref/variables.texi
+++ b/lispref/variables.texi
@@ -43,6 +43,8 @@ variable.
43* Future Local Variables:: New kinds of local values we might add some day. 43* Future Local Variables:: New kinds of local values we might add some day.
44* Variable Aliases:: Variables that are aliases for other variables. 44* Variable Aliases:: Variables that are aliases for other variables.
45* File Local Variables:: Handling local variable lists in files. 45* File Local Variables:: Handling local variable lists in files.
46* Variables with Restricted Values:: Non-constant variables whose value can
47 @emph{not} be an arbitrary Lisp object.
46@end menu 48@end menu
47 49
48@node Global Variables 50@node Global Variables
@@ -258,19 +260,21 @@ These kinds of bindings work somewhat like ordinary local bindings, but
258they are localized depending on ``where'' you are in Emacs, rather than 260they are localized depending on ``where'' you are in Emacs, rather than
259localized in time. 261localized in time.
260 262
263@anchor{Definition of max-specpdl-size}
261@defvar max-specpdl-size 264@defvar max-specpdl-size
262@cindex variable limit error 265@cindex variable limit error
263@cindex evaluation error 266@cindex evaluation error
264@cindex infinite recursion 267@cindex infinite recursion
265This variable defines the limit on the total number of local variable 268This variable defines the limit on the total number of local variable
266bindings and @code{unwind-protect} cleanups (@pxref{Nonlocal Exits}) 269bindings and @code{unwind-protect} cleanups (@pxref{Cleanups,,
267that are allowed before signaling an error (with data @code{"Variable 270Cleaning Up from Nonlocal Exits}) that are allowed before signaling an
268binding depth exceeds max-specpdl-size"}). 271error (with data @code{"Variable binding depth exceeds
272max-specpdl-size"}).
269 273
270This limit, with the associated error when it is exceeded, is one way 274This limit, with the associated error when it is exceeded, is one way
271that Lisp avoids infinite recursion on an ill-defined function. 275that Lisp avoids infinite recursion on an ill-defined function.
272@code{max-lisp-eval-depth} provides another limit on depth of nesting. 276@code{max-lisp-eval-depth} provides another limit on depth of nesting.
273@xref{Eval}. 277@xref{Definition of max-lisp-eval-depth,, Eval}.
274 278
275The default value is 600. Entry to the Lisp debugger increases the 279The default value is 600. Entry to the Lisp debugger increases the
276value, if there is little room left, to make sure the debugger itself 280value, if there is little room left, to make sure the debugger itself
@@ -1813,6 +1817,41 @@ could include functions to call. So Emacs discards all text
1813properties from string values specified in a file's local variables 1817properties from string values specified in a file's local variables
1814list. 1818list.
1815 1819
1820@node Variables with Restricted Values
1821@section Variables with Restricted Values
1822
1823 Ordinary Lisp variables can be assigned any value that is a valid
1824Lisp object. However, certain Lisp variables are not defined in Lisp,
1825but in C. Most of these variables are defined in the C code using
1826@code{DEFVAR_LISP}. Like variables defined in Lisp, these can take on
1827any value. However, some variables are defined using
1828@code{DEFVAR_INT} or @code{DEFVAR_BOOL}. @xref{Defining Lisp
1829variables in C,, Writing Emacs Primitives}, in particular the
1830description of functions of the type @code{syms_of_@var{filename}},
1831for a brief discussion of the C implementation.
1832
1833 Variables of type @code{DEFVAR_BOOL} can only take on the values
1834@code{nil} or @code{t}. Attempting to assign them any other value
1835will set them to @code{t}:
1836
1837@example
1838(let ((display-hourglass 5))
1839 display-hourglass)
1840 @result{} t
1841@end example
1842
1843@defvar byte-boolean-vars
1844This variable holds a list of all variables of type @code{DEFVAR_BOOL}.
1845@end defvar
1846
1847 Variables of type @code{DEFVAR_INT} can only take on integer values.
1848Attempting to assign them any other value will result in an error:
1849
1850@example
1851(setq window-min-height 5.0)
1852@error{} Wrong type argument: integerp, 5.0
1853@end example
1854
1816@ignore 1855@ignore
1817 arch-tag: 5ff62c44-2b51-47bb-99d4-fea5aeec5d3e 1856 arch-tag: 5ff62c44-2b51-47bb-99d4-fea5aeec5d3e
1818@end ignore 1857@end ignore