31 |
(defalias 'x-selection 'x-get-selection) |
(defalias 'x-selection 'x-get-selection) |
32 |
(defun x-get-selection (&optional type data-type) |
(defun x-get-selection (&optional type data-type) |
33 |
"Return the value of an X Windows selection. |
"Return the value of an X Windows selection. |
34 |
The argument TYPE (default `PRIMARY') says which selection, |
The argument TYPE (default `PRIMARY') says which selection, |
35 |
and the argument DATA-TYPE (default `STRING') says |
and the argument DATA-TYPE (default `STRING') says |
36 |
how to convert the data. |
how to convert the data. |
37 |
|
|
46 |
|
|
47 |
(defun x-set-selection (type data) |
(defun x-set-selection (type data) |
48 |
"Make an X Windows selection of type TYPE and value DATA. |
"Make an X Windows selection of type TYPE and value DATA. |
49 |
The argument TYPE (default `PRIMARY') says which selection, |
The argument TYPE (default `PRIMARY') says which selection, |
50 |
and DATA specifies the contents. DATA may be a string, |
and DATA specifies the contents. DATA may be a string, |
51 |
a symbol, an integer (or a cons of two integers or list of two integers). |
a symbol, an integer (or a cons of two integers or list of two integers). |
52 |
|
|
53 |
The selection may also be a cons of two markers pointing to the same buffer, |
The selection may also be a cons of two markers pointing to the same buffer, |
54 |
or an overlay. In these cases, the selection is considered to be the text |
or an overlay. In these cases, the selection is considered to be the text |
55 |
between the markers *at whatever time the selection is examined*. |
between the markers *at whatever time the selection is examined*. |
56 |
Thus, editing done in the buffer after you specify the selection |
Thus, editing done in the buffer after you specify the selection |
57 |
can alter the effective value of the selection. |
can alter the effective value of the selection. |
118 |
(defun x-set-cut-buffer (string &optional push) |
(defun x-set-cut-buffer (string &optional push) |
119 |
"Store STRING into the X server's primary cut buffer. |
"Store STRING into the X server's primary cut buffer. |
120 |
If PUSH is non-nil, also rotate the cut buffers: |
If PUSH is non-nil, also rotate the cut buffers: |
121 |
this means the previous value of the primary cut buffer moves the second |
this means the previous value of the primary cut buffer moves to the second |
122 |
cut buffer, and the second to the third, and so on (there are 8 buffers.) |
cut buffer, and the second to the third, and so on (there are 8 buffers.) |
123 |
Cut buffers are considered obsolete; you should use selections instead." |
Cut buffers are considered obsolete; you should use selections instead." |
124 |
;; Check the data type of STRING. |
(or (stringp string) (signal 'wrong-type-argument (list 'string string))) |
|
(substring string 0 0) |
|
125 |
(if push |
(if push |
126 |
(x-rotate-cut-buffers-internal 1)) |
(x-rotate-cut-buffers-internal 1)) |
127 |
(x-store-cut-buffer-internal 'CUT_BUFFER0 string)) |
(x-store-cut-buffer-internal 'CUT_BUFFER0 string)) |
190 |
'STRING)) |
'STRING)) |
191 |
(setq type 'STRING |
(setq type 'STRING |
192 |
str (encode-coding-string str 'iso-latin-1)))))) |
str (encode-coding-string str 'iso-latin-1)))))) |
193 |
|
|
194 |
((eq type 'COMPOUND_TEXT) |
((eq type 'COMPOUND_TEXT) |
195 |
(setq str (encode-coding-string str coding))) |
(setq str (encode-coding-string str coding))) |
196 |
|
|