X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fmouse.el;h=4a0a22cf0dd05055c24b6ee5cb4abe91e19ce1b8;hb=81572e9b4653c5545c2eb43e87dec439f356c19c;hp=c42c8aa2f06c56541d95ca2bfca2129483f1600b;hpb=113b194be934327de99a168d809271db252c07c4;p=chise%2Fxemacs-chise.git diff --git a/lisp/mouse.el b/lisp/mouse.el index c42c8aa..4a0a22c 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -84,10 +84,13 @@ If set to `symbol', double-click will always attempt to highlight a "Function that is called upon by `mouse-yank' to actually insert text.") (defun mouse-consolidated-yank () - "Insert the current selection or, if there is none under X insert the X cutbuffer. -A mark is pushed, so that the inserted text lies between point and mark." + "Insert the current selection or, if there is none under X insert +the X cutbuffer. A mark is pushed, so that the inserted text lies +between point and mark." (interactive) - (if (not (console-on-window-system-p)) + (if (and (not (console-on-window-system-p)) + (and (featurep 'gpm) + (not gpm-minor-mode))) (yank) (push-mark) (if (region-active-p) @@ -114,11 +117,14 @@ A mark is pushed, so that the inserted text lies between point and mark." (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))) @@ -222,9 +228,10 @@ This functions has to be improved. Currently it is just a (working) test." (if (click-inside-extent-p event zmacs-region-extent) ;; okay, this is a drag (cond ((featurep 'offix) - (offix-start-drag-region event - (extent-start-position zmacs-region-extent) - (extent-end-position zmacs-region-extent))) + (offix-start-drag-region + event + (extent-start-position zmacs-region-extent) + (extent-end-position zmacs-region-extent))) ((featurep 'cde) ;; should also work with CDE (cde-start-drag-region event