diff lisp/mouse.el @ 416:ebe98a74bd68 r21-2-16

Import from CVS: tag r21-2-16
author cvs
date Mon, 13 Aug 2007 11:22:23 +0200
parents da8ed4261e83
children 11054d720c21
line wrap: on
line diff
--- a/lisp/mouse.el	Mon Aug 13 11:21:40 2007 +0200
+++ b/lisp/mouse.el	Mon Aug 13 11:22:23 2007 +0200
@@ -114,11 +114,14 @@
 (defun insert-selection (&optional check-cutbuffer-p move-point-event)
   "Insert the current selection into buffer at point."
   (interactive "P")
+  ;; we fallback to the clipboard if the current selection is not existent
   (let ((text (if check-cutbuffer-p
-		  (or (condition-case () (get-selection) (error ()))
+		  (or (get-selection-no-error) 
 		      (get-cutbuffer)
-		      (error "No selection or cut buffer available"))
-		(get-selection))))
+		      (get-selection-no-error 'CLIPBOARD)
+		      (error "No selection, clipboard or cut buffer available"))
+		(or (get-selection-no-error)
+		    (get-selection 'CLIPBOARD)))))
     (cond (move-point-event
 	   (mouse-set-point move-point-event)
 	   (push-mark (point)))