unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jan D." <jan.h.d@swipnet.se>
Cc: emacs-devel@gnu.org
Subject: Re: Cut buffers and character encoding
Date: Fri, 10 Nov 2006 08:42:27 +0100	[thread overview]
Message-ID: <45542D63.5070402@swipnet.se> (raw)
In-Reply-To: <87mz70730i.fsf@pacem.orebokech.com>

Romain Francoise skrev:
> "Jan D." <jan.h.d@swipnet.se> 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)
> 

  reply	other threads:[~2006-11-10  7:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-09  7:39 Cut buffers and character encoding Romain Francoise
2006-11-09 19:10 ` Jan D.
2006-11-09 20:56   ` Romain Francoise
2006-11-10  7:42     ` Jan D. [this message]
2006-11-10 10:24       ` Kenichi Handa
2006-11-10 13:39         ` Romain Francoise
2006-11-11 12:40           ` Kenichi Handa
2006-11-12  5:14             ` Richard Stallman
2006-11-18  2:23               ` Kenichi Handa
2006-11-18 13:18                 ` Jan Djärv
2006-11-20  3:23                   ` Katsumi Yamaoka
2006-11-20  7:44                     ` Jan Djärv
2006-11-20  7:57                       ` Katsumi Yamaoka
2006-11-20 23:58                       ` Richard Stallman
2006-11-21 12:47                         ` Jan Djärv
2006-11-18 16:05                 ` Richard Stallman
2006-11-10 18:41   ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45542D63.5070402@swipnet.se \
    --to=jan.h.d@swipnet.se \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).