From: Richard M. Stallman Date: Mon, 16 Feb 1998 03:01:16 +0000 (+0000) Subject: (INC_BOTH, DEC_BOTH): In unibyte mode, simply increment bytepos. X-Git-Tag: emacs-20.3~2170 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d619ee06f24e8487f40040805be945e979c111d3;p=emacs.git (INC_BOTH, DEC_BOTH): In unibyte mode, simply increment bytepos. --- diff --git a/src/charset.h b/src/charset.h index 0e91ca57445..290ee11ca83 100644 --- a/src/charset.h +++ b/src/charset.h @@ -648,22 +648,28 @@ else /* Increment both CHARPOS and BYTEPOS, each in the appropriate way. */ -#define INC_BOTH(charpos, bytepos) \ -do \ - { \ - (charpos)++; \ - INC_POS ((bytepos)); \ - } \ +#define INC_BOTH(charpos, bytepos) \ +do \ + { \ + (charpos)++; \ + if (NILP (current_buffer->enable_multibyte_characters)) \ + (bytepos)++; \ + else \ + INC_POS ((bytepos)); \ + } \ while (0) /* Decrement both CHARPOS and BYTEPOS, each in the appropriate way. */ -#define DEC_BOTH(charpos, bytepos) \ -do \ - { \ - (charpos)--; \ - DEC_POS ((bytepos)); \ - } \ +#define DEC_BOTH(charpos, bytepos) \ +do \ + { \ + (charpos)--; \ + if (NILP (current_buffer->enable_multibyte_characters)) \ + (bytepos)--; \ + else \ + DEC_POS ((bytepos)); \ + } \ while (0) /* Increase the buffer point POS of the current buffer to the next