From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: mouse-yank-primary and bug #7699 Date: Wed, 22 Dec 2010 07:47:42 +0100 Message-ID: <4D119F0E.9010600@swipnet.se> References: <837hf2gc0p.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1293000515 31359 80.91.229.12 (22 Dec 2010 06:48:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 22 Dec 2010 06:48:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 22 07:48:31 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PVIUv-00049a-P9 for ged-emacs-devel@m.gmane.org; Wed, 22 Dec 2010 07:48:29 +0100 Original-Received: from localhost ([127.0.0.1]:58635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PVIUv-0003gN-4d for ged-emacs-devel@m.gmane.org; Wed, 22 Dec 2010 01:48:29 -0500 Original-Received: from [140.186.70.92] (port=43469 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PVIUL-0003HE-Oe for emacs-devel@gnu.org; Wed, 22 Dec 2010 01:47:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PVIUK-0001F3-Gy for emacs-devel@gnu.org; Wed, 22 Dec 2010 01:47:53 -0500 Original-Received: from smtprelay-b12.telenor.se ([62.127.194.21]:54169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PVIUJ-0001CV-6E; Wed, 22 Dec 2010 01:47:51 -0500 Original-Received: from ipb4.telenor.se (ipb4.telenor.se [195.54.127.167]) by smtprelay-b12.telenor.se (Postfix) with ESMTP id 99FB7EA11E; Wed, 22 Dec 2010 07:47:43 +0100 (CET) X-SENDER-IP: [85.225.45.100] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgczAHctEU1V4S1kPGdsb2JhbACIMJthDAEBAQE1L8FkhUkEjiE X-IronPort-AV: E=Sophos;i="4.60,211,1291590000"; d="scan'208";a="1701621550" Original-Received: from c-642de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.100]) by ipb4.telenor.se with ESMTP; 22 Dec 2010 07:47:43 +0100 Original-Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 7CD917FA05A; Wed, 22 Dec 2010 07:47:42 +0100 (CET) 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 In-Reply-To: <837hf2gc0p.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:133892 Archived-At: 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.