428
|
1 ;;; select.el --- Lisp interface to windows selections.
|
|
2
|
|
3 ;; Copyright (C) 1998 Andy Piper.
|
|
4 ;; Copyright (C) 1990, 1997 Free Software Foundation, Inc.
|
|
5 ;; Copyright (C) 1995 Sun Microsystems.
|
851
|
6 ;; Copyright (C) 2002 Ben Wing.
|
428
|
7
|
|
8 ;; Maintainer: XEmacs Development Team
|
|
9 ;; Keywords: extensions, dumped
|
|
10
|
|
11 ;; This file is part of XEmacs.
|
|
12
|
|
13 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
14 ;; under the terms of the GNU General Public License as published by
|
|
15 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
16 ;; any later version.
|
|
17
|
|
18 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
21 ;; General Public License for more details.
|
|
22
|
|
23 ;; You should have received a copy of the GNU General Public License
|
444
|
24 ;; along with XEmacs; see the file COPYING. If not, write to the
|
428
|
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
26 ;; Boston, MA 02111-1307, USA.
|
|
27
|
|
28 ;;; Synched up with: Not in FSF
|
|
29
|
|
30 ;;; Commentary:
|
|
31
|
444
|
32 ;; This file is dumped with XEmacs
|
428
|
33
|
|
34 ;;; Code:
|
|
35
|
2624
|
36 ;; We prefer UTF8_STRING to COMPOUND_TEXT because, even though the latter
|
|
37 ;; gives us more information when taking data from other XEmacs invocations,
|
|
38 ;; Mozilla will happily give us broken COMPOUND_TEXT where a non-broken
|
|
39 ;; UTF8_STRING is available.
|
|
40 (defvar selection-preferred-types
|
|
41 (let ((res '(UTF8_STRING COMPOUND_TEXT STRING image/png image/gif
|
|
42 image/jpeg image/tiff image/xpm image/xbm)))
|
|
43 (unless (featurep 'mule) (delq 'COMPOUND_TEXT res))
|
|
44 res)
|
|
45 "An ordered list of X11 type atoms for selections we want to receive.
|
|
46 We prefer UTF8_STRING over COMPOUND_TEXT, for compatibility with a certain
|
|
47 widely-used browser suite, and COMPOUND_TEXT over STRING. (COMPOUND_TEXT
|
|
48 isn't available on non-Mule.) We also accept several image types.
|
|
49
|
|
50 For compatibility, this can be a single atom. ")
|
|
51
|
|
52 ;; Renamed because it was just ridiculous for it to be mostly image formats
|
|
53 ;; and named selected-text-type.
|
|
54 (define-obsolete-variable-alias 'selected-text-type 'selection-preferred-types)
|
428
|
55
|
444
|
56 (defvar selection-sets-clipboard nil
|
428
|
57 "Controls the selection's relationship to the clipboard.
|
|
58 When non-nil, any operation that sets the primary selection will also
|
|
59 set the clipboard.")
|
|
60
|
|
61 (defun copy-primary-selection ()
|
851
|
62 "Copy the selection to the Clipboard and the kill ring.
|
|
63 This is similar to the command \\[kill-ring-save] except that it will
|
|
64 save to the Clipboard even if that command doesn't, and it handles rectangles
|
|
65 properly."
|
428
|
66 (interactive)
|
|
67 (and (console-on-window-system-p)
|
|
68 (cut-copy-clear-internal 'copy)))
|
|
69
|
|
70 (defun kill-primary-selection ()
|
2624
|
71 "Copy the selection to the Clipboard and the kill ring, then delete it.
|
851
|
72 This is similar to the command \\[kill-region] except that it will
|
|
73 save to the Clipboard even if that command doesn't, and it handles rectangles
|
|
74 properly."
|
428
|
75 (interactive "*")
|
|
76 (and (console-on-window-system-p)
|
|
77 (cut-copy-clear-internal 'cut)))
|
|
78
|
|
79 (defun delete-primary-selection ()
|
|
80 "Delete the selection without copying it to the Clipboard or the kill ring."
|
|
81 (interactive "*")
|
|
82 (and (console-on-window-system-p)
|
|
83 (cut-copy-clear-internal 'clear)))
|
|
84
|
|
85 (defun yank-clipboard-selection ()
|
|
86 "Insert the current Clipboard selection at point."
|
|
87 (interactive "*")
|
|
88 (when (console-on-window-system-p)
|
|
89 (setq last-command nil)
|
|
90 (setq this-command 'yank) ; so that yank-pop works.
|
|
91 (let ((clip (get-clipboard)))
|
|
92 (or clip (error "there is no clipboard selection"))
|
|
93 (push-mark)
|
|
94 (insert clip))))
|
|
95
|
|
96 (defun get-clipboard ()
|
829
|
97 "Return text pasted to the clipboard.
|
843
|
98 Not suitable for `interprogram-paste-function', use `get-clipboard-foreign'."
|
|
99 (get-selection 'CLIPBOARD))
|
|
100
|
|
101 (defun get-clipboard-foreign ()
|
|
102 "Return text pasted to the clipboard by another program.
|
829
|
103 See `interprogram-paste-function' for more information."
|
843
|
104 (get-selection-foreign 'CLIPBOARD))
|
428
|
105
|
|
106 (define-device-method get-cutbuffer
|
|
107 "Return the value of one of the cut buffers.
|
|
108 This will do nothing under anything other than X.")
|
|
109
|
|
110 (defun get-selection-no-error (&optional type data-type)
|
442
|
111 "Return the value of a window-system selection.
|
2624
|
112 The argument TYPE (default `PRIMARY') says which selection, and the argument
|
|
113 DATA-TYPE (defaulting to the value of `selection-preferred-types'), says how
|
|
114 to convert the data. Returns NIL if there is no selection."
|
442
|
115 (condition-case nil (get-selection type data-type) (t nil)))
|
428
|
116
|
|
117 (defun get-selection (&optional type data-type)
|
843
|
118 "Return the value of a window-system selection.
|
2624
|
119 The argument TYPE (default `PRIMARY') says which selection, and the argument
|
|
120 DATA-TYPE (defaulting to the value of, and compatible with,
|
|
121 `selection-preferred-types') says how to convert the data. If
|
|
122 there is no selection an error is signalled. Not suitable in a
|
|
123 `interprogram-paste-function', q.v."
|
428
|
124 (or type (setq type 'PRIMARY))
|
2624
|
125 (or data-type (setq data-type selection-preferred-types))
|
829
|
126 (if (consp data-type)
|
2624
|
127 ;; TARGETS is a vector; we want a list so we can memq --> append it to
|
|
128 ;; nil.
|
|
129 (let ((targets (append (get-selection-internal type 'TARGETS) nil))
|
|
130 res)
|
|
131 (catch 'converted
|
|
132 (if targets
|
|
133 (dolist (current-preference data-type)
|
|
134 (condition-case err
|
|
135 (if (and (memq current-preference targets)
|
|
136 (setq res (get-selection-internal
|
|
137 type current-preference)))
|
|
138 (throw 'converted res))
|
|
139 (selection-conversion-error
|
|
140 nil))))
|
|
141 ;; The source app didn't offer us anything compatible in TARGETS,
|
|
142 ;; or they're not negotiating at all. (That is, we're probably not
|
|
143 ;; on X11.) Try to convert to the types specified by our caller,
|
|
144 ;; and throw an error if the last one of those fails.
|
|
145 (while data-type
|
|
146 (condition-case err
|
|
147 (progn
|
|
148 (setq res (get-selection-internal type (car data-type)))
|
|
149 (throw 'converted res))
|
|
150 (selection-conversion-error
|
|
151 (if (cdr data-type)
|
|
152 (setq data-type (pop data-type))
|
|
153 (signal (car err) (cdr err))))))))
|
829
|
154 (get-selection-internal type data-type)))
|
428
|
155
|
847
|
156 (defun get-selection-foreign (&optional type data-type)
|
|
157 "Return the value of a window-system selection, or nil if XEmacs owns it.
|
2624
|
158 The argument TYPE (default `PRIMARY') says which selection, and the argument
|
|
159 DATA-TYPE (defaulting to the value of `selection-preferred-types' which see)
|
|
160 says how to convert the data. If there is no selection an error is
|
|
161 signalled. See `interprogram-paste-function' for more information."
|
847
|
162 (unless (selection-owner-p type)
|
|
163 (get-selection type data-type)))
|
|
164
|
428
|
165 ;; FSFmacs calls this `x-set-selection', and reverses the
|
442
|
166 ;; first two arguments (duh ...). This order is more logical.
|
|
167 (defun own-selection (data &optional type how-to-add data-type)
|
|
168 "Make a window-system selection of type TYPE and value DATA.
|
428
|
169 The argument TYPE (default `PRIMARY') says which selection,
|
442
|
170 and DATA specifies the contents. DATA may be any lisp data type
|
|
171 that can be converted using the function corresponding to DATA-TYPE
|
|
172 in `select-converter-alist'---strings are the usual choice, but
|
|
173 other types may be permissible depending on the DATA-TYPE parameter
|
851
|
174 \(if DATA-TYPE is not supplied, the default behavior is window
|
442
|
175 system specific, but strings are always accepted).
|
|
176 HOW-TO-ADD may be any of the following:
|
|
177
|
|
178 'replace-all or nil -- replace all data in the selection.
|
|
179 'replace-existing -- replace data for specified DATA-TYPE only.
|
|
180 'append or t -- append data to existing DATA-TYPE data.
|
|
181
|
|
182 DATA-TYPE is the window-system specific data type identifier
|
851
|
183 \(see `register-selection-data-type' for more information).
|
428
|
184
|
|
185 The selection may also be a cons of two markers pointing to the same buffer,
|
|
186 or an overlay. In these cases, the selection is considered to be the text
|
442
|
187 between the markers *at whatever time the selection is examined* (note
|
|
188 that the window system clipboard does not necessarily duplicate this
|
|
189 behavior - it doesn't on mswindows for example).
|
428
|
190 Thus, editing done in the buffer after you specify the selection
|
|
191 can alter the effective value of the selection.
|
|
192
|
|
193 The data may also be a vector of valid non-vector selection values.
|
|
194
|
|
195 Interactively, the text of the region is used as the selection value."
|
|
196 (interactive (if (not current-prefix-arg)
|
|
197 (list (read-string "Store text for pasting: "))
|
|
198 (list (substring (region-beginning) (region-end)))))
|
442
|
199 ;; calling own-selection-internal will mess this up, so preserve it.
|
|
200 (let ((zmacs-region-stays zmacs-region-stays))
|
|
201 ;FSFmacs huh?? It says:
|
|
202 ;; "This is for temporary compatibility with pre-release Emacs 19."
|
|
203 ;(if (stringp type)
|
|
204 ; (setq type (intern type)))
|
|
205 (or type (setq type 'PRIMARY))
|
|
206 (if (null data)
|
|
207 (disown-selection-internal type)
|
|
208 (own-selection-internal type data how-to-add data-type)
|
|
209 (when (and (eq type 'PRIMARY)
|
|
210 selection-sets-clipboard)
|
|
211 (own-selection-internal 'CLIPBOARD data how-to-add data-type)))
|
|
212 (cond ((eq type 'PRIMARY)
|
|
213 (setq primary-selection-extent
|
|
214 (select-make-extent-for-selection
|
|
215 data primary-selection-extent)))
|
|
216 ((eq type 'SECONDARY)
|
|
217 (setq secondary-selection-extent
|
|
218 (select-make-extent-for-selection
|
|
219 data secondary-selection-extent)))))
|
|
220 ;; zmacs-region-stays is for commands, not low-level functions.
|
|
221 ;; when behaving as the latter, we better not set it, or we will
|
|
222 ;; cause unwanted sticky-region behavior in kill-region and friends.
|
|
223 (if (interactive-p)
|
|
224 (setq zmacs-region-stays t))
|
428
|
225 data)
|
|
226
|
|
227 (defun dehilight-selection (selection)
|
|
228 "for use as a value of `lost-selection-hooks'."
|
|
229 (cond ((eq selection 'PRIMARY)
|
|
230 (if primary-selection-extent
|
|
231 (let ((inhibit-quit t))
|
|
232 (if (consp primary-selection-extent)
|
|
233 (mapcar 'delete-extent primary-selection-extent)
|
|
234 (delete-extent primary-selection-extent))
|
|
235 (setq primary-selection-extent nil)))
|
|
236 (if zmacs-regions (zmacs-deactivate-region)))
|
|
237 ((eq selection 'SECONDARY)
|
|
238 (if secondary-selection-extent
|
|
239 (let ((inhibit-quit t))
|
|
240 (if (consp secondary-selection-extent)
|
|
241 (mapcar 'delete-extent secondary-selection-extent)
|
|
242 (delete-extent secondary-selection-extent))
|
|
243 (setq secondary-selection-extent nil)))))
|
|
244 nil)
|
|
245
|
|
246 (setq lost-selection-hooks 'dehilight-selection)
|
|
247
|
442
|
248 (defun own-clipboard (string &optional push)
|
|
249 "Paste the given string to the window system Clipboard.
|
|
250 See `interprogram-cut-function' for more information."
|
428
|
251 (own-selection string 'CLIPBOARD))
|
|
252
|
|
253 (defun disown-selection (&optional secondary-p)
|
487
|
254 "Assuming we own the selection, disown it.
|
|
255 With an argument, discard the secondary selection instead of the
|
|
256 primary selection."
|
428
|
257 (disown-selection-internal (if secondary-p 'SECONDARY 'PRIMARY))
|
|
258 (when (and selection-sets-clipboard
|
|
259 (or (not secondary-p)
|
|
260 (eq secondary-p 'PRIMARY)
|
|
261 (eq secondary-p 'CLIPBOARD)))
|
|
262 (disown-selection-internal 'CLIPBOARD)))
|
|
263
|
|
264 ;; selections and active regions
|
|
265
|
|
266 ;; If and only if zmacs-regions is true:
|
|
267
|
|
268 ;; When a mark is pushed and the region goes into the "active" state, we
|
|
269 ;; assert it as the Primary selection. This causes it to be hilighted.
|
|
270 ;; When the region goes into the "inactive" state, we disown the Primary
|
|
271 ;; selection, causing the region to be dehilighted.
|
|
272
|
|
273 ;; Note that it is possible for the region to be in the "active" state
|
|
274 ;; and not be hilighted, if it is in the active state and then some other
|
|
275 ;; application asserts the selection. This is probably not a big deal.
|
|
276
|
|
277 (defun activate-region-as-selection ()
|
487
|
278 (cond (mouse-track-rectangle-p (mouse-track-activate-rectangular-selection))
|
|
279 ((marker-buffer (mark-marker t))
|
|
280 (own-selection (cons (point-marker t) (mark-marker t))))))
|
428
|
281
|
|
282 (defvar primary-selection-extent nil
|
|
283 "The extent of the primary selection; don't use this.")
|
|
284
|
|
285 (defvar secondary-selection-extent nil
|
|
286 "The extent of the secondary selection; don't use this.")
|
|
287
|
|
288 (defun select-make-extent-for-selection (selection previous-extent)
|
|
289 ;; Given a selection, this makes an extent in the buffer which holds that
|
|
290 ;; selection, for highlighting purposes. If the selection isn't associated
|
|
291 ;; with a buffer, this does nothing.
|
2624
|
292 ;;
|
|
293 ;; Something similar needs to be hooked into the rectangle functions.
|
428
|
294 (let ((buffer nil)
|
|
295 (valid (and (extentp previous-extent)
|
|
296 (extent-object previous-extent)
|
|
297 (buffer-live-p (extent-object previous-extent))))
|
|
298 start end)
|
|
299 (cond ((stringp selection)
|
|
300 ;; if we're selecting a string, lose the previous extent used
|
|
301 ;; to highlight the selection.
|
|
302 (setq valid nil))
|
|
303 ((consp selection)
|
|
304 (setq start (min (car selection) (cdr selection))
|
|
305 end (max (car selection) (cdr selection))
|
|
306 valid (and valid
|
|
307 (eq (marker-buffer (car selection))
|
|
308 (extent-object previous-extent)))
|
|
309 buffer (marker-buffer (car selection))))
|
|
310 ((extentp selection)
|
|
311 (setq start (extent-start-position selection)
|
|
312 end (extent-end-position selection)
|
|
313 valid (and valid
|
|
314 (eq (extent-object selection)
|
|
315 (extent-object previous-extent)))
|
|
316 buffer (extent-object selection)))
|
|
317 (t
|
|
318 (signal 'error (list "invalid selection" selection))))
|
|
319
|
|
320 (if valid
|
|
321 nil
|
|
322 (condition-case ()
|
|
323 (if (listp previous-extent)
|
|
324 (mapcar 'delete-extent previous-extent)
|
|
325 (delete-extent previous-extent))
|
|
326 (error nil)))
|
|
327
|
|
328 (if (not buffer)
|
|
329 ;; string case
|
|
330 nil
|
|
331 ;; normal case
|
|
332 (if valid
|
|
333 (set-extent-endpoints previous-extent start end)
|
|
334 (setq previous-extent (make-extent start end buffer))
|
|
335
|
|
336 ;; Make the extent be closed on the right, which means that if
|
|
337 ;; characters are inserted exactly at the end of the extent, the
|
|
338 ;; extent will grow to cover them. This is important for shell
|
|
339 ;; buffers - suppose one makes a selection, and one end is at
|
|
340 ;; point-max. If the shell produces output, that marker will remain
|
|
341 ;; at point-max (its position will increase). So it's important that
|
|
342 ;; the extent exhibit the same behavior, lest the region covered by
|
|
343 ;; the extent (the visual indication), and the region between point
|
|
344 ;; and mark (the actual selection value) become different!
|
|
345 (set-extent-property previous-extent 'end-open nil)
|
|
346
|
|
347 (cond
|
|
348 (mouse-track-rectangle-p
|
|
349 (setq previous-extent (list previous-extent))
|
|
350 (default-mouse-track-next-move-rect start end previous-extent)
|
|
351 ))
|
|
352 previous-extent))))
|
|
353
|
|
354 (defun valid-simple-selection-p (data)
|
442
|
355 "An obsolete function that tests whether something was a valid simple
|
|
356 selection using the old XEmacs selection support. You shouldn't use this
|
|
357 any more, because just about anything could be a valid selection now."
|
428
|
358 (or (stringp data)
|
|
359 ;FSFmacs huh?? (symbolp data)
|
|
360 (integerp data)
|
|
361 (and (consp data)
|
|
362 (integerp (car data))
|
|
363 (or (integerp (cdr data))
|
|
364 (and (consp (cdr data))
|
|
365 (integerp (car (cdr data))))))
|
|
366 (extentp data)
|
|
367 (and (consp data)
|
|
368 (markerp (car data))
|
|
369 (markerp (cdr data))
|
|
370 (marker-buffer (car data))
|
|
371 (marker-buffer (cdr data))
|
|
372 (eq (marker-buffer (car data))
|
|
373 (marker-buffer (cdr data)))
|
|
374 (buffer-live-p (marker-buffer (car data)))
|
|
375 (buffer-live-p (marker-buffer (cdr data))))))
|
|
376
|
|
377 (defun cut-copy-clear-internal (mode)
|
|
378 (or (memq mode '(cut copy clear)) (error "unkown mode %S" mode))
|
|
379 (or (selection-owner-p)
|
|
380 (error "XEmacs does not own the primary selection"))
|
|
381 (setq last-command nil)
|
|
382 (or primary-selection-extent
|
|
383 (error "the primary selection is not an extent?"))
|
|
384 (save-excursion
|
|
385 (let (rect-p b s e)
|
|
386 (cond
|
|
387 ((consp primary-selection-extent)
|
|
388 (setq rect-p t
|
|
389 b (extent-object (car primary-selection-extent))
|
|
390 s (extent-start-position (car primary-selection-extent))
|
|
391 e (extent-end-position (car (reverse primary-selection-extent)))))
|
|
392 (t
|
|
393 (setq rect-p nil
|
|
394 b (extent-object primary-selection-extent)
|
|
395 s (extent-start-position primary-selection-extent)
|
|
396 e (extent-end-position primary-selection-extent))))
|
|
397 (set-buffer b)
|
|
398 (cond ((memq mode '(cut copy))
|
|
399 (if rect-p
|
|
400 (progn
|
851
|
401 ;; killed-rectangle is defvarred in rect.el
|
428
|
402 (setq killed-rectangle (extract-rectangle s e))
|
|
403 (kill-new (mapconcat #'identity killed-rectangle "\n")))
|
|
404 (copy-region-as-kill s e))
|
|
405 ;; Maybe killing doesn't own clipboard. Make sure it happens.
|
|
406 ;; This memq is kind of grody, because they might have done it
|
|
407 ;; some other way, but owning the clipboard twice in that case
|
|
408 ;; wouldn't actually hurt anything.
|
|
409 (or (and (consp kill-hooks) (memq 'own-clipboard kill-hooks))
|
851
|
410 (eq 'own-clipboard interprogram-cut-function)
|
428
|
411 (own-clipboard (car kill-ring)))))
|
|
412 (cond ((memq mode '(cut clear))
|
|
413 (if rect-p
|
|
414 (delete-rectangle s e)
|
|
415 (delete-region s e))))
|
|
416 (disown-selection nil)
|
|
417 )))
|
|
418
|
442
|
419
|
428
|
420 ;;; Functions to convert the selection into various other selection
|
442
|
421 ;;; types.
|
|
422
|
|
423 ;; These next three functions get called by C code...
|
|
424 (defun select-convert-in (selection type value)
|
|
425 "Attempt to convert the specified external VALUE to the specified DATA-TYPE,
|
|
426 for the specified SELECTION. Return nil if this is impossible, or a
|
|
427 suitable internal representation otherwise."
|
|
428 (when value
|
|
429 (let ((handler-fn (cdr (assq type selection-converter-in-alist))))
|
2624
|
430 (if handler-fn
|
|
431 (apply handler-fn (list selection type value))
|
|
432 value))))
|
428
|
433
|
442
|
434 (defun select-convert-out (selection type value)
|
|
435 "Attempt to convert the specified internal VALUE for the specified DATA-TYPE
|
|
436 and SELECTION. Return nil if this is impossible, or a suitable external
|
|
437 representation otherwise."
|
|
438 (when value
|
|
439 (let ((handler-fn (cdr (assq type selection-converter-out-alist))))
|
|
440 (when handler-fn
|
|
441 (apply handler-fn (list selection type value))))))
|
|
442
|
|
443 (defun select-coerce (selection type value)
|
|
444 "Attempt to convert the specified internal VALUE to a representation
|
|
445 suitable for return from `get-selection' in the specified DATA-TYPE. Return
|
|
446 nil if this is impossible, or a suitable representation otherwise."
|
|
447 (when value
|
|
448 (let ((handler-fn (cdr (assq type selection-coercion-alist))))
|
|
449 (when handler-fn
|
|
450 (apply handler-fn (list selection type value))))))
|
|
451
|
|
452 ;; The rest of the functions on this "page" are conversion handlers,
|
|
453 ;; append handlers and buffer-kill handlers.
|
428
|
454 (defun select-convert-to-text (selection type value)
|
|
455 (cond ((stringp value)
|
|
456 value)
|
|
457 ((extentp value)
|
|
458 (save-excursion
|
|
459 (set-buffer (extent-object value))
|
|
460 (save-restriction
|
|
461 (widen)
|
|
462 (buffer-substring (extent-start-position value)
|
|
463 (extent-end-position value)))))
|
|
464 ((and (consp value)
|
|
465 (markerp (car value))
|
|
466 (markerp (cdr value)))
|
|
467 (or (eq (marker-buffer (car value)) (marker-buffer (cdr value)))
|
|
468 (signal 'error
|
|
469 (list "markers must be in the same buffer"
|
|
470 (car value) (cdr value))))
|
|
471 (save-excursion
|
|
472 (set-buffer (or (marker-buffer (car value))
|
|
473 (error "selection is in a killed buffer")))
|
|
474 (save-restriction
|
|
475 (widen)
|
|
476 (buffer-substring (car value) (cdr value)))))
|
|
477 (t nil)))
|
|
478
|
2624
|
479 (defun select-convert-to-timestamp (selection type value)
|
|
480 (let ((ts (get-xemacs-selection-timestamp selection)))
|
|
481 (if ts (cons 'TIMESTAMP ts))))
|
|
482
|
|
483 (defun select-convert-to-utf-8-text (selection type value)
|
|
484 (cond ((stringp value)
|
|
485 (cons 'UTF8_STRING (encode-coding-string value 'utf-8)))
|
|
486 ((extentp value)
|
|
487 (save-excursion
|
|
488 (set-buffer (extent-object value))
|
|
489 (save-restriction
|
|
490 (widen)
|
|
491 (cons 'UTF8_STRING
|
|
492 (encode-coding-string
|
|
493 (buffer-substring (extent-start-position value)
|
|
494 (extent-end-position value)) 'utf-8)))))
|
|
495 ((and (consp value)
|
|
496 (markerp (car value))
|
|
497 (markerp (cdr value)))
|
|
498 (or (eq (marker-buffer (car value)) (marker-buffer (cdr value)))
|
|
499 (signal 'error
|
|
500 (list "markers must be in the same buffer"
|
|
501 (car value) (cdr value))))
|
|
502 (save-excursion
|
|
503 (set-buffer (or (marker-buffer (car value))
|
|
504 (error "selection is in a killed buffer")))
|
|
505 (save-restriction
|
|
506 (widen)
|
|
507 (cons 'UTF8_STRING (encode-coding-string
|
|
508 (buffer-substring (car value) (cdr value))
|
|
509 'utf-8)))))
|
|
510 (t nil)))
|
|
511
|
442
|
512 (defun select-coerce-to-text (selection type value)
|
|
513 (select-convert-to-text selection type value))
|
|
514
|
428
|
515 (defun select-convert-to-string (selection type value)
|
|
516 (let ((outval (select-convert-to-text selection type value)))
|
442
|
517 ;; force the string to be not in Compound Text format. This grubby
|
|
518 ;; hack will go soon, to be replaced by a more general mechanism.
|
428
|
519 (if (stringp outval)
|
|
520 (cons 'STRING outval)
|
|
521 outval)))
|
|
522
|
|
523 (defun select-convert-to-compound-text (selection type value)
|
|
524 ;; converts to compound text automatically
|
|
525 (select-convert-to-text selection type value))
|
|
526
|
|
527 (defun select-convert-to-length (selection type value)
|
|
528 (let ((value
|
|
529 (cond ((stringp value)
|
|
530 (length value))
|
|
531 ((extentp value)
|
|
532 (extent-length value))
|
|
533 ((and (consp value)
|
|
534 (markerp (car value))
|
|
535 (markerp (cdr value)))
|
|
536 (or (eq (marker-buffer (car value))
|
|
537 (marker-buffer (cdr value)))
|
|
538 (signal 'error
|
|
539 (list "markers must be in the same buffer"
|
|
540 (car value) (cdr value))))
|
|
541 (abs (- (car value) (cdr value)))))))
|
|
542 (if value ; force it to be in 32-bit format.
|
|
543 (cons (ash value -16) (logand value 65535))
|
|
544 nil)))
|
|
545
|
|
546 (defun select-convert-to-targets (selection type value)
|
|
547 ;; return a vector of atoms, but remove duplicates first.
|
|
548 (let* ((all (cons 'TIMESTAMP (mapcar 'car selection-converter-alist)))
|
|
549 (rest all))
|
|
550 (while rest
|
|
551 (cond ((memq (car rest) (cdr rest))
|
|
552 (setcdr rest (delq (car rest) (cdr rest))))
|
|
553 (t
|
|
554 (setq rest (cdr rest)))))
|
|
555 (apply 'vector all)))
|
|
556
|
|
557 (defun select-convert-to-delete (selection type value)
|
|
558 (disown-selection-internal selection)
|
|
559 ;; A return value of nil means that we do not know how to do this conversion,
|
|
560 ;; and replies with an "error". A return value of NULL means that we have
|
|
561 ;; done the conversion (and any side-effects) but have no value to return.
|
|
562 'NULL)
|
|
563
|
|
564 (defun select-convert-to-filename (selection type value)
|
|
565 (cond ((extentp value)
|
|
566 (buffer-file-name (or (extent-object value)
|
|
567 (error "selection is in a killed buffer"))))
|
|
568 ((and (consp value)
|
|
569 (markerp (car value))
|
|
570 (markerp (cdr value)))
|
|
571 (buffer-file-name (or (marker-buffer (car value))
|
|
572 (error "selection is in a killed buffer"))))
|
|
573 (t nil)))
|
|
574
|
|
575 (defun select-convert-to-charpos (selection type value)
|
|
576 (let (a b tmp)
|
|
577 (cond ((cond ((extentp value)
|
|
578 (setq a (extent-start-position value)
|
|
579 b (extent-end-position value)))
|
|
580 ((and (consp value)
|
|
581 (markerp (car value))
|
|
582 (markerp (cdr value)))
|
|
583 (setq a (car value)
|
|
584 b (cdr value))))
|
|
585 (setq a (1- a) b (1- b)) ; zero-based
|
|
586 (if (< b a) (setq tmp a a b b tmp))
|
|
587 (cons 'SPAN
|
|
588 (vector (cons (ash a -16) (logand a 65535))
|
|
589 (cons (ash b -16) (logand b 65535))))))))
|
|
590
|
|
591 (defun select-convert-to-lineno (selection type value)
|
|
592 (let (a b buf tmp)
|
|
593 (cond ((cond ((extentp value)
|
|
594 (setq buf (extent-object value)
|
|
595 a (extent-start-position value)
|
|
596 b (extent-end-position value)))
|
|
597 ((and (consp value)
|
|
598 (markerp (car value))
|
|
599 (markerp (cdr value)))
|
|
600 (setq a (marker-position (car value))
|
|
601 b (marker-position (cdr value))
|
|
602 buf (marker-buffer (car value)))))
|
|
603 (save-excursion
|
|
604 (set-buffer buf)
|
|
605 (save-restriction
|
|
606 (widen)
|
|
607 (goto-char a)
|
|
608 (beginning-of-line)
|
|
609 (setq a (1+ (count-lines 1 (point))))
|
|
610 (goto-char b)
|
|
611 (beginning-of-line)
|
|
612 (setq b (1+ (count-lines 1 (point))))))
|
|
613 (if (< b a) (setq tmp a a b b tmp))
|
|
614 (cons 'SPAN
|
|
615 (vector (cons (ash a -16) (logand a 65535))
|
|
616 (cons (ash b -16) (logand b 65535))))))))
|
|
617
|
|
618 (defun select-convert-to-colno (selection type value)
|
|
619 (let (a b buf tmp)
|
|
620 (cond ((cond ((extentp value)
|
|
621 (setq buf (extent-object value)
|
|
622 a (extent-start-position value)
|
|
623 b (extent-end-position value)))
|
|
624 ((and (consp value)
|
|
625 (markerp (car value))
|
|
626 (markerp (cdr value)))
|
|
627 (setq a (car value)
|
|
628 b (cdr value)
|
|
629 buf (marker-buffer a))))
|
|
630 (save-excursion
|
|
631 (set-buffer buf)
|
|
632 (goto-char a)
|
|
633 (setq a (current-column))
|
|
634 (goto-char b)
|
|
635 (setq b (current-column)))
|
|
636 (if (< b a) (setq tmp a a b b tmp))
|
|
637 (cons 'SPAN
|
|
638 (vector (cons (ash a -16) (logand a 65535))
|
|
639 (cons (ash b -16) (logand b 65535))))))))
|
|
640
|
|
641 (defun select-convert-to-sourceloc (selection type value)
|
|
642 (let (a b buf file-name tmp)
|
|
643 (cond ((cond ((extentp value)
|
|
644 (setq buf (or (extent-object value)
|
|
645 (error "selection is in a killed buffer"))
|
|
646 a (extent-start-position value)
|
|
647 b (extent-end-position value)
|
|
648 file-name (buffer-file-name buf)))
|
|
649 ((and (consp value)
|
|
650 (markerp (car value))
|
|
651 (markerp (cdr value)))
|
|
652 (setq a (marker-position (car value))
|
|
653 b (marker-position (cdr value))
|
|
654 buf (or (marker-buffer (car value))
|
|
655 (error "selection is in a killed buffer"))
|
|
656 file-name (buffer-file-name buf))))
|
|
657 (save-excursion
|
|
658 (set-buffer buf)
|
|
659 (save-restriction
|
|
660 (widen)
|
|
661 (goto-char a)
|
|
662 (beginning-of-line)
|
|
663 (setq a (1+ (count-lines 1 (point))))
|
|
664 (goto-char b)
|
|
665 (beginning-of-line)
|
|
666 (setq b (1+ (count-lines 1 (point))))))
|
|
667 (if (< b a) (setq tmp a a b b tmp))
|
|
668 (format "%s:%d" file-name a)))))
|
|
669
|
|
670 (defun select-convert-to-os (selection type size)
|
|
671 (symbol-name system-type))
|
|
672
|
|
673 (defun select-convert-to-host (selection type size)
|
|
674 (system-name))
|
|
675
|
|
676 (defun select-convert-to-user (selection type size)
|
|
677 (user-full-name))
|
|
678
|
|
679 (defun select-convert-to-class (selection type size)
|
442
|
680 (symbol-value 'x-emacs-application-class))
|
428
|
681
|
|
682 ;; We do not try to determine the name Emacs was invoked with,
|
|
683 ;; because it is not clean for a program's behavior to depend on that.
|
|
684 (defun select-convert-to-name (selection type size)
|
|
685 ;invocation-name
|
|
686 "xemacs")
|
|
687
|
|
688 (defun select-convert-to-integer (selection type value)
|
|
689 (and (integerp value)
|
|
690 (cons (ash value -16) (logand value 65535))))
|
|
691
|
442
|
692 ;; Can convert from the following integer representations
|
|
693 ;;
|
|
694 ;; integer
|
|
695 ;; (integer . integer)
|
|
696 ;; (integer integer)
|
|
697 ;; (list [integer|(integer . integer)]*)
|
|
698 ;; (vector [integer|(integer . integer)]*)
|
|
699 ;;
|
|
700 ;; Cons'd integers get cleaned up a little.
|
|
701
|
|
702 (defun select-convert-from-integer (selection type value)
|
|
703 (cond ((integerp value) ; Integer
|
|
704 value)
|
444
|
705
|
442
|
706 ((and (consp value) ; (integer . integer)
|
|
707 (integerp (car value))
|
|
708 (integerp (cdr value)))
|
|
709 (if (eq (car value) 0)
|
|
710 (cdr value)
|
|
711 (if (and (eq (car value) -1)
|
|
712 (< (cdr value) 0))
|
|
713 (cdr value)
|
|
714 value)))
|
444
|
715
|
442
|
716 ((and (listp value) ; (integer integer)
|
|
717 (eq (length value) 2)
|
|
718 (integerp (car value))
|
|
719 (integerp (cadr value)))
|
|
720 (if (eq (car value) 0)
|
|
721 (cadr value)
|
|
722 (if (and (eq (car value) -1)
|
|
723 (< (cdr value) 0))
|
|
724 (- (cadr value))
|
|
725 (cons (car value) (cadr value)))))
|
444
|
726
|
442
|
727 ((listp value) ; list
|
|
728 (if (cdr value)
|
|
729 (mapcar '(lambda (x)
|
|
730 (select-convert-from-integer selection type x))
|
|
731 value)
|
|
732 (select-convert-from-integer selection type (car value))))
|
444
|
733
|
442
|
734 ((vectorp value) ; vector
|
|
735 (if (eq (length value) 1)
|
|
736 (select-convert-from-integer selection type (aref value 0))
|
|
737 (mapvector '(lambda (x)
|
|
738 (select-convert-from-integer selection type x))
|
|
739 value)))
|
444
|
740
|
442
|
741 (t nil)
|
|
742 ))
|
|
743
|
2624
|
744 (defun select-convert-from-ip-address (selection type value)
|
|
745 (if (and (stringp value)
|
|
746 (= (length value) 4))
|
|
747 (format "%d.%d.%d.%d"
|
|
748 (aref value 0) (aref value 1) (aref value 2) (aref value 3))))
|
|
749
|
428
|
750 (defun select-convert-to-atom (selection type value)
|
|
751 (and (symbolp value) value))
|
|
752
|
2624
|
753 (defun select-convert-from-utf-8-text (selection type value)
|
|
754 (decode-coding-string value 'utf-8))
|
|
755
|
|
756 (defun select-convert-from-utf-16-le-text (selection type value)
|
|
757 (decode-coding-string value 'utf-16-le))
|
|
758
|
|
759 ;; Image conversion.
|
|
760 (defun select-convert-from-image-data (image-type value)
|
|
761 "Take an image type specification--one of the image types this XEmacs
|
|
762 supports--and some data in that format, return a space, with a glyph
|
|
763 corresponding to that data as an end-glyph extent property of that space. "
|
|
764 (let* ((str (make-string 1 ?\ ))
|
|
765 (extent (make-extent 0 1 str))
|
|
766 (glyph (make-glyph (vector image-type ':data value))))
|
|
767 (when glyph
|
|
768 (set-extent-property extent 'invisible t)
|
|
769 (set-extent-property extent 'start-open t)
|
|
770 (set-extent-property extent 'end-open t)
|
|
771 (set-extent-property extent 'duplicable t)
|
|
772 (set-extent-property extent 'atomic t)
|
|
773 (set-extent-end-glyph extent glyph)
|
|
774 str)))
|
|
775
|
|
776 ;; Could automate defining these functions these with a macro, but damned if
|
|
777 ;; I can get that to work. Anyway, this is more readable.
|
|
778
|
|
779 (defun select-convert-from-image/gif (selection type value)
|
|
780 (if (featurep 'gif) (select-convert-from-image-data 'gif value)))
|
|
781
|
|
782 (defun select-convert-from-image/jpeg (selection type value)
|
|
783 (if (featurep 'jpeg) (select-convert-from-image-data 'jpeg value)))
|
|
784
|
|
785 (defun select-convert-from-image/png (selection type value)
|
|
786 (if (featurep 'png) (select-convert-from-image-data 'png value)))
|
|
787
|
|
788 (defun select-convert-from-image/tiff (selection type value)
|
|
789 (if (featurep 'tiff) (select-convert-from-image-data 'tiff value)))
|
|
790
|
|
791 (defun select-convert-from-image/xpm (selection type value)
|
|
792 (if (featurep 'xpm) (select-convert-from-image-data 'xpm value)))
|
|
793
|
|
794 (defun select-convert-from-image/xbm (selection type value)
|
|
795 (if (featurep 'xbm) (select-convert-from-image-data 'xbm value)))
|
|
796
|
442
|
797 ;;; CF_xxx conversions
|
|
798 (defun select-convert-from-cf-text (selection type value)
|
2624
|
799 (if (find-coding-system 'mswindows-multibyte)
|
|
800 (let ((value (decode-coding-string value 'mswindows-multibyte)))
|
|
801 (replace-in-string (if (string-match "\0" value)
|
|
802 (substring value 0 (match-beginning 0))
|
|
803 value)
|
|
804 "\\(\r\n\\|\n\r\\)" "\n" t))))
|
771
|
805
|
|
806 (defun select-convert-from-cf-unicodetext (selection type value)
|
2624
|
807 (if (find-coding-system 'mswindows-unicode)
|
|
808 (let ((value (decode-coding-string value 'mswindows-unicode)))
|
|
809 (replace-in-string (if (string-match "\0" value)
|
|
810 (substring value 0 (match-beginning 0))
|
|
811 value)
|
|
812 "\\(\r\n\\|\n\r\\)" "\n" t))))
|
442
|
813
|
|
814 (defun select-convert-to-cf-text (selection type value)
|
2624
|
815 (if (find-coding-system 'mswindows-multibyte)
|
|
816 (let ((text (select-convert-to-text selection type value)))
|
|
817 (encode-coding-string
|
|
818 (concat (replace-in-string text "\n" "\r\n" t) "\0")
|
|
819 'mswindows-multibyte))))
|
771
|
820
|
|
821 (defun select-convert-to-cf-unicodetext (selection type value)
|
2624
|
822 (if (find-coding-system 'mswindows-unicode)
|
|
823 (let ((text (select-convert-to-text selection type value)))
|
|
824 (encode-coding-string
|
|
825 (concat (replace-in-string text "\n" "\r\n" t) "\0")
|
|
826 'mswindows-unicode))))
|
442
|
827
|
|
828 ;;; Appenders
|
|
829 (defun select-append-to-text (selection type value1 value2)
|
|
830 (let ((text1 (select-convert-to-text selection 'STRING value1))
|
|
831 (text2 (select-convert-to-text selection 'STRING value2)))
|
|
832 (if (and text1 text2)
|
|
833 (concat text1 text2)
|
|
834 nil)))
|
|
835
|
|
836 (defun select-append-to-string (selection type value1 value2)
|
|
837 (select-append-to-text selection type value1 value2))
|
|
838
|
|
839 (defun select-append-to-compound-text (selection type value1 value2)
|
|
840 (select-append-to-text selection type value1 value2))
|
|
841
|
|
842 (defun select-append-to-cf-text (selection type value1 value2)
|
|
843 (let ((text1 (select-convert-from-cf-text selection 'CF_TEXT value1))
|
|
844 (text2 (select-convert-from-cf-text selection 'CF_TEXT value2)))
|
|
845 (if (and text1 text2)
|
|
846 (select-convert-to-cf-text selection type (concat text1 text2))
|
|
847 nil)))
|
428
|
848
|
771
|
849 (defun select-append-to-cf-unicodetext (selection type value1 value2)
|
|
850 (let ((text1 (select-convert-from-cf-unicodetext selection
|
|
851 'CF_UNICODETEXT value1))
|
|
852 (text2 (select-convert-from-cf-unicodetext selection
|
|
853 'CF_UNICODETEXT value2)))
|
|
854 (if (and text1 text2)
|
|
855 (select-convert-to-cf-unicodetext selection type (concat text1 text2))
|
|
856 nil)))
|
|
857
|
442
|
858 (defun select-append-default (selection type value1 value2)
|
|
859 ;; This appender gets used if the type is "nil" - i.e. default.
|
|
860 ;; It should probably have more cases implemented than it does - e.g.
|
|
861 ;; appending numbers to strings, etc...
|
|
862 (cond ((and (stringp value1) (stringp value2))
|
|
863 (select-append-to-string selection 'STRING value1 value2))
|
|
864 (t nil)))
|
|
865
|
|
866 ;;; Buffer kill handlers
|
|
867
|
|
868 (defun select-buffer-killed-default (selection type value buffer)
|
|
869 ;; This handler gets used if the type is "nil".
|
|
870 (cond ((extentp value)
|
|
871 (if (eq (extent-object value) buffer)
|
|
872 ; If this selection is on the clipboard, grab it quick
|
|
873 (when (eq selection 'CLIPBOARD)
|
|
874 (save-excursion
|
|
875 (set-buffer (extent-object value))
|
|
876 (save-restriction
|
|
877 (widen)
|
|
878 (buffer-substring (extent-start-position value)
|
|
879 (extent-end-position value)))))
|
|
880 value))
|
|
881 ((markerp value)
|
|
882 (unless (eq (marker-buffer value) buffer)
|
|
883 value))
|
|
884 ((and (consp value)
|
|
885 (markerp (car value))
|
|
886 (markerp (cdr value)))
|
|
887 (if (or (eq (marker-buffer (car value)) buffer)
|
|
888 (eq (marker-buffer (cdr value)) buffer))
|
|
889 ; If this selection is on the clipboard, grab it quick
|
|
890 (when (eq selection 'CLIPBOARD)
|
|
891 (save-excursion
|
|
892 (set-buffer (marker-buffer (car value)))
|
|
893 (save-restriction
|
|
894 (widen)
|
|
895 (buffer-substring (car value) (cdr value)))))
|
|
896 value))
|
|
897 (t value)))
|
|
898
|
|
899 (defun select-buffer-killed-text (selection type value buffer)
|
|
900 (select-buffer-killed-default selection type value buffer))
|
444
|
901
|
442
|
902 ;; Types listed in here can be selections of XEmacs
|
|
903 (setq selection-converter-out-alist
|
2624
|
904 '((TIMESTAMP . select-convert-to-timestamp)
|
|
905 (UTF8_STRING . select-convert-to-utf-8-text)
|
|
906 (TEXT . select-convert-to-text)
|
428
|
907 (STRING . select-convert-to-string)
|
|
908 (COMPOUND_TEXT . select-convert-to-compound-text)
|
|
909 (TARGETS . select-convert-to-targets)
|
|
910 (LENGTH . select-convert-to-length)
|
|
911 (DELETE . select-convert-to-delete)
|
|
912 (FILE_NAME . select-convert-to-filename)
|
|
913 (CHARACTER_POSITION . select-convert-to-charpos)
|
|
914 (SOURCE_LOC . select-convert-to-sourceloc)
|
|
915 (LINE_NUMBER . select-convert-to-lineno)
|
|
916 (COLUMN_NUMBER . select-convert-to-colno)
|
|
917 (OWNER_OS . select-convert-to-os)
|
|
918 (HOST_NAME . select-convert-to-host)
|
|
919 (USER . select-convert-to-user)
|
|
920 (CLASS . select-convert-to-class)
|
|
921 (NAME . select-convert-to-name)
|
|
922 (ATOM . select-convert-to-atom)
|
|
923 (INTEGER . select-convert-to-integer)
|
442
|
924 (CF_TEXT . select-convert-to-cf-text)
|
771
|
925 (CF_UNICODETEXT . select-convert-to-cf-unicodetext)
|
442
|
926 ))
|
|
927
|
|
928 ;; Types listed here can be selections foreign to XEmacs
|
|
929 (setq selection-converter-in-alist
|
|
930 '(; Specific types that get handled by generic converters
|
|
931 (INTEGER . select-convert-from-integer)
|
2624
|
932 (TIMESTAMP . select-convert-from-integer)
|
|
933 (LENGTH . select-convert-from-integer)
|
|
934 (LIST_LENGTH . select-convert-from-integer)
|
|
935 (CLIENT_WINDOW . select-convert-from-integer)
|
|
936 (PROCESS . select-convert-from-integer)
|
|
937 (IP_ADDRESS . select-convert-from-ip-address)
|
|
938 ;; We go after UTF8_STRING in preference to STRING because Mozilla,
|
|
939 ;; at least, does bad things with non-Latin-1 Unicode characters in
|
|
940 ;; STRING.
|
|
941 (UTF8_STRING . select-convert-from-utf-8-text)
|
442
|
942 (CF_TEXT . select-convert-from-cf-text)
|
771
|
943 (CF_UNICODETEXT . select-convert-from-cf-unicodetext)
|
2624
|
944 (text/html . select-convert-from-utf-16-le-text) ; Mozilla
|
|
945 (text/_moz_htmlcontext . select-convert-from-utf-16-le-text)
|
|
946 (text/_moz_htmlinfo . select-convert-from-utf-16-le-text)
|
|
947 (image/png . select-convert-from-image/png)
|
|
948 (image/gif . select-convert-from-image/gif)
|
|
949 (image/jpeg . select-convert-from-image/jpeg )
|
|
950 (image/tiff . select-convert-from-image/tiff )
|
|
951 (image/xpm . select-convert-from-image/xpm)
|
|
952 (image/xbm . select-convert-from-image/xbm)
|
428
|
953 ))
|
|
954
|
442
|
955 ;; Types listed here have special coercion functions that can munge
|
|
956 ;; other types. This can also be used to add special features - e.g.
|
|
957 ;; being able to pass a region or a cons of markers to own-selection,
|
|
958 ;; but getting the *current* text in the region back when calling
|
|
959 ;; get-selection.
|
|
960 ;;
|
|
961 ;; Any function listed in here *will be called* whenever a value of
|
|
962 ;; its type is retrieved from the internal selection cache, or when
|
|
963 ;; no suitable values could be found in which case XEmacs looks for
|
|
964 ;; values with types listed in selection-coercible-types.
|
|
965 (setq selection-coercion-alist
|
|
966 '((TEXT . select-coerce-to-text)
|
|
967 (STRING . select-coerce-to-text)
|
|
968 (COMPOUND_TEXT . select-coerce-to-text)
|
771
|
969 (CF_TEXT . select-coerce-to-text)
|
|
970 (CF_UNICODETEXT . select-coerce-to-text)
|
|
971 ))
|
442
|
972
|
|
973 ;; Types listed here can be appended by own-selection
|
|
974 (setq selection-appender-alist
|
|
975 '((nil . select-append-default)
|
|
976 (TEXT . select-append-to-text)
|
|
977 (STRING . select-append-to-string)
|
|
978 (COMPOUND_TEXT . select-append-to-compound-text)
|
|
979 (CF_TEXT . select-append-to-cf-text)
|
771
|
980 (CF_UNICODETEXT . select-append-to-cf-unicodetext)
|
442
|
981 ))
|
|
982
|
|
983 ;; Types listed here have buffer-kill handlers
|
|
984 (setq selection-buffer-killed-alist
|
|
985 '((nil . select-buffer-killed-default)
|
|
986 (TEXT . select-buffer-killed-text)
|
|
987 (STRING . select-buffer-killed-text)
|
|
988 (COMPOUND_TEXT . select-buffer-killed-text)
|
771
|
989 (CF_TEXT . select-buffer-killed-text)
|
|
990 (CF_UNICODETEXT . select-buffer-killed-text)
|
|
991 ))
|
442
|
992
|
|
993 ;; Lists of types that are coercible (can be converted to other types)
|
771
|
994 (setq selection-coercible-types '(TEXT STRING COMPOUND_TEXT CF_TEXT CF_UNICODETEXT))
|
442
|
995
|
428
|
996 ;;; select.el ends here
|