From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: [id.brep@gmail.com: x-clipboard-yank doesn't decode utf-8 string] Date: Fri, 10 Jun 2005 10:53:22 +0900 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1118368307 15807 80.91.229.2 (10 Jun 2005 01:51:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Jun 2005 01:51:47 +0000 (UTC) Cc: id.brep@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 10 03:51:35 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DgYgH-0000cY-I4 for ged-emacs-devel@m.gmane.org; Fri, 10 Jun 2005 03:51:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DgYnJ-00071u-HZ for ged-emacs-devel@m.gmane.org; Thu, 09 Jun 2005 21:58:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DgYmy-00071K-Cm for emacs-devel@gnu.org; Thu, 09 Jun 2005 21:58:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DgYmw-0006zy-CB for emacs-devel@gnu.org; Thu, 09 Jun 2005 21:58:26 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DgYmv-0006zd-L9 for emacs-devel@gnu.org; Thu, 09 Jun 2005 21:58:25 -0400 Original-Received: from [192.47.44.130] (helo=tsukuba.m17n.org) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1DgYiP-000649-NO; Thu, 09 Jun 2005 21:53:46 -0400 Original-Received: from nfs.m17n.org (nfs.m17n.org [192.47.44.7]) by tsukuba.m17n.org (8.12.3/8.12.3/Debian-7.1) with ESMTP id j5A1rN86017492; Fri, 10 Jun 2005 10:53:23 +0900 Original-Received: from etlken (etlken.m17n.org [192.47.44.125]) by nfs.m17n.org (8.12.3/8.12.3/Debian-7.1) with ESMTP id j5A1rNCq002063; Fri, 10 Jun 2005 10:53:23 +0900 Original-Received: from handa by etlken with local (Exim 3.36 #1 (Debian)) id 1DgYi2-00040P-00; Fri, 10 Jun 2005 10:53:22 +0900 Original-To: rms@gnu.org, emacs-devel@gnu.org In-reply-to: (message from Richard Stallman on Thu, 09 Jun 2005 20:15:04 -0400) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) 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:38483 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38483 In article , Richard Stallman writes: > ------- Start of forwarded message ------- > Date: Thu, 9 Jun 2005 00:57:06 +0800 > From: Zhang Wei > To: emacs-pretest-bug@gnu.org > Subject: x-clipboard-yank doesn't decode utf-8 string [...] > When I select some text from Mozilla-firefox using left mouse > button, but without issuing cut/copy command explicitly, then I paste > in emacs with middle mouse button or C-y, everything is OK, > which means the X PRIMARY selection method works fine. > But if I issue cut/copy command explicitly after > selection (select Edit/copy from Mozilla-firefox's menu, or C-c), > and then paste in emacs using Edit/paste menu item, what I got is > undecoded utf string, something like this "\u60a8\u4e0a\u6b21", > it seems that the X CLIPBOARD selection method does not work. > The following patch could fix this problem, but I'm not sure if > it is the best way. > - ------------------------------------------------------------------------------ > *** x-win.el 2005-05-30 02:44:48.000000000 +0800 > - --- x-win.el.new 2005-06-08 23:38:30.330605432 +0800 > *************** > *** 2446,2452 **** > (interactive) > (let ((clipboard-text > (condition-case nil > ! (x-get-selection 'CLIPBOARD) > (error nil))) > (x-select-enable-clipboard t)) > (if (and clipboard-text (> (length clipboard-text) 0)) > - --- 2446,2452 ---- > (interactive) > (let ((clipboard-text > (condition-case nil > ! (x-selection-value 'CLIPBOARD) > (error nil))) > (x-select-enable-clipboard t)) > (if (and clipboard-text (> (length clipboard-text) 0)) > - ------------------------------------------------------------------------ Thank you for the report. As it seems that the patch is correct, I've just installed it. But, the above is a change to x-clipboard-yank and it seems that this function was introduced on 21 Jan 2004 (strangely that fact is not in ChangeLog). At that time x-selection-value was already there. That means there will be some reason for x-clipboard-yank not using x-selection-value. Does anybody know who wrote it? If you are the author, could you please confirm that the change doesn't break your intention? --- Kenichi Handa handa@m17n.org