]> git.eshelyaron.com Git - emacs.git/commitdiff
(lisp_data_to_selection_data): Don't set selection
authorEli Zaretskii <eliz@gnu.org>
Tue, 7 May 2002 05:46:35 +0000 (05:46 +0000)
committerEli Zaretskii <eliz@gnu.org>
Tue, 7 May 2002 05:46:35 +0000 (05:46 +0000)
type if comes from the Lisp object's car.  If the selection
contains a pure ASCII text, always return QSTRING as its type.

src/ChangeLog
src/xselect.c

index 4f37ed65ac7fb72872f7f11e3f1ea3111374fb21..d8c725c7333996e394150a2823dc5c46248dd981 100644 (file)
@@ -1,3 +1,9 @@
+2002-05-07  Eli Zaretskii  <eliz@is.elta.co.il>
+
+       * xselect.c (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.
+
 2002-05-06  Pavel Jan\e,Bm\e(Bk  <Pavel@Janik.cz>
 
        * mac.c (mac-cut-function): Doc fix.
index 03580b782fee1ce85183143046abd6e56d837da2..c95cc211c1dfe1786aa92f62e5895b1a65445e3d 100644 (file)
@@ -1765,11 +1765,16 @@ lisp_data_to_selection_data (display, obj,
       *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);