summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2025-03-15 11:48:36 +0200
committerEli Zaretskii <eliz@gnu.org>2025-03-15 11:48:36 +0200
commit01c03043e6e93dd12570a960ca54108d543578db (patch)
tree5f54fd105a0ee96a4f34697960b7ca2ec2425c6d /lisp
parent66ec9ae71959fd562646c8c3b482aff7f41adc50 (diff)
downloademacs-01c03043e6e93dd12570a960ca54108d543578db.tar.gz
emacs-01c03043e6e93dd12570a960ca54108d543578db.tar.bz2
emacs-01c03043e6e93dd12570a960ca54108d543578db.zip
; Improve documentation of 'gui-get-selection' use on X
* doc/lispref/frames.texi (Window System Selections): * lisp/select.el (gui-get-selection): Suggest to use an explicit DATA-TYPE when calling 'gui-get-selection'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/select.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/select.el b/lisp/select.el
index d8e97f33001..59eedc79263 100644
--- a/lisp/select.el
+++ b/lisp/select.el
@@ -372,10 +372,15 @@ all upper-case names. The most often used ones, in addition to
`PRIMARY', are `SECONDARY' and `CLIPBOARD'.
DATA-TYPE is usually `STRING', but can also be one of the symbols
-in `selection-converter-alist', which see. Window systems other
-than X usually support only a small subset of these symbols, in
-addition to `STRING'; MS-Windows supports `TARGETS', which reports
-the formats available in the clipboard if TYPE is `CLIPBOARD'."
+in `selection-converter-alist', which see. On X, we recommend
+to always use a specific DATA-TYPE expected from the selection
+owner. In particular, if the data is expected to be non-ASCII
+text, in many cases using \\='UTF8_STRING is the most reasonable
+value for DATA-TYPE.
+
+Window systems other than X usually support only a small subset of
+these symbols, in addition to `STRING'; MS-Windows supports `TARGETS',
+which reports the formats available in the clipboard if TYPE is `CLIPBOARD'."
(let ((data (gui-backend-get-selection (or type 'PRIMARY)
(or data-type 'STRING))))
(when (and (stringp data)