# HG changeset patch # User Eli Zaretskii # Date 1020750365 0 # Node ID a053f09739dbed0e5edb343eec72736c88bbdcfe # Parent 99a48943a879550b2ea3933fa02ac2d83b365091 (lisp_data_to_selection_data): Don't set selection type if comes from the Lisp object's car. If the selection contains a pure ASCII text, always return QSTRING as its type. diff -r 99a48943a879 -r a053f09739db src/xselect.c --- a/src/xselect.c Tue May 07 05:22:48 2002 +0000 +++ b/src/xselect.c Tue May 07 05:46:05 2002 +0000 @@ -1765,11 +1765,16 @@ *data_ret = x_encode_text (obj, Vnext_selection_coding_system, 1, (int *) size_ret, &stringp); *nofree_ret = (*data_ret == XSTRING (obj)->data); - if (EQ (Vnext_selection_coding_system, - Qcompound_text_with_extensions)) - type = QCOMPOUND_TEXT; - else if (NILP (type)) - type = (stringp ? QSTRING : QCOMPOUND_TEXT); + if (NILP (type)) + { + if (stringp && *nofree_ret) + type = QSTRING; + else if (EQ (Vnext_selection_coding_system, + Qcompound_text_with_extensions)) + type = QCOMPOUND_TEXT; + else + type = (stringp ? QSTRING : QCOMPOUND_TEXT); + } Vlast_coding_system_used = (*nofree_ret ? Qraw_text : Vnext_selection_coding_system);