diff options
| author | Karl Heuer | 1997-11-15 20:22:20 +0000 |
|---|---|---|
| committer | Karl Heuer | 1997-11-15 20:22:20 +0000 |
| commit | fb9117773df724c8db96c544958374d953ca0012 (patch) | |
| tree | bd0dbda60ae709110fb33efc9b157256ce8f7706 /src | |
| parent | 4feb31b211710cb8e646bdc11bc090804c1bbf34 (diff) | |
| download | emacs-fb9117773df724c8db96c544958374d953ca0012.tar.gz emacs-fb9117773df724c8db96c544958374d953ca0012.zip | |
(position_indentation): Detect non-breaking space,
in either single-byte form or multibyte form (using category ' ').
Diffstat (limited to 'src')
| -rw-r--r-- | src/indent.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/indent.c b/src/indent.c index 3a8cce764df..b6806f628f7 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -23,6 +23,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 23 | #include "lisp.h" | 23 | #include "lisp.h" |
| 24 | #include "buffer.h" | 24 | #include "buffer.h" |
| 25 | #include "charset.h" | 25 | #include "charset.h" |
| 26 | #include "category.h" | ||
| 26 | #include "indent.h" | 27 | #include "indent.h" |
| 27 | #include "frame.h" | 28 | #include "frame.h" |
| 28 | #include "window.h" | 29 | #include "window.h" |
| @@ -680,6 +681,9 @@ position_indentation (pos) | |||
| 680 | } | 681 | } |
| 681 | switch (*p++) | 682 | switch (*p++) |
| 682 | { | 683 | { |
| 684 | case 0240: | ||
| 685 | if (! NILP (current_buffer->enable_multibyte_characters)) | ||
| 686 | return column; | ||
| 683 | case ' ': | 687 | case ' ': |
| 684 | column++; | 688 | column++; |
| 685 | break; | 689 | break; |
| @@ -687,7 +691,21 @@ position_indentation (pos) | |||
| 687 | column += tab_width - column % tab_width; | 691 | column += tab_width - column % tab_width; |
| 688 | break; | 692 | break; |
| 689 | default: | 693 | default: |
| 690 | return column; | 694 | if (ASCII_BYTE_P (p[-1]) |
| 695 | || NILP (current_buffer->enable_multibyte_characters)) | ||
| 696 | return column; | ||
| 697 | { | ||
| 698 | int pos = PTR_CHAR_POS (p - 1); | ||
| 699 | int c = FETCH_MULTIBYTE_CHAR (pos); | ||
| 700 | if (CHAR_HAS_CATEGORY (c, ' ')) | ||
| 701 | { | ||
| 702 | column++; | ||
| 703 | INC_POS (pos); | ||
| 704 | p = POS_ADDR (pos); | ||
| 705 | } | ||
| 706 | else | ||
| 707 | return column; | ||
| 708 | } | ||
| 691 | } | 709 | } |
| 692 | } | 710 | } |
| 693 | } | 711 | } |