[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unicode support for the MS Windows clipboard
From: |
Kenichi Handa |
Subject: |
Re: Unicode support for the MS Windows clipboard |
Date: |
Thu, 3 Jun 2004 22:21:41 +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>, Benjamin Riefenstahl <address@hidden> writes:
> The C code constructs it's own cpXXXX-dos coding system
> names in one place. I would like to check that the
> constructed coding system actually exists, but I don't
> know how yet.
> I didn't worry about the console encoding (CF_OEMTEXT) too
> much, but I added support for it, where it seemed
> straight-forward to me.
> I get the feeling that the C code does too much, and that
> it should delegate major parts of the processing to Lisp.
> I am not yet sure how to structure that, though.
As I've never read w32select.c, the following may be out of
point, but I'll briefly explain how X selection is handled.
All decoding and encoding of X selection is done in
select.el.
For reading a selection data:
The entry point is x-get-selection.
It calls x-get-selection-internal of xselect.c.
It at first tries to get a locale selection value
(i.e. Emacs is the owner of the selection) by
calling x_get_local_selection with `local_request' 1..
If that fails, it tries to get a selection from some other
client by x_get_foreign_selection. This function receives a
selection data and convert it to a Lispy data via
selection_data_to_lisp_data. This function generate a
unibyte string and put `foreign-selection' property on it.
After a string is returned to x-get-selection, it checks
`foreign-selection' property and if it is on, decode the
unibyte string according to data-type and
selection-coding-system.
For sending a selection data:
The entry point is x_handle_selection_request of xselect.c
which is called from swallow_events of keyboard.c when Emacs
gets SELECTION_REQUEST_EVENT.
x_handle_selection_request calls x_get_local_selection too
but with `local_request' 0. If Emacs owns a selection data,
it calls one of Lisp handler registered in
selection-converter-alist. Typical case is
xselect-convert-to-string of select.el called with TYPE
non-nil. This function does all encoding work (if TYPE is
non-nil) and return an encoded unibyte string.
---
Ken'ichi HANDA
address@hidden