comparison lisp/select.el @ 843:f46864126a0d

[xemacs-hg @ 2002-05-15 15:27:40 by stephent] fix yank-pop bug correctly <87adr1zbdd.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Wed, 15 May 2002 15:27:58 +0000
parents 42a86787d173
children 74899b430f18
comparison
equal deleted inserted replaced
842:dc12269565c9 843:f46864126a0d
74 (push-mark) 74 (push-mark)
75 (insert clip)))) 75 (insert clip))))
76 76
77 (defun get-clipboard () 77 (defun get-clipboard ()
78 "Return text pasted to the clipboard. 78 "Return text pasted to the clipboard.
79 Not suitable for `interprogram-paste-function', use `get-clipboard-foreign'."
80 (get-selection 'CLIPBOARD))
81
82 (defun get-clipboard-foreign ()
83 "Return text pasted to the clipboard by another program.
79 See `interprogram-paste-function' for more information." 84 See `interprogram-paste-function' for more information."
80 (get-selection 'CLIPBOARD)) 85 (get-selection-foreign 'CLIPBOARD))
81 86
82 (define-device-method get-cutbuffer 87 (define-device-method get-cutbuffer
83 "Return the value of one of the cut buffers. 88 "Return the value of one of the cut buffers.
84 This will do nothing under anything other than X.") 89 This will do nothing under anything other than X.")
85 90
89 and the argument DATA-TYPE (default `STRING', or `COMPOUND_TEXT' under Mule) 94 and the argument DATA-TYPE (default `STRING', or `COMPOUND_TEXT' under Mule)
90 says how to convert the data. Returns NIL if there is no selection." 95 says how to convert the data. Returns NIL if there is no selection."
91 (condition-case nil (get-selection type data-type) (t nil))) 96 (condition-case nil (get-selection type data-type) (t nil)))
92 97
93 (defun get-selection (&optional type data-type) 98 (defun get-selection (&optional type data-type)
94 "Return the value of a window-system selection, or nil if XEmacs owns it. 99 "Return the value of a window-system selection.
95 The argument TYPE (default `PRIMARY') says which selection, 100 The argument TYPE (default `PRIMARY') says which selection,
96 and the argument DATA-TYPE (default `STRING', or `COMPOUND_TEXT' under Mule) 101 and the argument DATA-TYPE (default `STRING', or `COMPOUND_TEXT' under Mule)
97 says how to convert the data. If there is no selection an error is signalled. 102 says how to convert the data. If there is no selection an error is signalled.
98 See `interprogram-paste-function' for more information." 103 Not suitable in a `interprogram-paste-function', q.v."
99 (or type (setq type 'PRIMARY)) 104 (or type (setq type 'PRIMARY))
100 (or data-type (setq data-type selected-text-type)) 105 (or data-type (setq data-type selected-text-type))
101 (if (consp data-type) 106 (if (consp data-type)
102 (condition-case err 107 (condition-case err
103 (get-selection-internal type (car data-type)) 108 (get-selection-internal type (car data-type))