]> code.delx.au - gnu-emacs/commitdiff
Add documentation for character name escapes
authorPhilipp Stephani <phst@google.com>
Thu, 21 Apr 2016 21:47:05 +0000 (14:47 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 22 Apr 2016 02:29:40 +0000 (19:29 -0700)
doc/lispref/nonascii.texi
doc/lispref/objects.texi
etc/NEWS

index 9cf3b5750f2a32cfd1d3ebde57eeab0d047b3279..66ad9aca71e55abce0dc121b1db4546d850a00bd 100644 (file)
@@ -633,7 +633,7 @@ This function returns the value of @var{char}'s @var{propname} property.
 @end group
 @group
 ;; U+2163 ROMAN NUMERAL FOUR
-(get-char-code-property ?\u2163 'numeric-value)
+(get-char-code-property ?\N@{ROMAN NUMERAL FOUR@} 'numeric-value)
      @result{} 4
 @end group
 @group
index 324593068d51e2de152fbbf263a2363d88bcfaf5..96b334d2b81abd4616ec18c9f70040f6b17cedb8 100644 (file)
@@ -387,6 +387,16 @@ up to three octal digits; thus, @samp{?\101} for the character
 for the character @kbd{C-b}.  Only characters up to octal code 777 can
 be specified this way.
 
+  Fourthly, you can specify characters by their name.  A character
+name escape sequence consists of a backslash, @samp{N@{}, the Unicode
+character name, and @samp{@}}.  Alternatively, you can also put the
+numeric code point value between the braces, using the syntax
+@samp{\N@{U+nnnn@}}, where @samp{nnnn} denotes between one and eight
+hexadecimal digits.  Thus, @samp{?\N@{LATIN CAPITAL LETTER A@}} and
+@samp{?\N@{U+41@}} both denote the character @kbd{A}.  To simplify
+entering multi-line strings, you can replace spaces in the character
+names by arbitrary non-empty sequence of whitespace (e.g., newlines).
+
   These escape sequences may also be used in strings.  @xref{Non-ASCII
 in Strings}.
 
index 0411f19714111273f91105461305823c730850ca..a9b392265cd6beb09a73b7ed428d82e0107d3cce 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -166,6 +166,11 @@ different group ID.
 *** Support for completing attribute values and bang-rules using the
 'completion-at-point' command.
 
++++
+** Emacs now supports character name escape sequences in character and
+string literals.  The syntax variants \N{character name} and
+\N{U+code} are supported.
+
 \f
 * New Modes and Packages in Emacs 25.2