From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Jan D." Newsgroups: gmane.emacs.devel Subject: Re: Cut buffers and character encoding Date: Fri, 10 Nov 2006 08:42:27 +0100 Message-ID: <45542D63.5070402@swipnet.se> References: <87y7qldq6h.fsf@pacem.orebokech.com> <45537D3A.5080400@swipnet.se> <87mz70730i.fsf@pacem.orebokech.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1163144593 23418 80.91.229.2 (10 Nov 2006 07:43:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Nov 2006 07:43:13 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 10 08:43:11 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GiR2b-0005DZ-3B for ged-emacs-devel@m.gmane.org; Fri, 10 Nov 2006 08:43:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GiR2a-00039v-IV for ged-emacs-devel@m.gmane.org; Fri, 10 Nov 2006 02:43:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GiR2O-00037r-Ef for emacs-devel@gnu.org; Fri, 10 Nov 2006 02:42:56 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GiR2M-000358-Rt for emacs-devel@gnu.org; Fri, 10 Nov 2006 02:42:56 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GiR2M-00034u-DU for emacs-devel@gnu.org; Fri, 10 Nov 2006 02:42:54 -0500 Original-Received: from [81.228.9.183] (helo=av8-1-sn3.vrr.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GiR2M-0003C4-3h for emacs-devel@gnu.org; Fri, 10 Nov 2006 02:42:54 -0500 Original-Received: by av8-1-sn3.vrr.skanova.net (Postfix, from userid 502) id E8B7B38169; Fri, 10 Nov 2006 08:42:52 +0100 (CET) Original-Received: from smtp3-1-sn3.vrr.skanova.net (smtp3-1-sn3.vrr.skanova.net [81.228.9.101]) by av8-1-sn3.vrr.skanova.net (Postfix) with ESMTP id D5FE538147; Fri, 10 Nov 2006 08:42:52 +0100 (CET) Original-Received: from coolsville.localdomain (81-235-205-78-no59.tbcn.telia.com [81.235.205.78]) by smtp3-1-sn3.vrr.skanova.net (Postfix) with ESMTP id AF50137E62; Fri, 10 Nov 2006 08:42:52 +0100 (CET) User-Agent: Thunderbird 1.5.0.7 (X11/20060918) Original-To: Romain Francoise In-Reply-To: <87mz70730i.fsf@pacem.orebokech.com> 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:62019 Archived-At: Romain Francoise skrev: > "Jan D." writes: > >> The text encoding for cut buffers are defined to be ISO-Latin-1, so >> selection-coding-system should not have any effect. That said, we >> could decode data from cut buffers from Latin-1 and encode to Latin-1 >> when putting data in there. > > Ah, thanks, you put me on the right track. > > Emacs *does* decode the contents of the cut buffer in the > `x-cut-buffer-or-selection-value' function, but it tries to decode them > using `locale-coding-system' which is wrong if the locale is a UTF-8 > locale... > > The following patch fixes the problem for me, and if cut buffers are > *always* iso-latin-1 then it should be the right thing. WDYT? I've committed this change and the corresponding when writing to a cut buffer. I also changed the documentation you pointed out was wrong. Jan D. > Index: lisp/term/x-win.el > =================================================================== > RCS file: /cvsroot/emacs/emacs/lisp/term/x-win.el,v > retrieving revision 1.194 > diff -c -r1.194 x-win.el > *** lisp/term/x-win.el 18 Oct 2006 14:05:02 -0000 1.194 > --- lisp/term/x-win.el 9 Nov 2006 20:54:47 -0000 > *************** > *** 2346,2353 **** > (t > (setq x-last-selected-text-cut-encoded cut-text > x-last-selected-text-cut > ! (decode-coding-string cut-text (or locale-coding-system > ! 'iso-latin-1)))))) > > ;; As we have done one selection, clear this now. > (setq next-selection-coding-system nil) > --- 2346,2352 ---- > (t > (setq x-last-selected-text-cut-encoded cut-text > x-last-selected-text-cut > ! (decode-coding-string cut-text 'iso-latin-1))))) > > ;; As we have done one selection, clear this now. > (setq next-selection-coding-system nil) >