Subject: Re: bug#6802: 24.0.50; Yanking non-ASCII text from other X application leads to unicode escapes

From: Eli Zaretskii <[email-masked]>
Date: Mon, 09 Aug 2010 19:34:23 +0300

> From: Kenichi Handa <[email-masked]>
> Date: Mon, 09 Aug 2010 11:57:12 +0900
> Cc: [email-masked]
> 
> I can reproduce this bug.  In Emacs 23 mouse-2 was bound to
> mouse-yank-at-click which calls (x-get-selection 'PRIMARY
> 'UTF8_STRING) with this calling sequence.
> 
> mouse-yank-at-click
>   ->yank->current-kill
>     ->x-cut-buffer-or-selection-value
>       ->x-get-buffer
> 
> But, now mouse-2 is bound to mouse-yank-primary which
> directly calls (x-get-selection 'PRIMARY).  As the second
> optional arg DATA-TYPE is omitted, x-get-selection uses
> 'STRING for that.

Why does x-get-selection default to 'STRING?  Is that sensible
behavior?

> -  (let ((primary (x-get-selection 'PRIMARY)))
> +  (let ((primary (x-get-selection 'PRIMARY 'TEXT)))

Would it make sense to have x-get-selection default to 'TEXT instead?