Merge from emacs--devo--0
[bpt/emacs.git] / src / xselect.c
index 0222269..3fe109a 100644 (file)
@@ -1,6 +1,6 @@
 /* X Selection processing for Emacs.
    Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003,
-                 2004, 2005, 2006 Free Software Foundation, Inc.
+                 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -123,8 +123,8 @@ Lisp_Object QCUT_BUFFER0, QCUT_BUFFER1, QCUT_BUFFER2, QCUT_BUFFER3,
 
 static Lisp_Object Vx_lost_selection_functions;
 static Lisp_Object Vx_sent_selection_functions;
-/* Coding system for communicating with other X clients via cutbuffer,
-   selection, and clipboard.  */
+/* Coding system for communicating with other X clients via selection
+   and clipboard.  */
 static Lisp_Object Vselection_coding_system;
 
 /* Coding system for the next communicating with other X clients.  */
@@ -835,7 +835,7 @@ x_reply_selection_request (event, format, data, size, type)
            break;
 
          /* Now wait for the requester to ack this chunk by deleting the
-            property.   This can run random lisp code or signal.  */
+            property.  This can run random lisp code or signal.  */
          TRACE1 ("Waiting for increment ACK (deletion of %s)",
                  XGetAtomName (display, reply.property));
          wait_for_property_change (wait_object);
@@ -2710,11 +2710,11 @@ FRAME is on.  If FRAME is nil, the selected frame is used.  */)
   else
     error ("ATOM must be a symbol or a string");
 
-  for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i) 
+  for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i)
     if (dpyinfo->x_dnd_atoms[i] == x_atom)
       return Qnil;
 
-  if (dpyinfo->x_dnd_atoms_length == dpyinfo->x_dnd_atoms_size) 
+  if (dpyinfo->x_dnd_atoms_length == dpyinfo->x_dnd_atoms_size)
     {
       dpyinfo->x_dnd_atoms_size *= 2;
       dpyinfo->x_dnd_atoms = xrealloc (dpyinfo->x_dnd_atoms,
@@ -2744,7 +2744,7 @@ x_handle_dnd_message (f, event, dpyinfo, bufp)
   int idata[5];
   size_t i;
 
-  for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i) 
+  for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i)
     if (dpyinfo->x_dnd_atoms[i] == event->message_type) break;
 
   if (i == dpyinfo->x_dnd_atoms_length) return 0;
@@ -2975,8 +2975,17 @@ it merely informs you that they have happened.  */);
 
   DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system,
               doc: /* Coding system for communicating with other X clients.
-When sending or receiving text via cut_buffer, selection, and clipboard,
-the text is encoded or decoded by this coding system.
+
+When sending text via selection and clipboard, if the requested
+data-type is not "UTF8_STRING", the text is encoded by this coding
+system.
+
+When receiving text, if the data-type of the received text is not
+"UTF8_STRING", it is decoded by this coding system.
+
+See also the documentation of the variable `x-select-request-type' how
+to control which data-type to request for receiving text.
+
 The default value is `compound-text-with-extensions'.  */);
   Vselection_coding_system = intern ("compound-text-with-extensions");