home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / lisp / x11 / x-select.el < prev    next >
Encoding:
Text File  |  1995-07-19  |  19.5 KB  |  558 lines

  1. ;; x-select.el --- Elisp interface to X Selections.
  2. ;; Copyright (C) 1990 Free Software Foundation, Inc.
  3.  
  4. ;; This file is part of XEmacs.
  5.  
  6. ;; XEmacs is free software; you can redistribute it and/or modify it
  7. ;; under the terms of the GNU General Public License as published by
  8. ;; the Free Software Foundation; either version 2, or (at your option)
  9. ;; any later version.
  10.  
  11. ;; XEmacs is distributed in the hope that it will be useful, but
  12. ;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14. ;; General Public License for more details.
  15.  
  16. ;; You should have received a copy of the GNU General Public License
  17. ;; along with XEmacs; see the file COPYING.  If not, write to the Free
  18. ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. ;;; The selection code requires us to use certain symbols whose names are
  21. ;;; all upper-case; this may seem tasteless, but it makes there be a 1:1
  22. ;;; correspondence between these symbols and X Atoms (which are upcased).
  23.  
  24. (defun x-get-selection ()
  25.   "Return text selected from some X window."
  26.   (x-get-selection-internal 'PRIMARY 'STRING))
  27.  
  28. (defun x-get-secondary-selection ()
  29.   "Return text selected from some X window."
  30.   (x-get-selection-internal 'SECONDARY 'STRING))
  31.  
  32. (defun x-get-clipboard ()
  33.   "Return text pasted to the clipboard."
  34.   (x-get-selection-internal 'CLIPBOARD 'STRING))
  35.  
  36.  
  37. (defvar primary-selection-extent nil
  38.   "The extent of the primary selection; don't use this.")
  39.  
  40. (defvar secondary-selection-extent nil
  41.   "The extent of the secondary selection; don't use this.")
  42.  
  43.  
  44. (defun x-select-make-extent-for-selection (selection previous-extent)
  45.   ;; Given a selection, this makes an extent in the buffer which holds that
  46.   ;; selection, for highlighting purposes.  If the selection isn't associated
  47.   ;; with a buffer, this does nothing.
  48.   (let ((buffer nil)
  49.     (valid (and (extentp previous-extent)
  50.             (extent-buffer previous-extent)
  51.             (buffer-name (extent-buffer previous-extent))))
  52.     start end)
  53.     (cond ((stringp selection)
  54.        ;; if we're selecting a string, lose the previous extent used
  55.        ;; to highlight the selection.
  56.        (setq valid nil))
  57.       ((consp selection)
  58.        (setq start (min (car selection) (cdr selection))
  59.          end (max (car selection) (cdr selection))
  60.          valid (and valid
  61.                 (eq (marker-buffer (car selection))
  62.                 (extent-buffer previous-extent)))
  63.          buffer (marker-buffer (car selection))))
  64.       ((extentp selection)
  65.        (setq start (extent-start-position selection)
  66.          end (extent-end-position selection)
  67.          valid (and valid
  68.                 (eq (extent-buffer selection)
  69.                 (extent-buffer previous-extent)))
  70.          buffer (extent-buffer selection)))
  71.       (t
  72.        (signal 'error (list "invalid selection" selection))))
  73.  
  74.     (if valid
  75.     nil
  76.       (condition-case ()
  77.       (if (listp previous-extent)
  78.           (mapcar 'delete-extent previous-extent)
  79.         (delete-extent previous-extent))
  80.     (error nil)))
  81.  
  82.     (if (not buffer)
  83.     ;; string case
  84.     nil
  85.       ;; normal case
  86.       (if valid
  87.       (set-extent-endpoints previous-extent start end)
  88.     (setq previous-extent (make-extent start end buffer))
  89.  
  90.     ;; Make the extent be closed on the right, which means that if
  91.     ;; characters are inserted exactly at the end of the extent, the
  92.     ;; extent will grow to cover them.  This is important for shell
  93.     ;; buffers - suppose one makes a selection, and one end is at
  94.     ;; point-max.  If the shell produces output, that marker will remain
  95.     ;; at point-max (its position will increase).  So it's important that
  96.     ;; the extent exhibit the same behavior, lest the region covered by
  97.     ;; the extent (the visual indication), and the region between point
  98.     ;; and mark (the actual selection value) become different!
  99.     (set-extent-property previous-extent 'end-open nil)
  100.  
  101.     (cond
  102.      (mouse-track-rectangle-p
  103.       (setq previous-extent (list previous-extent))
  104.       (default-mouse-track-next-move-rect start end previous-extent)
  105.       ))
  106.     previous-extent))))
  107.  
  108.  
  109. (defun x-own-selection (selection &optional type)
  110.   "Make a primary X Selection of the given argument.  
  111. The argument may be a string, a cons of two markers, or an extent.  
  112. In the latter cases the selection is considered to be the text 
  113. between the markers, or between the extent's endpoints."
  114.   (interactive (if (not current-prefix-arg)
  115.            (list (read-string "Store text for pasting: "))
  116.          (list (cons ;; these need not be ordered.
  117.             (copy-marker (point-marker))
  118.             (copy-marker (mark-marker))))))
  119.   (or (stringp selection)
  120.       (extentp selection)
  121.       (and (consp selection)
  122.        (markerp (car selection))
  123.        (markerp (cdr selection))
  124.        (marker-buffer (car selection))
  125.        (marker-buffer (cdr selection))
  126.        (eq (marker-buffer (car selection))
  127.            (marker-buffer (cdr selection)))
  128.        (buffer-name (marker-buffer (car selection)))
  129.        (buffer-name (marker-buffer (cdr selection))))
  130.       (signal 'error (list "invalid selection" selection)))
  131.   (or type (setq type 'PRIMARY))
  132.   (x-own-selection-internal type selection)
  133.   (cond ((eq type 'PRIMARY)
  134.      (setq primary-selection-extent
  135.            (x-select-make-extent-for-selection
  136.         selection primary-selection-extent)))
  137.     ((eq type 'SECONDARY)
  138.      (setq secondary-selection-extent
  139.            (x-select-make-extent-for-selection
  140.         selection secondary-selection-extent))))
  141.   (setq zmacs-region-stays t)
  142.   selection)
  143.  
  144.  
  145. (defun x-own-secondary-selection (selection &optional type)
  146.   "Make a secondary X Selection of the given argument.  The argument may be a 
  147. string or a cons of two markers (in which case the selection is considered to
  148. be the text between those markers)."
  149.   (interactive (if (not current-prefix-arg)
  150.            (list (read-string "Store text for pasting: "))
  151.          (list (cons ;; these need not be ordered.
  152.             (copy-marker (point-marker))
  153.             (copy-marker (mark-marker))))))
  154.   (x-own-selection selection 'SECONDARY))
  155.  
  156.  
  157. (defun x-own-clipboard (string)
  158.   "Paste the given string to the X Clipboard."
  159.   (x-own-selection string 'CLIPBOARD))
  160.  
  161.  
  162. (defun x-disown-selection (&optional secondary-p)
  163.   "Assuming we own the selection, disown it.  With an argument, discard the
  164. secondary selection instead of the primary selection."
  165.   (x-disown-selection-internal (if secondary-p 'SECONDARY 'PRIMARY)))
  166.  
  167. (defun x-dehilight-selection (selection)
  168.   "for use as a value of `x-lost-selection-hooks'."
  169.   (cond ((eq selection 'PRIMARY)
  170.      (if primary-selection-extent
  171.          (let ((inhibit-quit t))
  172.            (if (consp primary-selection-extent)
  173.            (mapcar 'delete-extent primary-selection-extent)
  174.          (delete-extent primary-selection-extent))
  175.            (setq primary-selection-extent nil)))
  176.      (if zmacs-regions (zmacs-deactivate-region)))
  177.     ((eq selection 'SECONDARY)
  178.      (if secondary-selection-extent
  179.          (let ((inhibit-quit t))
  180.            (if (consp secondary-selection-extent)
  181.            (mapcar 'delete-extent secondary-selection-extent)
  182.          (delete-extent secondary-selection-extent))
  183.            (setq secondary-selection-extent nil)))))
  184.   nil)
  185.  
  186. (setq x-lost-selection-hooks 'x-dehilight-selection)
  187.  
  188. (defun x-notice-selection-requests (selection type successful)
  189.   "for possible use as the value of x-sent-selection-hooks."
  190.   (if (not successful)
  191.       (message "Selection request failed to convert %s to %s"
  192.            selection type)
  193.     (message "Sent selection %s as %s" selection type)))
  194.  
  195. (defun x-notice-selection-failures (selection type successful)
  196.   "for possible use as the value of x-sent-selection-hooks."
  197.   (or successful
  198.       (message "Selection request failed to convert %s to %s"
  199.            selection type)))
  200.  
  201. ;(setq x-sent-selection-hooks 'x-notice-selection-requests)
  202. ;(setq x-sent-selection-hooks 'x-notice-selection-failures)
  203.  
  204.  
  205. ;;; Selections in killed buffers
  206. ;;; this function is called by kill-buffer as if it were on the 
  207. ;;; kill-buffer-hook (though it isn't really).
  208.  
  209. (defun xselect-kill-buffer-hook ()
  210.   ;; Probably the right thing is to write a C function to return a list
  211.   ;; of the selections which emacs owns, since it could concievably own
  212.   ;; a user-defined selection type that we've never heard of.
  213.   (xselect-kill-buffer-hook-1 'PRIMARY)
  214.   (xselect-kill-buffer-hook-1 'SECONDARY)
  215.   (xselect-kill-buffer-hook-1 'CLIPBOARD))
  216.  
  217. (defun xselect-kill-buffer-hook-1 (selection)
  218.   (let (value)
  219.     (if (and (x-selection-owner-p selection)
  220.          (setq value (x-get-selection-internal selection '_EMACS_INTERNAL))
  221.          ;; The _EMACS_INTERNAL selection type has a converter registered
  222.          ;; for it that does no translation.  This only works if emacs is
  223.          ;; requesting the selection from itself.  We could have done this
  224.          ;; by writing a C function to return the raw selection data, and
  225.          ;; that might be the right way to do this, but this was easy.
  226.          (or (and (consp value)
  227.               (markerp (car value))
  228.               (eq (current-buffer) (marker-buffer (car value))))
  229.          (and (extentp value)
  230.               (eq (current-buffer) (extent-buffer value)))))
  231.     (x-disown-selection-internal selection))))
  232.  
  233.  
  234. ;;; Cut Buffer support
  235.  
  236. (defun x-get-cutbuffer (&optional which-one)
  237.   "Returns the value of one of the 8 X server cut buffers.  Optional arg
  238. WHICH-ONE should be a number from 0 to 7, defaulting to 0.
  239. Cut buffers are considered obsolete\; you should use selections instead.
  240. This function does nothing if support for cut buffers was not compiled
  241. into Emacs."
  242.   (and (fboundp 'x-get-cutbuffer-internal)
  243.        (x-get-cutbuffer-internal
  244.     (if which-one
  245.         (aref [CUT_BUFFER0 CUT_BUFFER1 CUT_BUFFER2 CUT_BUFFER3
  246.                    CUT_BUFFER4 CUT_BUFFER5 CUT_BUFFER6 CUT_BUFFER7]
  247.           which-one)
  248.       'CUT_BUFFER0))))
  249.  
  250. (defun x-store-cutbuffer (string)
  251.   "Store the given string into the X server's primary cut buffer.
  252. The previous value of the primary cut buffer is rotated to the secondary
  253. cut buffer, and the second to the third, and so on (there are 8 buffers).
  254. Cut buffers are considered obsolete\; you should use selections instead.
  255. This function does nothing if support for cut buffers was not compiled
  256. into Emacs."
  257.   (and (fboundp 'x-store-cutbuffer-internal)
  258.        (progn
  259.      (or (stringp string) (error "must be a string"))
  260.      (x-rotate-cutbuffers-internal 1)
  261.      (x-store-cutbuffer-internal 'CUT_BUFFER0 string))))
  262.  
  263. (defun x-supports-cutbuffers-p ()
  264.   "Returns whether support for cut buffers was compiled into Emacs.
  265. Cut buffers are considered obsolete\; you should use selections instead."
  266.   (fboundp 'x-get-cutbuffer-internal))
  267.  
  268.  
  269. ;;; Random utility functions
  270.  
  271. (defun x-cut-copy-clear-internal (mode)
  272.   (or (memq mode '(cut copy clear)) (error "unkown mode %S" mode))
  273.   (or (x-selection-owner-p)
  274.       (error "emacs does not own the primary selection"))
  275.   (setq last-command nil)
  276.   (or primary-selection-extent
  277.       (error "the primary selection is not an extent?"))
  278.   (save-excursion
  279.     (let (rect-p b s e)
  280.       (cond
  281.        ((consp primary-selection-extent)
  282.     (setq rect-p t
  283.           b (extent-buffer (car primary-selection-extent))
  284.           s (extent-start-position (car primary-selection-extent))
  285.           e (extent-end-position (car (reverse primary-selection-extent)))))
  286.        (t
  287.     (setq rect-p nil
  288.           b (extent-buffer primary-selection-extent)
  289.           s (extent-start-position primary-selection-extent)
  290.           e (extent-end-position primary-selection-extent))))
  291.       (set-buffer b)
  292.       (cond ((memq mode '(cut copy))
  293.          (if rect-p
  294.          (progn
  295.            ;; why is killed-rectangle free?  Is it used somewhere?
  296.            ;; should it be defvarred?
  297.            (setq killed-rectangle (extract-rectangle s e))
  298.            (kill-new (mapconcat 'identity killed-rectangle "\n")))
  299.            (copy-region-as-kill s e))
  300.          ;; Maybe killing doesn't own clipboard.  Make sure it happens.
  301.          ;; This memq is kind of grody, because they might have done it
  302.          ;; some other way, but owning the clipboard twice in that case
  303.          ;; wouldn't actually hurt anything.
  304.          (or (and (consp kill-hooks) (memq 'x-own-clipboard kill-hooks))
  305.          (x-own-clipboard (car kill-ring)))))
  306.       (cond ((memq mode '(cut clear))
  307.          (if rect-p
  308.          (delete-rectangle s e)
  309.            (delete-region s e))))
  310.       (x-disown-selection nil)
  311.       )))
  312.  
  313. (defun x-copy-primary-selection ()
  314.   "Copy the selection to the Clipboard and the kill ring."
  315.   (interactive)
  316.   (x-cut-copy-clear-internal 'copy))
  317.  
  318. (defun x-kill-primary-selection ()
  319.   "Copy the selection to the Clipboard and the kill ring, then delete it."
  320.   (interactive "*")
  321.   (x-cut-copy-clear-internal 'cut))
  322.  
  323. (defun x-delete-primary-selection ()
  324.   "Delete the selection without copying it to the Clipboard or the kill ring."
  325.   (interactive "*")
  326.   (x-cut-copy-clear-internal 'clear))
  327.  
  328. (defun x-yank-clipboard-selection ()
  329.   "Insert the current Clipboard selection at point."
  330.   (interactive "*")
  331.   (setq last-command nil)
  332.   (setq this-command 'yank) ; so that yank-pop works.
  333.   (let ((clip (x-get-clipboard)))
  334.     (or clip (error "there is no clipboard selection"))
  335.     (push-mark)
  336.     (insert clip)))
  337.  
  338. ;;; Functions to convert the selection into various other selection types.
  339. ;;; Every selection type that emacs handles is implemented this way, except
  340. ;;; for TIMESTAMP, which is a special case.
  341.  
  342. (defun xselect-convert-to-string (selection type value)
  343.   (cond ((stringp value)
  344.      value)
  345.     ((extentp value)
  346.      (save-excursion
  347.        (set-buffer (extent-buffer value))
  348.        (save-restriction
  349.          (widen)
  350.          (buffer-substring (extent-start-position value)
  351.                    (extent-end-position value)))))
  352.     ((and (consp value)
  353.           (markerp (car value))
  354.           (markerp (cdr value)))
  355.      (or (eq (marker-buffer (car value)) (marker-buffer (cdr value)))
  356.          (signal 'error
  357.              (list "markers must be in the same buffer"
  358.                (car value) (cdr value))))
  359.      (save-excursion
  360.        (set-buffer (or (marker-buffer (car value))
  361.                (error "selection is in a killed buffer")))
  362.        (save-restriction
  363.          (widen)
  364.          (buffer-substring (car value) (cdr value)))))
  365.     (t nil)))
  366.  
  367. (defun xselect-convert-to-length (selection type value)
  368.   (let ((value
  369.      (cond ((stringp value)
  370.         (length value))
  371.            ((extentp value)
  372.         (extent-length value))
  373.            ((and (consp value)
  374.              (markerp (car value))
  375.              (markerp (cdr value)))
  376.         (or (eq (marker-buffer (car value))
  377.             (marker-buffer (cdr value)))
  378.             (signal 'error
  379.                 (list "markers must be in the same buffer"
  380.                   (car value) (cdr value))))
  381.         (abs (- (car value) (cdr value)))))))
  382.     (if value ; force it to be in 32-bit format.
  383.     (cons (ash value -16) (logand value 65535))
  384.       nil)))
  385.  
  386. (defun xselect-convert-to-targets (selection type value)
  387.   ;; return a vector of atoms, but remove duplicates first.
  388.   (let* ((all (cons 'TIMESTAMP (mapcar 'car selection-converter-alist)))
  389.      (rest all))
  390.     (while rest
  391.       (cond ((memq (car rest) (cdr rest))
  392.          (setcdr rest (delq (car rest) (cdr rest))))
  393.         ((eq (car (cdr rest)) '_EMACS_INTERNAL)  ; shh, it's a secret
  394.          (setcdr rest (cdr (cdr rest))))
  395.         (t
  396.          (setq rest (cdr rest)))))
  397.     (apply 'vector all)))
  398.  
  399. (defun xselect-convert-to-delete (selection type value)
  400.   (x-disown-selection-internal selection)
  401.   ;; A return value of nil means that we do not know how to do this conversion,
  402.   ;; and replies with an "error".  A return value of NULL means that we have
  403.   ;; done the conversion (and any side-effects) but have no value to return.
  404.   'NULL)
  405.  
  406. (defun xselect-convert-to-filename (selection type value)
  407.   (cond ((extentp value)
  408.      (buffer-file-name (or (extent-buffer value)
  409.                    (error "selection is in a killed buffer"))))
  410.     ((and (consp value)
  411.           (markerp (car value))
  412.           (markerp (cdr value)))
  413.      (buffer-file-name (or (marker-buffer (car value))
  414.                    (error "selection is in a killed buffer"))))
  415.     (t nil)))
  416.  
  417. (defun xselect-convert-to-charpos (selection type value)
  418.   (let (a b tmp)
  419.     (cond ((cond ((extentp value)
  420.           (setq a (extent-start-position value)
  421.             b (extent-end-position value)))
  422.          ((and (consp value)
  423.                (markerp (car value))
  424.                (markerp (cdr value)))
  425.           (setq a (car value)
  426.             b (cdr value))))
  427.        (setq a (1- a) b (1- b)) ; zero-based
  428.        (if (< b a) (setq tmp a a b b tmp))
  429.        (cons 'SPAN
  430.          (vector (cons (ash a -16) (logand a 65535))
  431.              (cons (ash b -16) (logand b 65535))))))))
  432.  
  433. (defun xselect-convert-to-lineno (selection type value)
  434.   (let (a b buf tmp)
  435.     (cond ((cond ((extentp value)
  436.           (setq buf (extent-buffer value)
  437.             a (extent-start-position value)
  438.             b (extent-end-position value)))
  439.          ((and (consp value)
  440.                (markerp (car value))
  441.                (markerp (cdr value)))
  442.           (setq a (marker-position (car value))
  443.             b (marker-position (cdr value))
  444.             buf (marker-buffer (car value)))))
  445.        (save-excursion
  446.          (set-buffer buf)
  447.          (save-restriction
  448.            (widen)
  449.            (goto-char a)
  450.            (beginning-of-line)
  451.            (setq a (1+ (count-lines 1 (point))))
  452.            (goto-char b)
  453.            (beginning-of-line)
  454.            (setq b (1+ (count-lines 1 (point))))))
  455.        (if (< b a) (setq tmp a a b b tmp))
  456.        (cons 'SPAN
  457.          (vector (cons (ash a -16) (logand a 65535))
  458.              (cons (ash b -16) (logand b 65535))))))))
  459.  
  460. (defun xselect-convert-to-colno (selection type value)
  461.   (let (a b buf tmp)
  462.     (cond ((cond ((extentp value)
  463.           (setq buf (extent-buffer value)
  464.             a (extent-start-position value)
  465.             b (extent-end-position value)))
  466.          ((and (consp value)
  467.                (markerp (car value))
  468.                (markerp (cdr value)))
  469.           (setq a (car value)
  470.             b (cdr value)
  471.             buf (marker-buffer a))))
  472.        (save-excursion
  473.          (set-buffer buf)
  474.          (goto-char a)
  475.          (setq a (current-column))
  476.          (goto-char b)
  477.          (setq b (current-column)))
  478.        (if (< b a) (setq tmp a a b b tmp))
  479.        (cons 'SPAN
  480.          (vector (cons (ash a -16) (logand a 65535))
  481.              (cons (ash b -16) (logand b 65535))))))))
  482.  
  483. (defun xselect-convert-to-sourceloc (selection type value)
  484.   (let (a b buf file-name tmp)
  485.     (cond ((cond ((extentp value)
  486.           (setq buf (or (extent-buffer value)
  487.                 (error "selection is in a killed buffer"))
  488.             a (extent-start-position value)
  489.             b (extent-end-position value)
  490.             file-name (buffer-file-name buf)))
  491.          ((and (consp value)
  492.                (markerp (car value))
  493.                (markerp (cdr value)))
  494.           (setq a (marker-position (car value))
  495.             b (marker-position (cdr value))
  496.             buf (or (marker-buffer (car value))
  497.                 (error "selection is in a killed buffer"))
  498.             file-name (buffer-file-name buf))))
  499.        (save-excursion
  500.          (set-buffer buf)
  501.          (save-restriction
  502.            (widen)
  503.            (goto-char a)
  504.            (beginning-of-line)
  505.            (setq a (1+ (count-lines 1 (point))))
  506.            (goto-char b)
  507.            (beginning-of-line)
  508.            (setq b (1+ (count-lines 1 (point))))))
  509.        (if (< b a) (setq tmp a a b b tmp))
  510.        (format "%s:%d" file-name a)))))
  511.  
  512. (defun xselect-convert-to-os (selection type size)
  513.   (symbol-name system-type))
  514.  
  515. (defun xselect-convert-to-host (selection type size)
  516.   (system-name))
  517.  
  518. (defun xselect-convert-to-user (selection type size)
  519.   (user-full-name))
  520.  
  521. (defun xselect-convert-to-class (selection type size)
  522.   x-emacs-application-class)
  523.  
  524. (defun xselect-convert-to-name (selection type size)
  525.   invocation-name)
  526.  
  527. (defun xselect-convert-to-integer (selection type value)
  528.   (and (integerp value)
  529.        (cons (ash value -16) (logand value 65535))))
  530.  
  531. (defun xselect-convert-to-atom (selection type value)
  532.   (and (symbolp value) value))
  533.  
  534. (defun xselect-convert-to-identity (selection type value) ; used internally
  535.   (vector value))
  536.  
  537. (setq selection-converter-alist
  538.       '((TEXT . xselect-convert-to-string)
  539.     (STRING . xselect-convert-to-string)
  540.     (TARGETS . xselect-convert-to-targets)
  541.     (LENGTH . xselect-convert-to-length)
  542.     (DELETE . xselect-convert-to-delete)
  543.     (FILE_NAME . xselect-convert-to-filename)
  544.     (CHARACTER_POSITION . xselect-convert-to-charpos)
  545.     (SOURCE_LOC . xselect-convert-to-sourceloc)
  546.     (LINE_NUMBER . xselect-convert-to-lineno)
  547.     (COLUMN_NUMBER . xselect-convert-to-colno)
  548.     (OWNER_OS . xselect-convert-to-os)
  549.     (HOST_NAME . xselect-convert-to-host)
  550.     (USER . xselect-convert-to-user)
  551.     (CLASS . xselect-convert-to-class)
  552.     (NAME . xselect-convert-to-name)
  553.     (ATOM . xselect-convert-to-atom)
  554.     (INTEGER . xselect-convert-to-integer)
  555.     (_EMACS_INTERNAL . xselect-convert-to-identity)
  556.     ))
  557.  
  558.