Mercurial > hg > xemacs-beta
comparison lisp/mouse.el @ 280:7df0dd720c89 r21-0b38
Import from CVS: tag r21-0b38
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:32:22 +0200 |
parents | c5d627a313b1 |
children | c42ec1d1cded |
comparison
equal
deleted
inserted
replaced
279:c20b2fb5bb0a | 280:7df0dd720c89 |
---|---|
976 (move-to-column left pad-p)) | 976 (move-to-column left pad-p)) |
977 ))))) | 977 ))))) |
978 )))) | 978 )))) |
979 | 979 |
980 (defun default-mouse-track-has-selection-p (buffer) | 980 (defun default-mouse-track-has-selection-p (buffer) |
981 (and (or (not (eq 'x (console-type))) | 981 (and (selection-owner-p) |
982 (x-selection-owner-p)) | |
983 (extent-live-p primary-selection-extent) | 982 (extent-live-p primary-selection-extent) |
984 (not (extent-detached-p primary-selection-extent)) | 983 (not (extent-detached-p primary-selection-extent)) |
985 (eq buffer (extent-object primary-selection-extent)))) | 984 (eq buffer (extent-object primary-selection-extent)))) |
986 | 985 |
987 (defun default-mouse-track-anchor (adjust previous-point) | 986 (defun default-mouse-track-anchor (adjust previous-point) |
1041 ;; would help guarantee success with the price that the | 1040 ;; would help guarantee success with the price that the |
1042 ;; delay would start to become noticable. | 1041 ;; delay would start to become noticable. |
1043 ;; | 1042 ;; |
1044 (sit-for 0.15 t) | 1043 (sit-for 0.15 t) |
1045 (zmacs-activate-region))) | 1044 (zmacs-activate-region))) |
1046 ((eq 'x (console-type)) | 1045 ((or (eq 'x (console-type)) |
1046 (eq 'mswindows (console-type))) | |
1047 (if (= start end) | 1047 (if (= start end) |
1048 (x-disown-selection type) | 1048 (disown-selection type) |
1049 (if (consp default-mouse-track-extent) | 1049 (if (consp default-mouse-track-extent) |
1050 ;; own the rectangular region | 1050 ;; own the rectangular region |
1051 ;; this is a hack | 1051 ;; this is a hack |
1052 (let ((r default-mouse-track-extent)) | 1052 (let ((r default-mouse-track-extent)) |
1053 (save-excursion | 1053 (save-excursion |
1054 (set-buffer (get-buffer-create " *rect yank temp buf*")) | 1054 (set-buffer (get-buffer-create " *rect yank temp buf*")) |
1055 (while r | 1055 (while r |
1056 (insert (extent-string (car r)) "\n") | 1056 (insert (extent-string (car r)) "\n") |
1057 (setq r (cdr r))) | 1057 (setq r (cdr r))) |
1058 (x-own-selection (buffer-substring (point-min) (point-max))) | 1058 (own-selection (buffer-substring (point-min) (point-max))) |
1059 (kill-buffer (current-buffer)))) | 1059 (kill-buffer (current-buffer)))) |
1060 (x-own-selection (cons (set-marker (make-marker) start) | 1060 (own-selection (cons (set-marker (make-marker) start) |
1061 (set-marker (make-marker) end)) | 1061 (set-marker (make-marker) end)) |
1062 type))))) | 1062 type))))) |
1063 (if (and (eq 'x (console-type)) | 1063 (if (and (eq 'x (console-type)) |
1064 (not (= start end))) | 1064 (not (= start end))) |
1065 ;; I guess cutbuffers should do something with rectangles too. | 1065 ;; I guess cutbuffers should do something with rectangles too. |
1066 ;; does anybody use them? | 1066 ;; does anybody use them? |
1067 (x-store-cutbuffer (buffer-substring start end))))) | 1067 (x-store-cutbuffer (buffer-substring start end))))) |