diff options
| author | Kenichi Handa | 2002-08-20 03:59:29 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2002-08-20 03:59:29 +0000 |
| commit | feb3066c150a1465094fa608143dba2caaa0afe1 (patch) | |
| tree | c66cca880387972678b29268ef4f4da48246dd63 /src/buffer.h | |
| parent | 3e411074503a75b3cb85da2bdb6d5b42bbf64a38 (diff) | |
| download | emacs-feb3066c150a1465094fa608143dba2caaa0afe1.tar.gz emacs-feb3066c150a1465094fa608143dba2caaa0afe1.zip | |
(_fetch_multibyte_char_len): Extern deleted.
(FETCH_MULTIBYTE_CHAR): Don't use _fetch_multibyte_char_len.
(BUF_FETCH_MULTIBYTE_CHAR): Likewise.
(FETCH_CHAR_AS_MULTIBYTE): New macro.
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/buffer.h b/src/buffer.h index 6d11035bb4e..447c618f77a 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -319,7 +319,6 @@ else | |||
| 319 | 319 | ||
| 320 | /* Variables used locally in FETCH_MULTIBYTE_CHAR. */ | 320 | /* Variables used locally in FETCH_MULTIBYTE_CHAR. */ |
| 321 | extern unsigned char *_fetch_multibyte_char_p; | 321 | extern unsigned char *_fetch_multibyte_char_p; |
| 322 | extern int _fetch_multibyte_char_len; | ||
| 323 | 322 | ||
| 324 | /* Return character code of multi-byte form at position POS. If POS | 323 | /* Return character code of multi-byte form at position POS. If POS |
| 325 | doesn't point the head of valid multi-byte form, only the byte at | 324 | doesn't point the head of valid multi-byte form, only the byte at |
| @@ -328,9 +327,17 @@ extern int _fetch_multibyte_char_len; | |||
| 328 | #define FETCH_MULTIBYTE_CHAR(pos) \ | 327 | #define FETCH_MULTIBYTE_CHAR(pos) \ |
| 329 | (_fetch_multibyte_char_p = (((pos) >= GPT_BYTE ? GAP_SIZE : 0) \ | 328 | (_fetch_multibyte_char_p = (((pos) >= GPT_BYTE ? GAP_SIZE : 0) \ |
| 330 | + (pos) + BEG_ADDR - 1), \ | 329 | + (pos) + BEG_ADDR - 1), \ |
| 331 | _fetch_multibyte_char_len \ | 330 | STRING_CHAR (_fetch_multibyte_char_p, 0)) |
| 332 | = ((pos) >= GPT_BYTE ? ZV_BYTE : GPT_BYTE) - (pos), \ | 331 | |
| 333 | STRING_CHAR (_fetch_multibyte_char_p, _fetch_multibyte_char_len)) | 332 | /* Return character at position POS. If the current buffer is unibyte |
| 333 | and the character is not ASCII, make the returning character | ||
| 334 | multibyte. */ | ||
| 335 | |||
| 336 | #define FETCH_CHAR_AS_MULTIBYTE(pos) \ | ||
| 337 | (!NILP (current_buffer->enable_multibyte_characters) \ | ||
| 338 | ? FETCH_MULTIBYTE_CHAR ((pos)) \ | ||
| 339 | : unibyte_char_to_multibyte (FETCH_BYTE ((pos)))) | ||
| 340 | |||
| 334 | 341 | ||
| 335 | /* Macros for accessing a character or byte, | 342 | /* Macros for accessing a character or byte, |
| 336 | or converting between byte positions and addresses, | 343 | or converting between byte positions and addresses, |
| @@ -379,10 +386,7 @@ extern int _fetch_multibyte_char_len; | |||
| 379 | (_fetch_multibyte_char_p \ | 386 | (_fetch_multibyte_char_p \ |
| 380 | = (((pos) >= BUF_GPT_BYTE (buf) ? BUF_GAP_SIZE (buf) : 0) \ | 387 | = (((pos) >= BUF_GPT_BYTE (buf) ? BUF_GAP_SIZE (buf) : 0) \ |
| 381 | + (pos) + BUF_BEG_ADDR (buf) - 1), \ | 388 | + (pos) + BUF_BEG_ADDR (buf) - 1), \ |
| 382 | _fetch_multibyte_char_len \ | 389 | STRING_CHAR (_fetch_multibyte_char_p, 0)) |
| 383 | = (((pos) >= BUF_GPT_BYTE (buf) ? BUF_ZV_BYTE (buf) : BUF_GPT_BYTE (buf)) \ | ||
| 384 | - (pos)), \ | ||
| 385 | STRING_CHAR (_fetch_multibyte_char_p, _fetch_multibyte_char_len)) | ||
| 386 | 390 | ||
| 387 | /* Define the actual buffer data structures. */ | 391 | /* Define the actual buffer data structures. */ |
| 388 | 392 | ||