comparison src/charset.h @ 20904:79d73f468e38

(INC_BOTH, DEC_BOTH): In unibyte mode, simply increment bytepos.
author Richard M. Stallman <rms@gnu.org>
date Mon, 16 Feb 1998 03:01:16 +0000
parents e3cf980dad70
children 3c2c8431c51d
comparison
equal deleted inserted replaced
20903:ba17c544eb9e 20904:79d73f468e38
646 if (*p < 0x80 && pos != pos_saved) pos = pos_saved; \ 646 if (*p < 0x80 && pos != pos_saved) pos = pos_saved; \
647 } while (0) 647 } while (0)
648 648
649 /* Increment both CHARPOS and BYTEPOS, each in the appropriate way. */ 649 /* Increment both CHARPOS and BYTEPOS, each in the appropriate way. */
650 650
651 #define INC_BOTH(charpos, bytepos) \ 651 #define INC_BOTH(charpos, bytepos) \
652 do \ 652 do \
653 { \ 653 { \
654 (charpos)++; \ 654 (charpos)++; \
655 INC_POS ((bytepos)); \ 655 if (NILP (current_buffer->enable_multibyte_characters)) \
656 } \ 656 (bytepos)++; \
657 else \
658 INC_POS ((bytepos)); \
659 } \
657 while (0) 660 while (0)
658 661
659 /* Decrement both CHARPOS and BYTEPOS, each in the appropriate way. */ 662 /* Decrement both CHARPOS and BYTEPOS, each in the appropriate way. */
660 663
661 #define DEC_BOTH(charpos, bytepos) \ 664 #define DEC_BOTH(charpos, bytepos) \
662 do \ 665 do \
663 { \ 666 { \
664 (charpos)--; \ 667 (charpos)--; \
665 DEC_POS ((bytepos)); \ 668 if (NILP (current_buffer->enable_multibyte_characters)) \
666 } \ 669 (bytepos)--; \
670 else \
671 DEC_POS ((bytepos)); \
672 } \
667 while (0) 673 while (0)
668 674
669 /* Increase the buffer point POS of the current buffer to the next 675 /* Increase the buffer point POS of the current buffer to the next
670 character boundary. This macro relies on the fact that *GPT_ADDR 676 character boundary. This macro relies on the fact that *GPT_ADDR
671 and *Z_ADDR are always accessible and the values are '\0'. No 677 and *Z_ADDR are always accessible and the values are '\0'. No