Mercurial > emacs
comparison lisp/term/x-win.el @ 53906:b8d76d842cb9
(x-select-utf8-or-ctext): Use compare-strings instead of while loop.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Tue, 10 Feb 2004 03:52:37 +0000 |
parents | 7efe8089eadf |
children | b925746ed8e7 03a73693678e |
comparison
equal
deleted
inserted
replaced
53905:328854727be4 | 53906:b8d76d842cb9 |
---|---|
2176 (selected ctext) | 2176 (selected ctext) |
2177 (i 0) | 2177 (i 0) |
2178 char) | 2178 char) |
2179 (if (/= len-utf8 len-ctext) | 2179 (if (/= len-utf8 len-ctext) |
2180 (if (> len-utf8 len-ctext) utf8 ctext) | 2180 (if (> len-utf8 len-ctext) utf8 ctext) |
2181 (while (< i len-utf8) | 2181 (let ((result (compare-strings utf8 0 len-utf8 ctext 0 len-ctext))) |
2182 (setq char (aref ctext i)) | 2182 (if (or (eq result t) |
2183 (if (and (< char 128) (/= char (aref utf8 i))) | 2183 (>= (aref ctext (1- (abs result))) 128)) |
2184 (setq selected utf8 | 2184 ctext |
2185 i len-utf8) | 2185 utf8))))) |
2186 (setq i (1+ i)))) | |
2187 selected))) | |
2188 | 2186 |
2189 (defun x-selection-value (type) | 2187 (defun x-selection-value (type) |
2190 (let (text) | 2188 (let (text) |
2191 (cond ((null x-select-request-type) | 2189 (cond ((null x-select-request-type) |
2192 (let (utf8 ctext utf8-coding) | 2190 (let (utf8 ctext utf8-coding) |