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