Index: docs/tmpl/main.sgml
===================================================================
RCS file: /cvs/gnome/pango/docs/tmpl/main.sgml,v
retrieving revision 1.29
diff -u -p -u -r1.29 main.sgml
--- docs/tmpl/main.sgml	2 Aug 2003 18:18:29 -0000	1.29
+++ docs/tmpl/main.sgml	14 Aug 2003 16:26:50 -0000
@@ -308,6 +308,18 @@ about the attributes of a single charact
 @is_sentence_boundary: 
 @is_sentence_start: 
 @is_sentence_end: 
+@backspace_deletes_character: If set, backspace deletes one character
+                              rather than the entire grapheme cluster. This
+                              field is only meaningful on grapheme
+                              boundaries (where @is_cursor_position is
+                              set).  In some languages, the full grapheme
+                              (e.g.  letter + diacritics) is considered a
+                              unit, while in others, each decomposed
+                              character in the grapheme is a unit. In the
+                              default implementation of #pango_break, this
+                              bit is set on all grapheme boundaries except
+                              those following Latin, Cyrillic or Greek base
+                              characters.
 
 <!-- ##### FUNCTION pango_shape ##### -->
 <para>
Index: pango/break.c
===================================================================
RCS file: /cvs/gnome/pango/pango/break.c,v
retrieving revision 1.21
diff -u -p -u -r1.21 break.c
--- pango/break.c	3 Aug 2003 21:57:33 -0000	1.21
+++ pango/break.c	14 Aug 2003 16:26:50 -0000
@@ -328,6 +328,11 @@ static int line_break_indexes[] = {
 #define HIRAGANA(wc) ((wc) >= 0x3040 && (wc) <= 0x309F)
 #define KATAKANA(wc) ((wc) >= 0x30A0 && (wc) <= 0x30FF)
 
+#define LATIN(wc) (((wc) >= 0x0020 && (wc) <= 0x02AF) || ((wc) >= 0x1E00 && (wc) <= 0x1EFF))
+#define CYRILLIC(wc) (((wc) >= 0x0400 && (wc) <= 0x052F))
+#define GREEK(wc) (((wc) >= 0x0370 && (wc) <= 0x3FF) || ((wc) >= 0x1F00 && (wc) <= 0x1FFF))
+#define BACKSPACE_DELETES_CHARACTER(wc) (!LATIN (wc) && !CYRILLIC (wc) && !GREEK (wc))
+
 
 /* p. 132-133 of Unicode spec table 5-6 will help understand this */
 typedef enum
@@ -406,6 +411,7 @@ pango_default_break (const gchar   *text
   gboolean prev_was_break_space;
   WordType current_word_type = WordNone;
   gunichar last_word_letter = 0;
+  gunichar base_character = 0;
   SentenceState sentence_state = STATE_SENTENCE_OUTSIDE;
   /* Tracks what will be the end of the sentence if a period is
    * determined to actually be a sentence-ending period.
@@ -598,6 +604,13 @@ pango_default_break (const gchar   *text
             }
         }
       
+      /* If this is a grapheme boundary, we have to decide if backspace
+       * deletes a character or the whole grapheme cluster */
+      if (attrs[i].is_cursor_position)
+        attrs[i].backspace_deletes_character = BACKSPACE_DELETES_CHARACTER (base_character);
+      else
+        attrs[i].backspace_deletes_character = FALSE;
+
       /* ---- Line breaking ---- */
 
       break_type = g_unichar_break_type (wc);
@@ -1277,6 +1290,13 @@ pango_default_break (const gchar   *text
 
       prev_type = type;
       prev_wc = wc;
+
+      /* wc might not be a valid unicode base character, but really all we
+       * need to know is the last non-combining character */
+      if (type != G_UNICODE_COMBINING_MARK && 
+          type != G_UNICODE_ENCLOSING_MARK && 
+          type != G_UNICODE_NON_SPACING_MARK)
+        base_character = wc;
     }
 }
 
Index: pango/pango-break.h
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-break.h,v
retrieving revision 1.5
diff -u -p -u -r1.5 pango-break.h
--- pango/pango-break.h	3 Oct 2001 20:29:55 -0000	1.5
+++ pango/pango-break.h	14 Aug 2003 16:26:50 -0000
@@ -64,6 +64,11 @@ struct _PangoLogAttr
   guint is_sentence_boundary : 1;
   guint is_sentence_start : 1;  /* first character in a sentence */
   guint is_sentence_end : 1;    /* first non-sentence char after a sentence */
+
+  /* if set, backspace deletes one character rather than
+   * the entire grapheme cluster  
+   */
+  guint backspace_deletes_character : 1; 
 };
 
 /* Determine information about cluster/word/line breaks in a string
