diff options
| author | Chong Yidong | 2010-11-21 13:07:47 -0500 |
|---|---|---|
| committer | Chong Yidong | 2010-11-21 13:07:47 -0500 |
| commit | 3e99b8257bc97f34595128b200e25b76a2fe560f (patch) | |
| tree | eb054645adbe8b090bfa8244c0e18a1d7b8861fb | |
| parent | 5b9b7ef4489a78fea8f37bcc79385ff234594166 (diff) | |
| download | emacs-3e99b8257bc97f34595128b200e25b76a2fe560f.tar.gz emacs-3e99b8257bc97f34595128b200e25b76a2fe560f.zip | |
Document byte-to-string in Lisp manual.
* objects.texi (Symbol Type):
* text.texi (Near Point):
* help.texi (Help Functions):
* functions.texi (Mapping Functions): Use string instead of
char-to-string in examples.
* nonascii.texi (Converting Representations): Document
byte-to-string.
* strings.texi (Creating Strings): Don't mention semi-obsolete
function char-to-string.
(String Conversion): Shorten discussion of semi-obsolete function
string-to-char. Link to Converting Representations.
| -rw-r--r-- | doc/lispref/ChangeLog | 16 | ||||
| -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/objects.texi | 1 | ||||
| -rw-r--r-- | doc/lispref/strings.texi | 63 | ||||
| -rw-r--r-- | doc/lispref/text.texi | 6 | ||||
| -rw-r--r-- | etc/NEWS | 1 |
8 files changed, 54 insertions, 44 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 2ea15fe3ca8..959f4844c1c 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,19 @@ | |||
| 1 | 2010-11-21 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 | |||
| 1 | 2010-11-20 Chong Yidong <cyd@stupidchicken.com> | 17 | 2010-11-20 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 18 | ||
| 3 | * text.texi (Kill Functions, Kill Functions) | 19 | * text.texi (Kill Functions, Kill Functions) |
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 026258f2472..31a4db31dc9 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi | |||
| @@ -551,7 +551,7 @@ follows: | |||
| 551 | 551 | ||
| 552 | @smallexample | 552 | @smallexample |
| 553 | @group | 553 | @group |
| 554 | (define-key global-map (char-to-string help-char) 'help-command) | 554 | (define-key global-map (string help-char) 'help-command) |
| 555 | (fset 'help-command help-map) | 555 | (fset 'help-command help-map) |
| 556 | @end group | 556 | @end group |
| 557 | @end smallexample | 557 | @end smallexample |
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi index dfcb3e4730b..f8d98cb1ad9 100644 --- a/doc/lispref/nonascii.texi +++ b/doc/lispref/nonascii.texi | |||
| @@ -202,6 +202,13 @@ unibyte string, it is returned unchanged. Use this function for | |||
| 202 | characters. | 202 | characters. |
| 203 | @end defun | 203 | @end defun |
| 204 | 204 | ||
| 205 | @defun byte-to-string byte | ||
| 206 | @cindex byte to string | ||
| 207 | This function returns a unibyte string containing a single byte of | ||
| 208 | character data, @var{character}. It signals a error if | ||
| 209 | @var{character} is not an integer between 0 and 255. | ||
| 210 | @end defun | ||
| 211 | |||
| 205 | @defun multibyte-char-to-unibyte char | 212 | @defun multibyte-char-to-unibyte char |
| 206 | This converts the multibyte character @var{char} to a unibyte | 213 | This converts the multibyte character @var{char} to a unibyte |
| 207 | character, and returns that character. If @var{char} is neither | 214 | character, and returns that character. If @var{char} is neither |
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/text.texi b/doc/lispref/text.texi index 025bf1b6f85..57bf4825887 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -86,7 +86,7 @@ buffer is @samp{@@}: | |||
| 86 | 86 | ||
| 87 | @example | 87 | @example |
| 88 | @group | 88 | @group |
| 89 | (char-to-string (char-after 1)) | 89 | (string (char-after 1)) |
| 90 | @result{} "@@" | 90 | @result{} "@@" |
| 91 | @end group | 91 | @end group |
| 92 | @end example | 92 | @end example |
| @@ -121,9 +121,9 @@ but there is no peace. | |||
| 121 | @end group | 121 | @end group |
| 122 | 122 | ||
| 123 | @group | 123 | @group |
| 124 | (char-to-string (preceding-char)) | 124 | (string (preceding-char)) |
| 125 | @result{} "a" | 125 | @result{} "a" |
| 126 | (char-to-string (following-char)) | 126 | (string (following-char)) |
| 127 | @result{} "c" | 127 | @result{} "c" |
| 128 | @end group | 128 | @end group |
| 129 | @end example | 129 | @end example |
| @@ -108,6 +108,7 @@ starting from the first line of text below the header line. | |||
| 108 | +++ | 108 | +++ |
| 109 | ** The yank-handler argument to kill-region and friends is now obsolete. | 109 | ** The yank-handler argument to kill-region and friends is now obsolete. |
| 110 | 110 | ||
| 111 | +++ | ||
| 111 | ** New function byte-to-string, like char-to-string but for bytes. | 112 | ** New function byte-to-string, like char-to-string but for bytes. |
| 112 | 113 | ||
| 113 | 114 | ||