+(defcustom selection-coding-system nil
+ "Coding system for communicating with other X clients.
+
+When sending text via selection and clipboard, if the target
+data-type matches with the type of this coding system, it is used
+for encoding the text. Otherwise (including the case that this
+variable is nil), a proper coding system is used as below:
+
+data-type coding system
+--------- -------------
+UTF8_STRING utf-8
+COMPOUND_TEXT compound-text-with-extensions
+STRING iso-latin-1
+C_STRING no-conversion
+
+When receiving text, if this coding system is non-nil, it is used
+for decoding regardless of the data-type. If this is nil, a
+proper coding system is used according to the data-type as above.
+
+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 nil."
+ :type 'coding-system
+ :group 'mule
+ ;; Default was compound-text-with-extensions in 22.x (pre-unicode).
+ :version "23.1"
+ :set (lambda (symbol value)
+ (set-selection-coding-system value)
+ (set symbol value)))
+
+(defvar next-selection-coding-system nil
+ "Coding system for the next communication with other X clients.
+Usually, `selection-coding-system' is used for communicating with
+other X clients. But, if this variable is set, it is used for
+the next communication only. After the communication, this
+variable is set to nil.")
+
+(declare-function x-get-selection-internal "xselect.c"
+ (selection-symbol target-type &optional time-stamp))
+