Mercurial > emacs
changeset 20256:f75208097eb5
(position_indentation): Detect non-breaking space,
in either single-byte form or multibyte form (using category ' ').
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Sat, 15 Nov 1997 20:22:20 +0000 |
parents | 8c8f90c95569 |
children | 7ba68c0e1bee |
files | src/indent.c |
diffstat | 1 files changed, 19 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/indent.c Sat Nov 15 20:16:49 1997 +0000 +++ b/src/indent.c Sat Nov 15 20:22:20 1997 +0000 @@ -23,6 +23,7 @@ #include "lisp.h" #include "buffer.h" #include "charset.h" +#include "category.h" #include "indent.h" #include "frame.h" #include "window.h" @@ -680,6 +681,9 @@ } switch (*p++) { + case 0240: + if (! NILP (current_buffer->enable_multibyte_characters)) + return column; case ' ': column++; break; @@ -687,7 +691,21 @@ 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; + } } } }