annotate lisp/x11/x-select.el @ 44:8d2a9b52c682 r19-15prefinal

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