diff -Nrpu emacs-23.2.orig/lisp/term/ns-win.el emacs-23.2/lisp/term/ns-win.el
--- emacs-23.2.orig/lisp/term/ns-win.el	2010-04-04 07:26:08.000000000 +0900
+++ emacs-23.2/lisp/term/ns-win.el	2010-10-28 23:33:11.000000000 +0900
@@ -551,10 +551,19 @@ The properties returned may include `top
   "Face used to highlight working text during compose sequence insert."
   :group 'ns)
 
+(defface ns-active-clause-face
+  '((t :inherit ns-working-text-face :inverse-video t))
+  "Face used to highlight active clause of working text during compose sequence insert."
+  :group 'ns)
+
 (defvar ns-working-overlay nil
   "Overlay used to highlight working text during compose sequence insert.
 When text is in th echo area, this just stores the length of the working text.")
 
+(defvar ns-active-clause-overlay nil
+  "Overlay used to highlight active clause of working text during compose sequence insert.
+When text is in th echo area, this just stores the length of the working text.")
+
 (defvar ns-working-text)		; nsterm.m
 
 ;; Test if in echo area, based on mac-win.el 2007/08/26 unicode-2.
@@ -593,11 +602,20 @@ The overlay is assigned the face `ns-wor
   ;;  and if text is bound to a command, execute that instead (Bug#1453)
   (interactive)
   (ns-delete-working-text)
-  (let ((start (point)))
+  (let* ((start (point))
+         (ac-start (+ start (car ns-range-of-active-clause)))
+         (ac-end   (+ start (cdr ns-range-of-active-clause))))
     (insert ns-working-text)
     (overlay-put (setq ns-working-overlay (make-overlay start (point)
 							(current-buffer) nil t))
-		 'face 'ns-working-text-face)))
+		 'face 'ns-working-text-face)
+    (overlay-put (setq ns-active-clause-overlay
+                       (make-overlay ac-start
+                                     ac-end
+                                     nil t))
+                 'face 'ns-active-clause-face)
+    (when (= ac-start ac-end)
+      (goto-char ac-end))))
 
 (defun ns-echo-working-text ()
   "Echo contents of `ns-working-text' in message display area.
@@ -622,7 +640,8 @@ See `ns-insert-working-text'."
     (with-current-buffer (overlay-buffer ns-working-overlay)
       (delete-region (overlay-start ns-working-overlay)
                      (overlay-end ns-working-overlay))
-      (delete-overlay ns-working-overlay)))
+      (delete-overlay ns-working-overlay)
+      (delete-overlay ns-active-clause-overlay)))
    ((integerp ns-working-overlay)
     (let ((msg (current-message))
           message-log-max)
diff -Nrpu emacs-23.2.orig/src/nsterm.m emacs-23.2/src/nsterm.m
--- emacs-23.2.orig/src/nsterm.m	2010-04-04 07:26:04.000000000 +0900
+++ emacs-23.2/src/nsterm.m	2010-10-28 23:32:53.000000000 +0900
@@ -138,6 +138,7 @@ static unsigned convert_ns_to_X_keysym[]
 /* Lisp communications */
 Lisp_Object ns_input_file, ns_input_font, ns_input_fontsize, ns_input_line;
 Lisp_Object ns_input_color, ns_input_text, ns_working_text;
+Lisp_Object ns_range_of_active_clause;
 Lisp_Object ns_input_spi_name, ns_input_spi_arg;
 Lisp_Object Vx_toolkit_scroll_bars;
 static Lisp_Object Qmodifier_value;
@@ -4575,6 +4576,21 @@ ns_term_shutdown (int sig)
   workingText = [str copy];
   ns_working_text = build_string ([workingText UTF8String]);
 
+  /* NSString seems to be counting number of UTF-16 code units instead of
+     number of characters when calculating length of strings.
+     This causes NSString to count length of a non-BMP character as two,
+     not as one.
+     
+     Emacs expects that the length of a non-BMP character as one, so we
+     should adjust numbers in `selectedRange' before passing them to emacs,
+     in case of non-BMP characters are contained in the marked text. */
+  NSString *strToMin = [str substringWithRange: NSMakeRange (0, selRange.location)];
+  NSString *strToMax = [str substringWithRange: NSMakeRange (0, NSMaxRange (selRange))];
+  
+  /* Save the selected range, which was recalculated by emacs. */
+  ns_range_of_active_clause = Fcons (Flength (build_string ([strToMin UTF8String])),
+                                     Flength (build_string ([strToMax UTF8String])));
+
   emacs_event->kind = NS_TEXT_EVENT;
   emacs_event->code = KEY_NS_PUT_WORKING_TEXT;
   EV_TRAILER ((id)nil);
@@ -6167,6 +6183,12 @@ syms_of_nsterm ()
               "String for visualizing working composition sequence.");
   ns_working_text =Qnil;
 
+  DEFVAR_LISP ("ns-range-of-active-clause", &ns_range_of_active_clause,
+              "Range of an active clause in composition sequence. \
+The value is a cons which holds start point of active clause in working \
+text as car, and end point as cdr.");
+  ns_range_of_active_clause =Qnil;
+
   DEFVAR_LISP ("ns-input-font", &ns_input_font,
               "The font specified in the last NS event.");
   ns_input_font =Qnil;
