]> code.delx.au - gnu-emacs/blobdiff - src/abbrev.c
Merge from emacs--devo--0
[gnu-emacs] / src / abbrev.c
index 7dea6969f358e972b270ca5cd2789a909a39cbce..8e9bd143089ee7c88e4f2de1c92335e0970385b5 100644 (file)
@@ -27,7 +27,7 @@ Boston, MA 02110-1301, USA.  */
 #include "commands.h"
 #include "buffer.h"
 #include "window.h"
-#include "charset.h"
+#include "character.h"
 #include "syntax.h"
 
 /* An abbrev table is an obarray.
@@ -400,9 +400,15 @@ Returns the abbrev symbol, if expansion took place.  */)
          int pos = wordstart_byte;
 
          /* Find the initial.  */
-         while (pos < PT_BYTE
-                && SYNTAX (*BUF_BYTE_ADDRESS (current_buffer, pos)) != Sword)
-           pos++;
+         if (multibyte)
+           while (pos < PT_BYTE
+                  && SYNTAX (FETCH_MULTIBYTE_CHAR (pos)) != Sword)
+             INC_POS (pos);
+         else
+           while (pos < PT_BYTE
+                  && (SYNTAX (*BUF_BYTE_ADDRESS (current_buffer, pos))
+                      != Sword))
+             pos++;
 
          /* Change just that.  */
          pos = BYTE_TO_CHAR (pos);