aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref
diff options
context:
space:
mode:
authorChong Yidong2010-11-27 15:04:57 -0500
committerChong Yidong2010-11-27 15:04:57 -0500
commit07976ae3b816dea4fd541bbba862603d3132eb2c (patch)
tree4a437b7cb3abb01fb144530a130c991882a1b7f2 /doc/lispref
parent9610796712a3bc43730c99005906571a2c0bccbd (diff)
parent402c8a49571227f8a4e678d4a6cdd6ba7841aef9 (diff)
downloademacs-07976ae3b816dea4fd541bbba862603d3132eb2c.tar.gz
emacs-07976ae3b816dea4fd541bbba862603d3132eb2c.zip
Merge changes from emacs-23 branch
Diffstat (limited to 'doc/lispref')
-rw-r--r--doc/lispref/ChangeLog30
-rw-r--r--doc/lispref/functions.texi2
-rw-r--r--doc/lispref/help.texi2
-rw-r--r--doc/lispref/nonascii.texi7
-rw-r--r--doc/lispref/numbers.texi8
-rw-r--r--doc/lispref/objects.texi1
-rw-r--r--doc/lispref/strings.texi63
-rw-r--r--doc/lispref/symbols.texi2
-rw-r--r--doc/lispref/text.texi31
-rw-r--r--doc/lispref/variables.texi18
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 @@
12010-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
172010-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
12010-11-26 Eli Zaretskii <eliz@gnu.org> 312010-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
199characters. 199characters.
200@end defun 200@end defun
201 201
202@defun byte-to-string byte
203@cindex byte to string
204This function returns a unibyte string containing a single byte of
205character 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
203This converts the multibyte character @var{char} to a unibyte 210This converts the multibyte character @var{char} to a unibyte
204character, and returns that character. If @var{char} is neither 211character, 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
228The mathematical constant @math{e} (2.71828@dots{}).
229@end defvar
230
231@defvar float-pi
232The 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
583foo ; @r{A symbol named @samp{foo}.} 583foo ; @r{A symbol named @samp{foo}.}
584FOO ; @r{A symbol named @samp{FOO}, different from @samp{foo}.} 584FOO ; @r{A symbol named @samp{FOO}, different from @samp{foo}.}
585char-to-string ; @r{A symbol named @samp{char-to-string}.}
586@end group 585@end group
587@group 586@group
5881+ ; @r{A symbol named @samp{1+}} 5871+ ; @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
566are used primarily for making help messages. 565are used primarily for making help messages.
567 566
568@defun char-to-string character
569@cindex character to string
570This 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
578string is empty, the function returns 0. The value is also 0 when the
579first character of @var{string} is the null character, @acronym{ASCII} code
5800.
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
596This function may be eliminated in the future if it does not seem useful
597enough 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
631This 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
638mostly identical to @code{(aref string 0)}, except that it returns 0
639if the string is empty. (The value is also 0 when the first character
640of @var{string} is the null character, @acronym{ASCII} code 0.) This
641function may be eliminated in the future if it does not seem useful
642enough 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. 649This 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 653This function converts a string into a vector. @xref{Vector
671Functions}. 654Functions}.
672 655
673@item append 656@item append
674@code{append} can convert a string into a list. @xref{Building Lists}. 657This function converts a string into a list. @xref{Building Lists}.
658
659@item byte-to-string
660This 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
383example using @code{mapatoms}. 383example using @code{mapatoms}.
384@end defun 384@end defun
385 385
386@defun unintern symbol &optional obarray 386@defun unintern symbol obarray
387This function deletes @var{symbol} from the obarray @var{obarray}. If 387This 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
389nothing. If @var{obarray} is @code{nil}, the current obarray is used. 389nothing. 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,
867and if so appends the killed text to the most recent entry. 867and 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
870This function kills the text in the region defined by @var{start} and 870This 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
872its text properties. The value is always @code{nil}. 872its text properties. The value is always @code{nil}.
@@ -874,17 +874,10 @@ its text properties. The value is always @code{nil}.
874In an interactive call, @var{start} and @var{end} are point and 874In an interactive call, @var{start} and @var{end} are point and
875the mark. 875the mark.
876 876
877@c Emacs 19 feature
878If the buffer or text is read-only, @code{kill-region} modifies the kill 877If the buffer or text is read-only, @code{kill-region} modifies the kill
879ring just the same, then signals an error without modifying the buffer. 878ring just the same, then signals an error without modifying the buffer.
880This is convenient because it lets the user use a series of kill 879This is convenient because it lets the user use a series of kill
881commands to copy text from a read-only buffer into the kill ring. 880commands to copy text from a read-only buffer into the kill ring.
882
883If @var{yank-handler} is non-@code{nil}, this puts that value onto
884the 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
887onto 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
1069move the yanking pointer. 1062move 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
1073This function pushes the text @var{string} onto the kill ring and 1066This function pushes the text @var{string} onto the kill ring and
1074makes the yanking pointer point to it. It discards the oldest entry 1067makes the yanking pointer point to it. It discards the oldest entry
1075if appropriate. It also invokes the value of 1068if appropriate. It also invokes the value of
@@ -1078,25 +1071,15 @@ if appropriate. It also invokes the value of
1078If @var{replace} is non-@code{nil}, then @code{kill-new} replaces the 1071If @var{replace} is non-@code{nil}, then @code{kill-new} replaces the
1079first element of the kill ring with @var{string}, rather than pushing 1072first 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
1082If @var{yank-handler} is non-@code{nil}, this puts that value onto
1083the 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
1090This function appends the text @var{string} to the first entry in the 1077This function appends the text @var{string} to the first entry in the
1091kill ring and makes the yanking pointer point to the combined entry. 1078kill ring and makes the yanking pointer point to the combined entry.
1092Normally @var{string} goes at the end of the entry, but if 1079Normally @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
1094function also invokes the value of @code{interprogram-cut-function} 1081function 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
1097the @code{yank-handler} property of the first entry of the kill ring,
1098@code{kill-append} pushes the concatenated string onto the kill ring,
1099instead 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
544buffer-local bindings for a symbol that is defined with 544buffer-local bindings for a symbol that is defined with
545@code{defconst}.) 545@code{defconst}.)
546 546
547Here, @code{pi} is a constant that presumably ought not to be changed 547An example of the use of @code{defconst} is Emacs' definition of
548by anyone (attempts by the Indiana State Legislature notwithstanding). 548@code{float-pi}---the mathematical constant @math{pi}, which ought not
549As the second form illustrates, however, this is only advisory. 549to be changed by anyone (attempts by the Indiana State Legislature
550notwithstanding). 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
561pi 563float-pi
562 @result{} 3 564 @result{} 3
563@end group 565@end group
564@end example 566@end example