# HG changeset patch # User Kenichi Handa # Date 1076385157 0 # Node ID b8d76d842cb969613211de19798d78130c4e59d3 # Parent 328854727be4c72bee7be106f303770dcdfece78 (x-select-utf8-or-ctext): Use compare-strings instead of while loop. diff -r 328854727be4 -r b8d76d842cb9 lisp/term/x-win.el --- a/lisp/term/x-win.el Tue Feb 10 01:52:31 2004 +0000 +++ b/lisp/term/x-win.el Tue Feb 10 03:52:37 2004 +0000 @@ -2178,13 +2178,11 @@ char) (if (/= len-utf8 len-ctext) (if (> len-utf8 len-ctext) utf8 ctext) - (while (< i len-utf8) - (setq char (aref ctext i)) - (if (and (< char 128) (/= char (aref utf8 i))) - (setq selected utf8 - i len-utf8) - (setq i (1+ i)))) - selected))) + (let ((result (compare-strings utf8 0 len-utf8 ctext 0 len-ctext))) + (if (or (eq result t) + (>= (aref ctext (1- (abs result))) 128)) + ctext + utf8))))) (defun x-selection-value (type) (let (text)