[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Clipboard and coding systems
From: |
Kenichi Handa |
Subject: |
Re: Clipboard and coding systems |
Date: |
Mon, 25 Oct 2004 10:24:05 +0900 (JST) |
User-agent: |
SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.3 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) |
In article <address@hidden>, Jérôme Marant <address@hidden> writes:
> 2) Start Emacs, type `abéècd' in a fresh buffer, copy the typed text,
> _exit from Emacs_ and paste within the following command in a Xterm:
> amboise:~$ echo 'abéècd' > foo
> Then,
> amboise:~$ hex foo
> 0x00000000: 61 62 8e e9 8e e8 63 64 - 0a ab....cdJ
> Can this be explained or is it a bug?
Thank you for the report. But, I found the fix is not easy.
The explanation is complex and difficult.
This problem is because Emacs stores internal multibyte
sequence into a cut buffer. So, I at first thought that we
can simply encode STRING by locale-coding-system in
x-set-cut-buffer. But, then x-cut-buffer-or-selection-value
doesn't work when we copy a string that can't be encoded by
locale-coding-system. That is because
x-cut-buffer-or-selection-value looks up a cut buffer by
x-get-cut-buffer and compare it with
x-last-selected-text-cut, and they differs.
So, my question is: Should Emacs still support pasting form
an application that uses only a cut buffer? If not, we can
make x-cut-buffer-or-selection-value not check a cut buffer,
then, we can store encoded string in a cut buffer by
x-set-cut-buffer?
Another way is to solve this problem (the comment before
x-cut-buffer-or-selection-value) not in
x-cut-buffer-or-selection-value.
;;; If this function is called twice and finds the same text,
;;; it returns nil the second time. This is so that a single
;;; selection won't be added to the kill ring over and over.
---
Ken'ichi HANDA
address@hidden