;;; mouse-copy.el --- one-click text copy and move
-;; Copyright (C) 1996, 2001-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001-2016 Free Software Foundation, Inc.
;; Author: John Heidemann <johnh@ISI.EDU>
;; Keywords: mouse
;; Third, set the selection.
;; (setq me-beg beg me-end end me-range range) ; for debugging
(set-buffer end-buffer)
- (x-set-selection 'SECONDARY (buffer-substring beg end)))))
+ (gui-set-selection 'SECONDARY (buffer-substring beg end)))))
(defun mouse-drag-secondary-pasting (start-event)
"Drag out a secondary selection, then paste it at the current point.
To test this function, evaluate:
- (global-set-key [M-down-mouse-1] 'mouse-drag-secondary-pasting)
+ (global-set-key [M-down-mouse-1] \\='mouse-drag-secondary-pasting)
put the point at one place, then click and drag over some other region."
(interactive "e")
;; Work-around: We see and react to each part of a multi-click event
(mouse-copy-work-around-drag-bug start-event last-input-event))
;; Remember what we do so we can undo it, if necessary.
(setq mouse-copy-last-paste-start (point))
- (insert (x-get-selection 'SECONDARY))
+ (insert (gui-get-selection 'SECONDARY))
(setq mouse-copy-last-paste-end (point)))
(setq mouse-copy-last-paste-start nil)))
(kill-region (overlay-start mouse-secondary-overlay)
(overlay-end mouse-secondary-overlay)))
;; (delete-overlay mouse-secondary-overlay)
- ;; (x-set-selection 'SECONDARY nil)
+ ;; (gui-set-selection 'SECONDARY nil)
;; (setq mouse-secondary-overlay nil)
)
(if (mouse-drag-secondary start-event)
(progn
(mouse-kill-preserving-secondary)
- (insert (x-get-selection 'SECONDARY))))
+ (insert (gui-get-selection 'SECONDARY))))
)
(provide 'mouse-copy)