Mercurial > hg > xemacs-beta
comparison lisp/msw-select.el @ 288:e11d67e05968 r21-0b42
Import from CVS: tag r21-0b42
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:35:54 +0200 |
parents | 57709be46d1b |
children | 74fd4e045ea6 |
comparison
equal
deleted
inserted
replaced
287:13a0bd77a29d | 288:e11d67e05968 |
---|---|
51 | 51 |
52 (defun mswindows-own-clipboard (string) | 52 (defun mswindows-own-clipboard (string) |
53 "Paste the given string to the mswindows clipboard." | 53 "Paste the given string to the mswindows clipboard." |
54 (mswindows-set-clipboard string)) | 54 (mswindows-set-clipboard string)) |
55 | 55 |
56 (defun mswindows-cut-copy-clear-clipboard (mode) | |
57 "Don't use this function. | |
58 Use mswindows-cut-clipboard, mswindows-copy-clipboard or | |
59 mswindows-clear-clipboard instead." | |
60 (or (memq mode '(cut copy clear)) (error "unkown mode %S" mode)) | |
61 (setq last-command nil) | |
62 (let ((s (mark-marker)) (e (point-marker))) | |
63 (if s | |
64 (progn | |
65 (if mouse-track-rectangle-p | |
66 (progn | |
67 (setq killed-rectangle (extract-rectangle s e)) | |
68 (kill-new (mapconcat 'identity killed-rectangle "\n"))) | |
69 (copy-region-as-kill s e)) | |
70 (if (memq mode '(cut copy)) | |
71 (mswindows-set-clipboard (car kill-ring))) | |
72 (if (memq mode '(cut clear)) | |
73 (if mouse-track-rectangle-p | |
74 (delete-rectangle s e) | |
75 (delete-region s e)) | |
76 ;; mswindows apps normally leave the selection active but that feels weird here | |
77 ;; (setq zmacs-region-stays t) | |
78 )) | |
79 (error "there is no selection to cut or copy")))) | |
80 | |
81 (defvar mswindows-selection-owned-p nil | 56 (defvar mswindows-selection-owned-p nil |
82 "Whether we have a selection or not. | 57 "Whether we have a selection or not. |
83 MS-Windows has no concept of ownership; don't use this.") | 58 MS-Windows has no concept of ownership; don't use this.") |
84 | 59 |
85 (defun mswindows-own-selection (data &optional type) | 60 (defun mswindows-own-selection (data &optional type) |
86 "Make an MS Windows selection of type TYPE and value DATA. | 61 "Make an MS-Windows selection of type TYPE and value DATA. |
87 The argument TYPE is ignored, and DATA specifies the contents. | 62 The argument TYPE is ignored, and DATA specifies the contents. |
88 DATA may be a string, | 63 DATA may be a string, |
89 a symbol, an integer (or a cons of two integers or list of two integers). | 64 a symbol, an integer (or a cons of two integers or list of two integers). |
90 | 65 |
91 The selection may also be a cons of two markers pointing to the same buffer, | 66 The selection may also be a cons of two markers pointing to the same buffer, |