unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: id.brep@gmail.com
Subject: Re: [id.brep@gmail.com: x-clipboard-yank doesn't decode utf-8 string]
Date: Fri, 10 Jun 2005 10:53:22 +0900	[thread overview]
Message-ID: <E1DgYi2-00040P-00@etlken> (raw)
In-Reply-To: <E1DgXAu-0006aF-PF@fencepost.gnu.org> (message from Richard Stallman on Thu, 09 Jun 2005 20:15:04 -0400)

In article <E1DgXAu-0006aF-PF@fencepost.gnu.org>, Richard Stallman <rms@gnu.org> writes:
> ------- Start of forwarded message -------
> Date: Thu, 9 Jun 2005 00:57:06 +0800
> From: Zhang Wei <id.brep@gmail.com>
> To: emacs-pretest-bug@gnu.org
> Subject: x-clipboard-yank doesn't decode utf-8 string
[...]
> When I select some text from Mozilla-firefox using left mouse
> button, but without issuing cut/copy command explicitly, then I paste
> in emacs with middle mouse button or C-y, everything is OK,
> which means the X PRIMARY selection method works fine.

> But if I issue cut/copy command explicitly after
> selection (select Edit/copy from Mozilla-firefox's menu, or C-c),
> and then paste in emacs using Edit/paste menu item, what I got is
> undecoded utf string, something like this "\u60a8\u4e0a\u6b21",
> it seems that the X CLIPBOARD selection method does not work.

> The following patch could fix this problem, but I'm not sure if
> it is the best way.

> - ------------------------------------------------------------------------------
> *** x-win.el    2005-05-30 02:44:48.000000000 +0800
> - --- x-win.el.new        2005-06-08 23:38:30.330605432 +0800
> ***************
> *** 2446,2452 ****
>     (interactive)

>     (let ((clipboard-text
>          (condition-case nil
> !            (x-get-selection 'CLIPBOARD)
>            (error nil)))
>         (x-select-enable-clipboard t))
>       (if (and clipboard-text (> (length clipboard-text) 0))
> - --- 2446,2452 ----
>     (interactive)
>     (let ((clipboard-text
>          (condition-case nil
> !            (x-selection-value 'CLIPBOARD)
>            (error nil)))
>         (x-select-enable-clipboard t))
>       (if (and clipboard-text (> (length clipboard-text) 0))
> - ------------------------------------------------------------------------

Thank you for the report.  As it seems that the patch is
correct, I've just installed it.

But, the above is a change to x-clipboard-yank and it seems
that this function was introduced on 21 Jan 2004 (strangely
that fact is not in ChangeLog).  At that time
x-selection-value was already there.  That means there will
be some reason for x-clipboard-yank not using
x-selection-value.  Does anybody know who wrote it?  If you
are the author, could you please confirm that the change
doesn't break your intention?

---
Kenichi Handa
handa@m17n.org

       reply	other threads:[~2005-06-10  1:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1DgXAu-0006aF-PF@fencepost.gnu.org>
2005-06-10  1:53 ` Kenichi Handa [this message]
2005-06-10  5:12   ` [id.brep@gmail.com: x-clipboard-yank doesn't decode utf-8 string] jhd
2005-06-10  5:40     ` Kenichi Handa
2005-06-10 22:36     ` Richard Stallman
2005-06-11  5:41       ` jhd

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=E1DgYi2-00040P-00@etlken \
    --to=handa@m17n.org \
    --cc=id.brep@gmail.com \
    /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).