]> git.eshelyaron.com Git - emacs.git/commitdiff
(INC_BOTH, DEC_BOTH): In unibyte mode, simply increment bytepos.
authorRichard M. Stallman <rms@gnu.org>
Mon, 16 Feb 1998 03:01:16 +0000 (03:01 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 16 Feb 1998 03:01:16 +0000 (03:01 +0000)
src/charset.h

index 0e91ca574454083b9b62cb4f99f07b9ba20fb305..290ee11ca834f2275b0f8bbcb326a732984a06c7 100644 (file)
@@ -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