comparison lisp/select.el @ 11406:dc4b96a8dc2e

(x-set-selection): Fix up interactive defaults.
author Richard M. Stallman <rms@gnu.org>
date Thu, 13 Apr 1995 02:34:03 +0000
parents cc7cd83ccf3f
children 83f275dcd93a
comparison
equal deleted inserted replaced
11405:645e3883da72 11406:dc4b96a8dc2e
37 37
38 (defun x-set-selection (type data) 38 (defun x-set-selection (type data)
39 "Make an X Windows selection of type TYPE and value DATA. 39 "Make an X Windows selection of type TYPE and value DATA.
40 The argument TYPE (default `PRIMARY') says which selection, 40 The argument TYPE (default `PRIMARY') says which selection,
41 and DATA specifies the contents. DATA may be a string, 41 and DATA specifies the contents. DATA may be a string,
42 a symbol, an integer (or a cons of two integers or list of two integers), 42 a symbol, an integer (or a cons of two integers or list of two integers).
43 or a cons of two markers pointing to the same buffer. 43
44 In the last case, the selection is considered to be the text 44 The selection may also be a cons of two markers pointing to the same buffer,
45 between the markers. 45 or an overlay. In these cases, the selection is considered to be the text
46 The data may also be a vector of valid non-vector selection values." 46 between the markers *at whatever time the selection is examined*.
47 Thus, editing done in the buffer after you specify the selection
48 can alter the effective value of the selection.
49
50 The data may also be a vector of valid non-vector selection values.
51
52 Interactively, the text of the region is used as the selection value."
47 (interactive (if (not current-prefix-arg) 53 (interactive (if (not current-prefix-arg)
48 (list (read-string "Store text for pasting: ")) 54 (list 'PRIMARY (read-string "Set text for pasting: "))
49 (list (cons ;; these need not be ordered. 55 (list 'PRIMARY (substring (region-beginning) (region-end)))))
50 (copy-marker (point-marker))
51 (copy-marker (mark-marker))))))
52 ;; This is for temporary compatibility with pre-release Emacs 19. 56 ;; This is for temporary compatibility with pre-release Emacs 19.
53 (if (stringp type) 57 (if (stringp type)
54 (setq type (intern type))) 58 (setq type (intern type)))
55 (or (x-valid-simple-selection-p data) 59 (or (x-valid-simple-selection-p data)
56 (and (vectorp data) 60 (and (vectorp data)