[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs-unicode-2: copy & paste problem of non standard encoding ctext
From: |
Zhang Wei |
Subject: |
Re: emacs-unicode-2: copy & paste problem of non standard encoding ctext |
Date: |
Mon, 27 Feb 2006 19:52:56 +0800 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Kenichi Handa <address@hidden> writes:
> In article <address@hidden>, Zhang Wei
> <address@hidden> writes:
>
>> While copy and paste between Emacs unicode branch and a ctext required
>> software such as crxvt-gb, emacs can't format/decode correctly the
>> "gbk-0" encoded compound text.
>
>> With the following patch, emacs could accept gbk-0 encoded selection,
>> but still can't paste to crxvt-gb.
>
> Thank you. I've just committed your change. I've also
> committed a fix for the latter problem. But, as I don't
> have crxvt-gb, I didn't check if the fix is correct or not.
> One thing I'm not sure is that the current code still encode
> most characters by designating GB2312 and some other
> standard charsets. Extended segment "gbk-0" is used only
> when they all fails. Is that ok? At least, it's what the
> documentation of CTEXT tells in my understanding.
It seems the bug is still there. I still can't paste to crxvt-gb, to
make both direction's copy&paste work, I have to do the following
things:
1, (set-selection-coding-system 'chinese-gbk)
2, apply the patch below.
[...]
> By the way, your changes are accumulating, and soon reach
> the limit of 15 lines. For further changes, FSF requires
> assignement paper from you. Have you alreay signed the
> paper? If not, please ask Richard to send you a proper
> form.
No I haven't sign the paper. If it is a must, I'd like to sign it.
Should I tell RMS my address, and ask him to send me a form?
--8<---------------cut here---------------start------------->8---
*** select.el 08 Feb 2006 12:26:38 +0800 1.20.2.6
--- select.el 27 Feb 2006 18:57:02 +0800
***************
*** 48,57 ****
coding)
(when (and (stringp data)
(setq data-type (get-text-property 0 'foreign-selection data)))
! (setq coding (if (eq data-type 'UTF8_STRING)
! 'utf-8
! (or next-selection-coding-system
! selection-coding-system))
data (decode-coding-string data coding))
(put-text-property 0 (length data) 'foreign-selection data-type data))
data))
--- 48,60 ----
coding)
(when (and (stringp data)
(setq data-type (get-text-property 0 'foreign-selection data)))
! (setq coding (cond ((eq data-type 'UTF8_STRING)
! 'utf-8)
! ((eq date-type 'COMPOUND_TEXT)
! 'compound-text-with-extensions)
! (t
! (or next-selection-coding-system
! selection-coding-system)))
data (decode-coding-string data coding))
(put-text-property 0 (length data) 'foreign-selection data-type data))
data))
--8<---------------cut here---------------end--------------->8---