diff options
| author | Paul Eggert | 2012-04-09 15:54:59 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-04-09 15:54:59 -0700 |
| commit | 45e9f7da84c1bd3fc0d36d05c5708ed3b2d3a193 (patch) | |
| tree | 5bc87a8b5a3c754b8eb44a612cc6c03561d6b968 /src/buffer.h | |
| parent | 9d6b4d53469a9ffd67bd770fabc6fe254e35c21d (diff) | |
| parent | 05920a43fc18e696b464387e781e7cfdcea5b5af (diff) | |
| download | emacs-45e9f7da84c1bd3fc0d36d05c5708ed3b2d3a193.tar.gz emacs-45e9f7da84c1bd3fc0d36d05c5708ed3b2d3a193.zip | |
Merge from trunk.
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/buffer.h b/src/buffer.h index c75a09c5579..97d891f044b 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -343,7 +343,8 @@ while (0) | |||
| 343 | - (ptr - (current_buffer)->text->beg <= GPT_BYTE - BEG_BYTE ? 0 : GAP_SIZE) \ | 343 | - (ptr - (current_buffer)->text->beg <= GPT_BYTE - BEG_BYTE ? 0 : GAP_SIZE) \ |
| 344 | + BEG_BYTE) | 344 | + BEG_BYTE) |
| 345 | 345 | ||
| 346 | /* Return character at byte position POS. */ | 346 | /* Return character at byte position POS. See the caveat WARNING for |
| 347 | FETCH_MULTIBYTE_CHAR below. */ | ||
| 347 | 348 | ||
| 348 | #define FETCH_CHAR(pos) \ | 349 | #define FETCH_CHAR(pos) \ |
| 349 | (!NILP (BVAR (current_buffer, enable_multibyte_characters)) \ | 350 | (!NILP (BVAR (current_buffer, enable_multibyte_characters)) \ |
| @@ -359,7 +360,17 @@ extern unsigned char *_fetch_multibyte_char_p; | |||
| 359 | 360 | ||
| 360 | /* Return character code of multi-byte form at byte position POS. If POS | 361 | /* Return character code of multi-byte form at byte position POS. If POS |
| 361 | doesn't point the head of valid multi-byte form, only the byte at | 362 | doesn't point the head of valid multi-byte form, only the byte at |
| 362 | POS is returned. No range checking. */ | 363 | POS is returned. No range checking. |
| 364 | |||
| 365 | WARNING: The character returned by this macro could be "unified" | ||
| 366 | inside STRING_CHAR, if the original character in the buffer belongs | ||
| 367 | to one of the Private Use Areas (PUAs) of codepoints that Emacs | ||
| 368 | uses to support non-unified CJK characters. If that happens, | ||
| 369 | CHAR_BYTES will return a value that is different from the length of | ||
| 370 | the original multibyte sequence stored in the buffer. Therefore, | ||
| 371 | do _not_ use FETCH_MULTIBYTE_CHAR if you need to advance through | ||
| 372 | the buffer to the next character after fetching this one. Instead, | ||
| 373 | use either FETCH_CHAR_ADVANCE or STRING_CHAR_AND_LENGTH. */ | ||
| 363 | 374 | ||
| 364 | #define FETCH_MULTIBYTE_CHAR(pos) \ | 375 | #define FETCH_MULTIBYTE_CHAR(pos) \ |
| 365 | (_fetch_multibyte_char_p = (((pos) >= GPT_BYTE ? GAP_SIZE : 0) \ | 376 | (_fetch_multibyte_char_p = (((pos) >= GPT_BYTE ? GAP_SIZE : 0) \ |