Since the working text is not the final text to insert to buffer, how about displaying it using after-string property of overlay? Such as: (overlay-put (setq ns-working-overlay (make-overlay start (point)))    ‘after-string (propertize ns-working-text ‘face 'ns-working-text-face)) 在 2019年12月19日 +0800 AM8:32,tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors ,写道: > > > Can I ask what this change does? > > > > - (overlay-put (setq ns-working-overlay (make-overlay start (point) > > - (current-buffer) nil t)) > > + (overlay-put (setq ns-working-overlay (make-overlay start (point))) > > > At first I thought it would be fixed just by moving [self deleteWorkingText] in nsterm.m. > However as a result insertText (ex: pressing RET to input selected candidates) left nothing. > > That’s because ns-delete-working-text (by [self deleteWorkingText]) delete all inserted > chars including chars inserted by insertText-emited normal input events. This patch prevent > ns-working-overlay expanding its size in insertText. > > > Unfortunately I found the patch change behavior of undo worse. So NS-spesific patch should > have further modification. > > -- > tsuucat > > > >