diff options
| author | Chong Yidong | 2010-11-27 15:04:57 -0500 |
|---|---|---|
| committer | Chong Yidong | 2010-11-27 15:04:57 -0500 |
| commit | 07976ae3b816dea4fd541bbba862603d3132eb2c (patch) | |
| tree | 4a437b7cb3abb01fb144530a130c991882a1b7f2 /doc/lispref | |
| parent | 9610796712a3bc43730c99005906571a2c0bccbd (diff) | |
| parent | 402c8a49571227f8a4e678d4a6cdd6ba7841aef9 (diff) | |
| download | emacs-07976ae3b816dea4fd541bbba862603d3132eb2c.tar.gz emacs-07976ae3b816dea4fd541bbba862603d3132eb2c.zip | |
Merge changes from emacs-23 branch
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/ChangeLog | 30 | ||||
| -rw-r--r-- | doc/lispref/functions.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/help.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/nonascii.texi | 7 | ||||
| -rw-r--r-- | doc/lispref/numbers.texi | 8 | ||||
| -rw-r--r-- | doc/lispref/objects.texi | 1 | ||||
| -rw-r--r-- | doc/lispref/strings.texi | 63 | ||||
| -rw-r--r-- | doc/lispref/symbols.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/text.texi | 31 | ||||
| -rw-r--r-- | doc/lispref/variables.texi | 18 |
10 files changed, 90 insertions, 74 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index d1c2d861eb7..c6d851f55ec 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,33 @@ | |||
| 1 | 2010-11-27 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * nonascii.texi (Converting Representations): Document | ||
| 4 | byte-to-string. | ||
| 5 | |||
| 6 | * strings.texi (Creating Strings): Don't mention semi-obsolete | ||
| 7 | function char-to-string. | ||
| 8 | (String Conversion): Shorten discussion of semi-obsolete function | ||
| 9 | string-to-char. Link to Converting Representations. | ||
| 10 | |||
| 11 | * objects.texi (Symbol Type): | ||
| 12 | * text.texi (Near Point): | ||
| 13 | * help.texi (Help Functions): | ||
| 14 | * functions.texi (Mapping Functions): Use string instead of | ||
| 15 | char-to-string in examples. | ||
| 16 | |||
| 17 | 2010-11-27 Chong Yidong <cyd@stupidchicken.com> | ||
| 18 | |||
| 19 | * text.texi (Kill Functions, Kill Functions) | ||
| 20 | (Low-Level Kill Ring, Low-Level Kill Ring): Remove obsolete | ||
| 21 | YANK-HANDLER args. | ||
| 22 | |||
| 23 | * symbols.texi (Creating Symbols): Using unintern without an | ||
| 24 | obarray arg is now obsolete. | ||
| 25 | |||
| 26 | * numbers.texi (Float Basics): Document float-e and float-pi. | ||
| 27 | |||
| 28 | * variables.texi (Defining Variables): Change "pi" example to | ||
| 29 | "float-pi". | ||
| 30 | |||
| 1 | 2010-11-26 Eli Zaretskii <eliz@gnu.org> | 31 | 2010-11-26 Eli Zaretskii <eliz@gnu.org> |
| 2 | 32 | ||
| 3 | * commands.texi (Click Events): Document the values of X, Y and | 33 | * commands.texi (Click Events): Document the values of X, Y and |
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 6f3fd63013c..635245426fb 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi | |||
| @@ -818,7 +818,7 @@ length of @var{sequence}. For example: | |||
| 818 | @result{} (a c e) | 818 | @result{} (a c e) |
| 819 | (mapcar '1+ [1 2 3]) | 819 | (mapcar '1+ [1 2 3]) |
| 820 | @result{} (2 3 4) | 820 | @result{} (2 3 4) |
| 821 | (mapcar 'char-to-string "abc") | 821 | (mapcar 'string "abc") |
| 822 | @result{} ("a" "b" "c") | 822 | @result{} ("a" "b" "c") |
| 823 | @end group | 823 | @end group |
| 824 | 824 | ||
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index d3e289578c0..f21e16e104a 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi | |||
| @@ -546,7 +546,7 @@ follows: | |||
| 546 | 546 | ||
| 547 | @smallexample | 547 | @smallexample |
| 548 | @group | 548 | @group |
| 549 | (define-key global-map (char-to-string help-char) 'help-command) | 549 | (define-key global-map (string help-char) 'help-command) |
| 550 | (fset 'help-command help-map) | 550 | (fset 'help-command help-map) |
| 551 | @end group | 551 | @end group |
| 552 | @end smallexample | 552 | @end smallexample |
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi index 40c78d97da7..1c196c93f27 100644 --- a/doc/lispref/nonascii.texi +++ b/doc/lispref/nonascii.texi | |||
| @@ -199,6 +199,13 @@ unibyte string, it is returned unchanged. Use this function for | |||
| 199 | characters. | 199 | characters. |
| 200 | @end defun | 200 | @end defun |
| 201 | 201 | ||
| 202 | @defun byte-to-string byte | ||
| 203 | @cindex byte to string | ||
| 204 | This function returns a unibyte string containing a single byte of | ||
| 205 | character data, @var{character}. It signals a error if | ||
| 206 | @var{character} is not an integer between 0 and 255. | ||
| 207 | @end defun | ||
| 208 | |||
| 202 | @defun multibyte-char-to-unibyte char | 209 | @defun multibyte-char-to-unibyte char |
| 203 | This converts the multibyte character @var{char} to a unibyte | 210 | This converts the multibyte character @var{char} to a unibyte |
| 204 | character, and returns that character. If @var{char} is neither | 211 | character, and returns that character. If @var{char} is neither |
diff --git a/doc/lispref/numbers.texi b/doc/lispref/numbers.texi index 62b4796350e..e83da348e05 100644 --- a/doc/lispref/numbers.texi +++ b/doc/lispref/numbers.texi | |||
| @@ -224,6 +224,14 @@ down to an integer. | |||
| 224 | @end example | 224 | @end example |
| 225 | @end defun | 225 | @end defun |
| 226 | 226 | ||
| 227 | @defvar float-e | ||
| 228 | The mathematical constant @math{e} (2.71828@dots{}). | ||
| 229 | @end defvar | ||
| 230 | |||
| 231 | @defvar float-pi | ||
| 232 | The mathematical constant @math{pi} (3.14159@dots{}). | ||
| 233 | @end defvar | ||
| 234 | |||
| 227 | @node Predicates on Numbers | 235 | @node Predicates on Numbers |
| 228 | @section Type Predicates for Numbers | 236 | @section Type Predicates for Numbers |
| 229 | @cindex predicates for numbers | 237 | @cindex predicates for numbers |
diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi index c8ccb15a2d3..8f72cc01680 100644 --- a/doc/lispref/objects.texi +++ b/doc/lispref/objects.texi | |||
| @@ -582,7 +582,6 @@ makes it invalid as a number. | |||
| 582 | @group | 582 | @group |
| 583 | foo ; @r{A symbol named @samp{foo}.} | 583 | foo ; @r{A symbol named @samp{foo}.} |
| 584 | FOO ; @r{A symbol named @samp{FOO}, different from @samp{foo}.} | 584 | FOO ; @r{A symbol named @samp{FOO}, different from @samp{foo}.} |
| 585 | char-to-string ; @r{A symbol named @samp{char-to-string}.} | ||
| 586 | @end group | 585 | @end group |
| 587 | @group | 586 | @group |
| 588 | 1+ ; @r{A symbol named @samp{1+}} | 587 | 1+ ; @r{A symbol named @samp{1+}} |
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 1128ca87d8a..94d2765a833 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi | |||
| @@ -126,9 +126,8 @@ This function returns a string made up of @var{count} repetitions of | |||
| 126 | @result{} "" | 126 | @result{} "" |
| 127 | @end example | 127 | @end example |
| 128 | 128 | ||
| 129 | Other functions to compare with this one include @code{char-to-string} | 129 | Other functions to compare with this one include @code{make-vector} |
| 130 | (@pxref{String Conversion}), @code{make-vector} (@pxref{Vectors}), and | 130 | (@pxref{Vectors}) and @code{make-list} (@pxref{Building Lists}). |
| 131 | @code{make-list} (@pxref{Building Lists}). | ||
| 132 | @end defun | 131 | @end defun |
| 133 | 132 | ||
| 134 | @defun string &rest characters | 133 | @defun string &rest characters |
| @@ -565,38 +564,6 @@ of text characters and general input events | |||
| 565 | (@code{single-key-description} and @code{text-char-description}). These | 564 | (@code{single-key-description} and @code{text-char-description}). These |
| 566 | are used primarily for making help messages. | 565 | are used primarily for making help messages. |
| 567 | 566 | ||
| 568 | @defun char-to-string character | ||
| 569 | @cindex character to string | ||
| 570 | This function returns a new string containing one character, | ||
| 571 | @var{character}. This function is semi-obsolete because the function | ||
| 572 | @code{string} is more general. @xref{Creating Strings}. | ||
| 573 | @end defun | ||
| 574 | |||
| 575 | @defun string-to-char string | ||
| 576 | @cindex string to character | ||
| 577 | This function returns the first character in @var{string}. If the | ||
| 578 | string is empty, the function returns 0. The value is also 0 when the | ||
| 579 | first character of @var{string} is the null character, @acronym{ASCII} code | ||
| 580 | 0. | ||
| 581 | |||
| 582 | @example | ||
| 583 | (string-to-char "ABC") | ||
| 584 | @result{} 65 | ||
| 585 | |||
| 586 | (string-to-char "xyz") | ||
| 587 | @result{} 120 | ||
| 588 | (string-to-char "") | ||
| 589 | @result{} 0 | ||
| 590 | @group | ||
| 591 | (string-to-char "\000") | ||
| 592 | @result{} 0 | ||
| 593 | @end group | ||
| 594 | @end example | ||
| 595 | |||
| 596 | This function may be eliminated in the future if it does not seem useful | ||
| 597 | enough to retain. | ||
| 598 | @end defun | ||
| 599 | |||
| 600 | @defun number-to-string number | 567 | @defun number-to-string number |
| 601 | @cindex integer to string | 568 | @cindex integer to string |
| 602 | @cindex integer to decimal | 569 | @cindex integer to decimal |
| @@ -659,19 +626,39 @@ this function returns 0. | |||
| 659 | @code{string-to-int} is an obsolete alias for this function. | 626 | @code{string-to-int} is an obsolete alias for this function. |
| 660 | @end defun | 627 | @end defun |
| 661 | 628 | ||
| 629 | @defun char-to-string character | ||
| 630 | @cindex character to string | ||
| 631 | This function returns a new string containing one character, | ||
| 632 | @var{character}. This function is semi-obsolete because the function | ||
| 633 | @code{string} is more general. @xref{Creating Strings}. | ||
| 634 | @end defun | ||
| 635 | |||
| 636 | @defun string-to-char string | ||
| 637 | This function returns the first character in @var{string}. This | ||
| 638 | mostly identical to @code{(aref string 0)}, except that it returns 0 | ||
| 639 | if the string is empty. (The value is also 0 when the first character | ||
| 640 | of @var{string} is the null character, @acronym{ASCII} code 0.) This | ||
| 641 | function may be eliminated in the future if it does not seem useful | ||
| 642 | enough to retain. | ||
| 643 | @end defun | ||
| 644 | |||
| 662 | Here are some other functions that can convert to or from a string: | 645 | Here are some other functions that can convert to or from a string: |
| 663 | 646 | ||
| 664 | @table @code | 647 | @table @code |
| 665 | @item concat | 648 | @item concat |
| 666 | @code{concat} can convert a vector or a list into a string. | 649 | This function converts a vector or a list into a string. |
| 667 | @xref{Creating Strings}. | 650 | @xref{Creating Strings}. |
| 668 | 651 | ||
| 669 | @item vconcat | 652 | @item vconcat |
| 670 | @code{vconcat} can convert a string into a vector. @xref{Vector | 653 | This function converts a string into a vector. @xref{Vector |
| 671 | Functions}. | 654 | Functions}. |
| 672 | 655 | ||
| 673 | @item append | 656 | @item append |
| 674 | @code{append} can convert a string into a list. @xref{Building Lists}. | 657 | This function converts a string into a list. @xref{Building Lists}. |
| 658 | |||
| 659 | @item byte-to-string | ||
| 660 | This function converts a byte of character data into a unibyte string. | ||
| 661 | @xref{Converting Representations}. | ||
| 675 | @end table | 662 | @end table |
| 676 | 663 | ||
| 677 | @node Formatting Strings | 664 | @node Formatting Strings |
diff --git a/doc/lispref/symbols.texi b/doc/lispref/symbols.texi index 5bb44ff9675..ccf90e33cd0 100644 --- a/doc/lispref/symbols.texi +++ b/doc/lispref/symbols.texi | |||
| @@ -383,7 +383,7 @@ See @code{documentation} in @ref{Accessing Documentation}, for another | |||
| 383 | example using @code{mapatoms}. | 383 | example using @code{mapatoms}. |
| 384 | @end defun | 384 | @end defun |
| 385 | 385 | ||
| 386 | @defun unintern symbol &optional obarray | 386 | @defun unintern symbol obarray |
| 387 | This function deletes @var{symbol} from the obarray @var{obarray}. If | 387 | This function deletes @var{symbol} from the obarray @var{obarray}. If |
| 388 | @code{symbol} is not actually in the obarray, @code{unintern} does | 388 | @code{symbol} is not actually in the obarray, @code{unintern} does |
| 389 | nothing. If @var{obarray} is @code{nil}, the current obarray is used. | 389 | nothing. If @var{obarray} is @code{nil}, the current obarray is used. |
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index b6723a0bee4..45d358366de 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -87,7 +87,7 @@ buffer is @samp{@@}: | |||
| 87 | 87 | ||
| 88 | @example | 88 | @example |
| 89 | @group | 89 | @group |
| 90 | (char-to-string (char-after 1)) | 90 | (string (char-after 1)) |
| 91 | @result{} "@@" | 91 | @result{} "@@" |
| 92 | @end group | 92 | @end group |
| 93 | @end example | 93 | @end example |
| @@ -122,9 +122,9 @@ but there is no peace. | |||
| 122 | @end group | 122 | @end group |
| 123 | 123 | ||
| 124 | @group | 124 | @group |
| 125 | (char-to-string (preceding-char)) | 125 | (string (preceding-char)) |
| 126 | @result{} "a" | 126 | @result{} "a" |
| 127 | (char-to-string (following-char)) | 127 | (string (following-char)) |
| 128 | @result{} "c" | 128 | @result{} "c" |
| 129 | @end group | 129 | @end group |
| 130 | @end example | 130 | @end example |
| @@ -866,7 +866,7 @@ adds it to the most recent element. It determines automatically (using | |||
| 866 | @code{last-command}) whether the previous command was a kill command, | 866 | @code{last-command}) whether the previous command was a kill command, |
| 867 | and if so appends the killed text to the most recent entry. | 867 | and if so appends the killed text to the most recent entry. |
| 868 | 868 | ||
| 869 | @deffn Command kill-region start end &optional yank-handler | 869 | @deffn Command kill-region start end |
| 870 | This function kills the text in the region defined by @var{start} and | 870 | This function kills the text in the region defined by @var{start} and |
| 871 | @var{end}. The text is deleted but saved in the kill ring, along with | 871 | @var{end}. The text is deleted but saved in the kill ring, along with |
| 872 | its text properties. The value is always @code{nil}. | 872 | its text properties. The value is always @code{nil}. |
| @@ -874,17 +874,10 @@ its text properties. The value is always @code{nil}. | |||
| 874 | In an interactive call, @var{start} and @var{end} are point and | 874 | In an interactive call, @var{start} and @var{end} are point and |
| 875 | the mark. | 875 | the mark. |
| 876 | 876 | ||
| 877 | @c Emacs 19 feature | ||
| 878 | If the buffer or text is read-only, @code{kill-region} modifies the kill | 877 | If the buffer or text is read-only, @code{kill-region} modifies the kill |
| 879 | ring just the same, then signals an error without modifying the buffer. | 878 | ring just the same, then signals an error without modifying the buffer. |
| 880 | This is convenient because it lets the user use a series of kill | 879 | This is convenient because it lets the user use a series of kill |
| 881 | commands to copy text from a read-only buffer into the kill ring. | 880 | commands to copy text from a read-only buffer into the kill ring. |
| 882 | |||
| 883 | If @var{yank-handler} is non-@code{nil}, this puts that value onto | ||
| 884 | the string of killed text, as a @code{yank-handler} text property. | ||
| 885 | @xref{Yanking}. Note that if @var{yank-handler} is @code{nil}, any | ||
| 886 | @code{yank-handler} properties present on the killed text are copied | ||
| 887 | onto the kill ring, like other text properties. | ||
| 888 | @end deffn | 881 | @end deffn |
| 889 | 882 | ||
| 890 | @defopt kill-read-only-ok | 883 | @defopt kill-read-only-ok |
| @@ -1069,7 +1062,7 @@ it returns the entry pointed at by the yanking pointer and does not | |||
| 1069 | move the yanking pointer. | 1062 | move the yanking pointer. |
| 1070 | @end defun | 1063 | @end defun |
| 1071 | 1064 | ||
| 1072 | @defun kill-new string &optional replace yank-handler | 1065 | @defun kill-new string &optional replace |
| 1073 | This function pushes the text @var{string} onto the kill ring and | 1066 | This function pushes the text @var{string} onto the kill ring and |
| 1074 | makes the yanking pointer point to it. It discards the oldest entry | 1067 | makes the yanking pointer point to it. It discards the oldest entry |
| 1075 | if appropriate. It also invokes the value of | 1068 | if appropriate. It also invokes the value of |
| @@ -1078,25 +1071,15 @@ if appropriate. It also invokes the value of | |||
| 1078 | If @var{replace} is non-@code{nil}, then @code{kill-new} replaces the | 1071 | If @var{replace} is non-@code{nil}, then @code{kill-new} replaces the |
| 1079 | first element of the kill ring with @var{string}, rather than pushing | 1072 | first element of the kill ring with @var{string}, rather than pushing |
| 1080 | @var{string} onto the kill ring. | 1073 | @var{string} onto the kill ring. |
| 1081 | |||
| 1082 | If @var{yank-handler} is non-@code{nil}, this puts that value onto | ||
| 1083 | the string of killed text, as a @code{yank-handler} property. | ||
| 1084 | @xref{Yanking}. Note that if @var{yank-handler} is @code{nil}, then | ||
| 1085 | @code{kill-new} copies any @code{yank-handler} properties present on | ||
| 1086 | @var{string} onto the kill ring, as it does with other text properties. | ||
| 1087 | @end defun | 1074 | @end defun |
| 1088 | 1075 | ||
| 1089 | @defun kill-append string before-p &optional yank-handler | 1076 | @defun kill-append string before-p |
| 1090 | This function appends the text @var{string} to the first entry in the | 1077 | This function appends the text @var{string} to the first entry in the |
| 1091 | kill ring and makes the yanking pointer point to the combined entry. | 1078 | kill ring and makes the yanking pointer point to the combined entry. |
| 1092 | Normally @var{string} goes at the end of the entry, but if | 1079 | Normally @var{string} goes at the end of the entry, but if |
| 1093 | @var{before-p} is non-@code{nil}, it goes at the beginning. This | 1080 | @var{before-p} is non-@code{nil}, it goes at the beginning. This |
| 1094 | function also invokes the value of @code{interprogram-cut-function} | 1081 | function also invokes the value of @code{interprogram-cut-function} |
| 1095 | (see below). This handles @var{yank-handler} just like | 1082 | (see below). |
| 1096 | @code{kill-new}, except that if @var{yank-handler} is different from | ||
| 1097 | the @code{yank-handler} property of the first entry of the kill ring, | ||
| 1098 | @code{kill-append} pushes the concatenated string onto the kill ring, | ||
| 1099 | instead of replacing the original first entry with it. | ||
| 1100 | @end defun | 1083 | @end defun |
| 1101 | 1084 | ||
| 1102 | @defvar interprogram-paste-function | 1085 | @defvar interprogram-paste-function |
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index a3a550868f5..20fe4dbc9fa 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi | |||
| @@ -544,21 +544,23 @@ not the buffer-local value. (But you should not be making | |||
| 544 | buffer-local bindings for a symbol that is defined with | 544 | buffer-local bindings for a symbol that is defined with |
| 545 | @code{defconst}.) | 545 | @code{defconst}.) |
| 546 | 546 | ||
| 547 | Here, @code{pi} is a constant that presumably ought not to be changed | 547 | An example of the use of @code{defconst} is Emacs' definition of |
| 548 | by anyone (attempts by the Indiana State Legislature notwithstanding). | 548 | @code{float-pi}---the mathematical constant @math{pi}, which ought not |
| 549 | As the second form illustrates, however, this is only advisory. | 549 | to be changed by anyone (attempts by the Indiana State Legislature |
| 550 | notwithstanding). As the second form illustrates, however, | ||
| 551 | @code{defconst} is only advisory. | ||
| 550 | 552 | ||
| 551 | @example | 553 | @example |
| 552 | @group | 554 | @group |
| 553 | (defconst pi 3.1415 "Pi to five places.") | 555 | (defconst float-pi 3.141592653589793 "The value of Pi.") |
| 554 | @result{} pi | 556 | @result{} float-pi |
| 555 | @end group | 557 | @end group |
| 556 | @group | 558 | @group |
| 557 | (setq pi 3) | 559 | (setq float-pi 3) |
| 558 | @result{} pi | 560 | @result{} float-pi |
| 559 | @end group | 561 | @end group |
| 560 | @group | 562 | @group |
| 561 | pi | 563 | float-pi |
| 562 | @result{} 3 | 564 | @result{} 3 |
| 563 | @end group | 565 | @end group |
| 564 | @end example | 566 | @end example |