From: Kenichi Handa Date: Tue, 10 Feb 2004 03:52:37 +0000 (+0000) Subject: (x-select-utf8-or-ctext): Use compare-strings instead of while loop. X-Git-Tag: ttn-vms-21-2-B4~7664 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b040ac646bae3bf6eedba5690222a1afa85275f6;p=emacs.git (x-select-utf8-or-ctext): Use compare-strings instead of while loop. --- diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 09657fb848f..4b419a57a97 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -2178,13 +2178,11 @@ order until succeed.") 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)