comparison 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
comparison
equal deleted inserted replaced
415:a27f76b40c83 416:ebe98a74bd68
112 (insert-selection t)))) 112 (insert-selection t))))
113 113
114 (defun insert-selection (&optional check-cutbuffer-p move-point-event) 114 (defun insert-selection (&optional check-cutbuffer-p move-point-event)
115 "Insert the current selection into buffer at point." 115 "Insert the current selection into buffer at point."
116 (interactive "P") 116 (interactive "P")
117 ;; we fallback to the clipboard if the current selection is not existent
117 (let ((text (if check-cutbuffer-p 118 (let ((text (if check-cutbuffer-p
118 (or (condition-case () (get-selection) (error ())) 119 (or (get-selection-no-error)
119 (get-cutbuffer) 120 (get-cutbuffer)
120 (error "No selection or cut buffer available")) 121 (get-selection-no-error 'CLIPBOARD)
121 (get-selection)))) 122 (error "No selection, clipboard or cut buffer available"))
123 (or (get-selection-no-error)
124 (get-selection 'CLIPBOARD)))))
122 (cond (move-point-event 125 (cond (move-point-event
123 (mouse-set-point move-point-event) 126 (mouse-set-point move-point-event)
124 (push-mark (point))) 127 (push-mark (point)))
125 ((interactive-p) 128 ((interactive-p)
126 (push-mark (point)))) 129 (push-mark (point))))