#include "lisp.h"
#include "buffer.h"
#include "charset.h"
+#include "category.h"
#include "indent.h"
#include "frame.h"
#include "window.h"
/* Cancel any recorded value of the horizontal position. */
+void
invalidate_current_column ()
{
last_known_column_point = 0;
}
switch (*p++)
{
+ case 0240:
+ if (! NILP (current_buffer->enable_multibyte_characters))
+ return column;
case ' ':
column++;
break;
column += tab_width - column % tab_width;
break;
default:
- return column;
+ if (ASCII_BYTE_P (p[-1])
+ || NILP (current_buffer->enable_multibyte_characters))
+ return column;
+ {
+ int pos = PTR_CHAR_POS (p - 1);
+ int c = FETCH_MULTIBYTE_CHAR (pos);
+ if (CHAR_HAS_CATEGORY (c, ' '))
+ {
+ column++;
+ INC_POS (pos);
+ p = POS_ADDR (pos);
+ }
+ else
+ return column;
+ }
}
}
}
}
}
- if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c)))
+ if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c))
+ && ! (multibyte && BASE_LEADING_CODE_P (c)))
hpos += XVECTOR (DISP_CHAR_VECTOR (dp, c))->size;
else if (c >= 040 && c < 0177)
hpos++;