Do you mean that there are some cases that the number of characters in a string, in other words, the length of a string, is different from the one counted by NSString to the one counted by Emacs? If so, could you show me any example of these cases? > Also, selected range handling is not enough for the following case: Thank you for pointing that out. I made an attached patch which may fix this problem by moving cursor in composing text. Apply this patch after applying my previous patch.