Function: gui--selection-value-internal

gui--selection-value-internal is a byte-compiled function defined in select.el.gz.

Signature

(gui--selection-value-internal TYPE)

Documentation

Get a selection value of type TYPE.

Call gui-get-selection with an appropriate DATA-TYPE argument decided by x-select-request-type. The return value is already decoded. If gui-get-selection signals an error, return nil.

Source Code

;; Defined in /usr/src/emacs/lisp/select.el.gz
(defun gui--selection-value-internal (type)
  "Get a selection value of type TYPE.
Call `gui-get-selection' with an appropriate DATA-TYPE argument
decided by `x-select-request-type'.  The return value is already
decoded.  If `gui-get-selection' signals an error, return nil."
  (let ((request-type (if (eq window-system 'x)
                          (or x-select-request-type
                              '(UTF8_STRING COMPOUND_TEXT STRING))
                        'STRING))
	text)
    (with-demoted-errors "gui-get-selection: %S"
      (if (consp request-type)
          (while (and request-type (not text))
            (setq text (gui-get-selection type (car request-type)))
            (setq request-type (cdr request-type)))
        (setq text (gui-get-selection type request-type))))
    (if text
	(remove-text-properties 0 (length text) '(foreign-selection nil) text))
    text))