Mercurial > emacs
changeset 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 | ba17c544eb9e |
children | e646a6ae42cd |
files | src/charset.h |
diffstat | 1 files changed, 18 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/charset.h Mon Feb 16 02:42:49 1998 +0000 +++ b/src/charset.h Mon Feb 16 03:01:16 1998 +0000 @@ -648,22 +648,28 @@ /* 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