aboutsummaryrefslogtreecommitdiffstats
path: root/src/character.h
diff options
context:
space:
mode:
authorPaul Eggert2012-04-09 15:54:59 -0700
committerPaul Eggert2012-04-09 15:54:59 -0700
commit45e9f7da84c1bd3fc0d36d05c5708ed3b2d3a193 (patch)
tree5bc87a8b5a3c754b8eb44a612cc6c03561d6b968 /src/character.h
parent9d6b4d53469a9ffd67bd770fabc6fe254e35c21d (diff)
parent05920a43fc18e696b464387e781e7cfdcea5b5af (diff)
downloademacs-45e9f7da84c1bd3fc0d36d05c5708ed3b2d3a193.tar.gz
emacs-45e9f7da84c1bd3fc0d36d05c5708ed3b2d3a193.zip
Merge from trunk.
Diffstat (limited to 'src/character.h')
-rw-r--r--src/character.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/character.h b/src/character.h
index cc76ab213fc..d2a7a11fa56 100644
--- a/src/character.h
+++ b/src/character.h
@@ -292,7 +292,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
292 } while (0) 292 } while (0)
293 293
294/* Return the character code of character whose multibyte form is at 294/* Return the character code of character whose multibyte form is at
295 P. */ 295 P. Note that this macro unifies CJK characters whose codepoints
296 are in the Private Use Areas (PUAs), so it might return a different
297 codepoint from the one actually stored at P. */
296 298
297#define STRING_CHAR(p) \ 299#define STRING_CHAR(p) \
298 (!((p)[0] & 0x80) \ 300 (!((p)[0] & 0x80) \
@@ -309,7 +311,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
309 311
310 312
311/* Like STRING_CHAR, but set ACTUAL_LEN to the length of multibyte 313/* Like STRING_CHAR, but set ACTUAL_LEN to the length of multibyte
312 form. */ 314 form.
315
316 Note: This macro returns the actual length of the character's
317 multibyte sequence as it is stored in a buffer or string. The
318 character it returns might have a different codepoint that has a
319 different multibyte sequence of a different legth, due to possible
320 unification of CJK characters inside string_char. Therefore do NOT
321 assume that the length returned by this macro is identical to the
322 length of the multibyte sequence of the character it returns. */
313 323
314#define STRING_CHAR_AND_LENGTH(p, actual_len) \ 324#define STRING_CHAR_AND_LENGTH(p, actual_len) \
315 (!((p)[0] & 0x80) \ 325 (!((p)[0] & 0x80) \