2183 |
ctext |
ctext |
2184 |
utf8))))) |
utf8))))) |
2185 |
|
|
2186 |
|
;; Get a selection value of type TYPE by calling x-get-selection with |
2187 |
|
;; an appropiate DATA-TYPE argument decidd by `x-select-request-type'. |
2188 |
|
;; The return value is already decoded. If x-get-selection causes an |
2189 |
|
;; error, this function return nil. |
2190 |
|
|
2191 |
(defun x-selection-value (type) |
(defun x-selection-value (type) |
2192 |
(let (text) |
(let (text) |
2193 |
(cond ((null x-select-request-type) |
(cond ((null x-select-request-type) |
2470 |
(defun x-clipboard-yank () |
(defun x-clipboard-yank () |
2471 |
"Insert the clipboard contents, or the last stretch of killed text." |
"Insert the clipboard contents, or the last stretch of killed text." |
2472 |
(interactive) |
(interactive) |
2473 |
(let ((clipboard-text |
(let ((clipboard-text (x-selection-value 'CLIPBOARD)) |
|
(condition-case nil |
|
|
(x-selection-value 'CLIPBOARD) |
|
|
(error nil))) |
|
2474 |
(x-select-enable-clipboard t)) |
(x-select-enable-clipboard t)) |
2475 |
(if (and clipboard-text (> (length clipboard-text) 0)) |
(if (and clipboard-text (> (length clipboard-text) 0)) |
2476 |
(kill-new clipboard-text)) |
(kill-new clipboard-text)) |