unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: Clipboard and coding systems
Date: Mon, 25 Oct 2004 10:24:05 +0900 (JST)	[thread overview]
Message-ID: <200410250124.KAA12336@etlken.m17n.org> (raw)
In-Reply-To: <871xfuzyo8.fsf@marant.org> (message from Jérôme Marant on Tue,	19 Oct 2004 14:21:11 +0200)

In article <871xfuzyo8.fsf@marant.org>, Jérôme Marant <jmarant@nerim.net> 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
handa@m17n.org

  reply	other threads:[~2004-10-25  1:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-19 12:21 Clipboard and coding systems Jérôme Marant
2004-10-25  1:24 ` Kenichi Handa [this message]
2004-11-09 22:29   ` Jérôme Marant
2004-12-01  0:38     ` Kenichi Handa
2004-12-05 13:08       ` Jérôme Marant

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=200410250124.KAA12336@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@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).