update.
[chise/xemacs-chise.git-] / lisp / select.el
index b185dea..3905641 100644 (file)
@@ -75,15 +75,9 @@ set the clipboard.")
       (insert clip))))
 
 (defun get-clipboard ()
-  "Return text pasted to the clipboard.
-Not suitable for `interprogram-paste-function', use `get-clipboard-foreign'."
+  "Return text pasted to the clipboard."
   (get-selection 'CLIPBOARD))
 
-(defun get-clipboard-foreign ()
-  "Return text pasted to the clipboard by another program.
-See `interprogram-paste-function' for more information."
-  (get-selection-foreign 'CLIPBOARD))
-
 (define-device-method get-cutbuffer
   "Return the value of one of the cut buffers.
 This will do nothing under anything other than X.")
@@ -99,27 +93,19 @@ says how to convert the data. Returns NIL if there is no selection."
   "Return the value of a window-system selection.
 The argument TYPE (default `PRIMARY') says which selection,
 and the argument DATA-TYPE (default `STRING', or `COMPOUND_TEXT' under Mule)
-says how to convert the data. If there is no selection an error is signalled.
-Not suitable in a `interprogram-paste-function', q.v."
+says how to convert the data. If there is no selection an error is signalled."
   (or type (setq type 'PRIMARY))
   (or data-type (setq data-type selected-text-type))
-  (if (consp data-type)
-      (condition-case err
-         (get-selection-internal type (car data-type))
-       (selection-conversion-error
-        (if (cdr data-type)
-            (get-selection type (cdr data-type))
-          (signal (car err) (cdr err)))))
-    (get-selection-internal type data-type)))
-
-(defun get-selection-foreign (&optional type data-type)
-  "Return the value of a window-system selection, or nil if XEmacs owns it.
-The argument TYPE (default `PRIMARY') says which selection,
-and the argument DATA-TYPE (default `STRING', or `COMPOUND_TEXT' under Mule)
-says how to convert the data. If there is no selection an error is signalled.
-See `interprogram-paste-function' for more information."
-  (unless (selection-owner-p type)
-    (get-selection type data-type)))
+  (let ((text
+        (if (consp data-type)
+            (condition-case err
+                (get-selection-internal type (car data-type))
+              (selection-conversion-error
+               (if (cdr data-type)
+                   (get-selection type (cdr data-type))
+                 (signal (car err) (cdr err)))))
+          (get-selection-internal type data-type))))
+    text))
 
 ;; FSFmacs calls this `x-set-selection', and reverses the
 ;; first two arguments (duh ...).  This order is more logical.
@@ -210,9 +196,8 @@ See `interprogram-cut-function' for more information."
   (own-selection string 'CLIPBOARD))
 
 (defun disown-selection (&optional secondary-p)
-  "Assuming we own the selection, disown it.
-With an argument, discard the secondary selection instead of the
-primary selection."
+  "Assuming we own the selection, disown it.  With an argument, discard the
+secondary selection instead of the primary selection."
   (disown-selection-internal (if secondary-p 'SECONDARY 'PRIMARY))
   (when (and selection-sets-clipboard
             (or (not secondary-p)