|
From: | Jan Djärv |
Subject: | Re: mouse-yank-primary and bug #7699 |
Date: | Wed, 22 Dec 2010 07:47:42 +0100 |
User-agent: | Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.13) Gecko/20101129 Thunderbird/3.1.7 |
Eli Zaretskii skrev 2010-12-21 20.29:
I have a question for experts on X selections. I think I can fix bug#7699 if I switch the order of calling x-get-selection-value and x-get-selection in this snippet from mouse-yank-primary: (let ((primary (cond ((fboundp 'x-get-selection-value) ; MS-DOS, MS-Windows and X. (or (x-get-selection-value) (x-get-selection 'PRIMARY))) My question is: could switching the order do the wrong thing on X? I looked into x-get-selection-value and x-get-selection as they are implemented on X, and they seem to do very similar things, but I don't know enough to understand the semantics of the subtle differences. If switching the order is not TRT on X, I could do that only for w32.
x-get-selection-value tries UTF8-STRING first, the COMPOUND_STRING and finally STRING (unless overridden by the user). x-get-selection as called above only does STRING. So for all cases when the selection isn't a latin-1 string, switching would most likely do the wrong thing. There was a bug report about this (6802). We can't rely on applications not sending STRING when the data isn't in latin-1.
Jan D.
[Prev in Thread] | Current Thread | [Next in Thread] |