aboutsummaryrefslogtreecommitdiffstats
path: root/lispref/strings.texi
diff options
context:
space:
mode:
Diffstat (limited to 'lispref/strings.texi')
-rw-r--r--lispref/strings.texi25
1 files changed, 25 insertions, 0 deletions
diff --git a/lispref/strings.texi b/lispref/strings.texi
index 23f679d5bb9..af5a2fa14d3 100644
--- a/lispref/strings.texi
+++ b/lispref/strings.texi
@@ -586,6 +586,7 @@ first character of @var{string} is the null character, @acronym{ASCII} code
586@example 586@example
587(string-to-char "ABC") 587(string-to-char "ABC")
588 @result{} 65 588 @result{} 65
589
589(string-to-char "xyz") 590(string-to-char "xyz")
590 @result{} 120 591 @result{} 120
591(string-to-char "") 592(string-to-char "")
@@ -1107,6 +1108,30 @@ This function returns the current buffer's case table.
1107This sets the current buffer's case table to @var{table}. 1108This sets the current buffer's case table to @var{table}.
1108@end defun 1109@end defun
1109 1110
1111@defmac with-case-table table body@dots{}
1112The @code{with-case-table} macro saves the current case table, makes
1113@var{table} the current case table, evaluates the @var{body} forms,
1114and finally restores the case table. The return value is the value of
1115the last form in @var{body}. The case table is restored even in case
1116of an abnormal exit via @code{throw} or error (@pxref{Nonlocal
1117Exits}).
1118@end defmac
1119
1120 Some language environments may modify the case conversions of
1121@acronym{ASCII} characters; for example, in the Turkish language
1122environment, the @acronym{ASCII} character @samp{I} is downcased into
1123a Turkish ``dotless i''. This can interfere with code that requires
1124ordinary ASCII case conversion, such as implementations of
1125@acronym{ASCII}-based network protocols. In that case, use the
1126@code{with-case-table} macro with the variable @var{ascii-case-table},
1127which stores the unmodified case table for the @acronym{ASCII}
1128character set.
1129
1130@defvar ascii-case-table
1131The case table for the @acronym{ASCII} character set. This should not be
1132modified by any language environment settings.
1133@end defvar
1134
1110 The following three functions are convenient subroutines for packages 1135 The following three functions are convenient subroutines for packages
1111that define non-@acronym{ASCII} character sets. They modify the specified 1136that define non-@acronym{ASCII} character sets. They modify the specified
1112case table @var{case-table}; they also modify the standard syntax table. 1137case table @var{case-table}; they also modify the standard syntax table.