all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Romain Francoise <romain@orebokech.com>
Cc: emacs-devel@gnu.org
Subject: Re: Cut buffers and character encoding
Date: Thu, 09 Nov 2006 21:56:29 +0100	[thread overview]
Message-ID: <87mz70730i.fsf@pacem.orebokech.com> (raw)
In-Reply-To: <45537D3A.5080400@swipnet.se> (Jan D.'s message of "Thu\, 09 Nov 2006 20\:10\:50 +0100")

"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?

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)

-- 
Romain Francoise <romain@orebokech.com> | The sea! the sea! the open
it's a miracle -- http://orebokech.com/ | sea! The blue, the fresh, the
                                        | ever free! --Bryan W. Procter

  reply	other threads:[~2006-11-09 20:56 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 [this message]
2006-11-10  7:42     ` Jan D.
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

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

  git send-email \
    --in-reply-to=87mz70730i.fsf@pacem.orebokech.com \
    --to=romain@orebokech.com \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.