From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.bugs Subject: bug#6802: 24.0.50; Yanking non-ASCII text from other X application leads to unicode escapes Date: Mon, 09 Aug 2010 11:57:12 +0900 Message-ID: References: <87mxt1go33.fsf@doganov.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp X-Trace: dough.gmane.org 1281323321 20716 80.91.229.12 (9 Aug 2010 03:08:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 9 Aug 2010 03:08:41 +0000 (UTC) Cc: 6802@debbugs.gnu.org To: Kaloian Doganov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 09 05:08:39 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1OiIj4-0003Od-Ew for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Aug 2010 05:08:34 +0200 Original-Received: from localhost ([127.0.0.1]:45105 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiIj3-0002GF-MU for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 Aug 2010 23:08:33 -0400 Original-Received: from [140.186.70.92] (port=33774 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiIiu-0002Fb-Fw for bug-gnu-emacs@gnu.org; Sun, 08 Aug 2010 23:08:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OiIis-0005gw-Tv for bug-gnu-emacs@gnu.org; Sun, 08 Aug 2010 23:08:24 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35035) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiIis-0005gq-SZ for bug-gnu-emacs@gnu.org; Sun, 08 Aug 2010 23:08:22 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OiIXu-0001lo-2c; Sun, 08 Aug 2010 22:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kenichi Handa Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Aug 2010 02:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6802 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6802-submit@debbugs.gnu.org id=B6802.12813225986793 (code B ref 6802); Mon, 09 Aug 2010 02:57:02 +0000 Original-Received: (at 6802) by debbugs.gnu.org; 9 Aug 2010 02:56:38 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiIXV-0001lW-Q7 for submit@debbugs.gnu.org; Sun, 08 Aug 2010 22:56:38 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiIXT-0001lR-8O for 6802@debbugs.gnu.org; Sun, 08 Aug 2010 22:56:36 -0400 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id o792vDMc026457; Mon, 9 Aug 2010 11:57:13 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id o792vDW5004679; Mon, 9 Aug 2010 11:57:13 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp4.aist.go.jp with ESMTP id o792vCos004019; Mon, 9 Aug 2010 11:57:12 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.71) (envelope-from ) id 1OiIY4-0001nL-FN; Mon, 09 Aug 2010 11:57:12 +0900 In-Reply-To: <87mxt1go33.fsf@doganov.org> (message from Kaloian Doganov on Thu, 05 Aug 2010 16:56:32 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 08 Aug 2010 22:57:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:39344 Archived-At: In article <87mxt1go33.fsf@doganov.org>, Kaloian Doganov writes: > 0. Start Emacs using `emacs -Q'. > 1. Open some other X application (gedit, GNOME Terminal, etc.) and enter > the following text: > Проба > 2. Select the text using the mouse and yank it using mouse-2 in a > scratch buffer in Emacs. > 3. The result is: > \u041f\u0440\u043e\u0431\u0430 > instead of the expected: > Проба I can reproduce this bug. In Emacs 23 mouse-2 was bound to mouse-yank-at-click which calls (x-get-selection 'PRIMARY 'UTF8_STRING) with this calling sequence. mouse-yank-at-click ->yank->current-kill ->x-cut-buffer-or-selection-value ->x-get-buffer But, now mouse-2 is bound to mouse-yank-primary which directly calls (x-get-selection 'PRIMARY). As the second optional arg DATA-TYPE is omitted, x-get-selection uses 'STRING for that. And, for such a data-type request, Gnome applications returns something like this: \u041f\u0440\u043e\u0431\u0430 There are various ways to fix it, and each is fairly easy once we decide the precise spec of each functions. But as I have not followed the discussions in the thread "Cut and paste with C-w/mouse-2 not working?", I don't know which is the best. One easy way is this: === modified file 'lisp/mouse.el' --- lisp/mouse.el 2010-08-08 21:57:34 +0000 +++ lisp/mouse.el 2010-08-09 02:54:23 +0000 @@ -1265,7 +1265,7 @@ ;; the middle of an active region. (deactivate-mark)) (or mouse-yank-at-point (mouse-set-point click)) - (let ((primary (x-get-selection 'PRIMARY))) + (let ((primary (x-get-selection 'PRIMARY 'TEXT))) (if primary (insert primary) (error "No primary selection")))) --- Kenichi Handa handa@m17n.org