Mercurial > hg > xemacs-beta
comparison lisp/x-select.el @ 444:576fb035e263 r21-2-37
Import from CVS: tag r21-2-37
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:36:19 +0200 |
parents | abe6d1db359e |
children | 7039e6323819 |
comparison
equal
deleted
inserted
replaced
443:a8296e22da4e | 444:576fb035e263 |
---|---|
49 (define-obsolete-function-alias 'x-select-make-extent-for-selection | 49 (define-obsolete-function-alias 'x-select-make-extent-for-selection |
50 'select-make-extent-for-selection) | 50 'select-make-extent-for-selection) |
51 (define-obsolete-function-alias 'x-cut-copy-clear-internal 'cut-copy-clear-internal) | 51 (define-obsolete-function-alias 'x-cut-copy-clear-internal 'cut-copy-clear-internal) |
52 (define-obsolete-function-alias 'x-get-selection 'get-selection) | 52 (define-obsolete-function-alias 'x-get-selection 'get-selection) |
53 (define-obsolete-function-alias 'x-get-clipboard 'get-clipboard) | 53 (define-obsolete-function-alias 'x-get-clipboard 'get-clipboard) |
54 (define-obsolete-function-alias 'x-yank-clipboard-selection | 54 (define-obsolete-function-alias 'x-yank-clipboard-selection |
55 'yank-clipboard-selection) | 55 'yank-clipboard-selection) |
56 (define-obsolete-function-alias 'x-disown-selection-internal | 56 (define-obsolete-function-alias 'x-disown-selection-internal |
57 'disown-selection-internal) | 57 'disown-selection-internal) |
58 | 58 |
59 (defun x-get-secondary-selection () | 59 (defun x-get-secondary-selection () |
70 (copy-marker (point-marker)) | 70 (copy-marker (point-marker)) |
71 (copy-marker (mark-marker)))))) | 71 (copy-marker (mark-marker)))))) |
72 (own-selection selection 'SECONDARY)) | 72 (own-selection selection 'SECONDARY)) |
73 | 73 |
74 (defun x-notice-selection-requests (selection type successful) | 74 (defun x-notice-selection-requests (selection type successful) |
75 "for possible use as the value of x-sent-selection-hooks." | 75 "for possible use as the value of `x-sent-selection-hooks'." |
76 (if (not successful) | 76 (if (not successful) |
77 (message "Selection request failed to convert %s to %s" | 77 (message "Selection request failed to convert %s to %s" |
78 selection type) | 78 selection type) |
79 (message "Sent selection %s as %s" selection type))) | 79 (message "Sent selection %s as %s" selection type))) |
80 | 80 |
81 (defun x-notice-selection-failures (selection type successful) | 81 (defun x-notice-selection-failures (selection type successful) |
82 "for possible use as the value of x-sent-selection-hooks." | 82 "for possible use as the value of `x-sent-selection-hooks'." |
83 (or successful | 83 (or successful |
84 (message "Selection request failed to convert %s to %s" | 84 (message "Selection request failed to convert %s to %s" |
85 selection type))) | 85 selection type))) |
86 | 86 |
87 ;(setq x-sent-selection-hooks 'x-notice-selection-requests) | 87 ;(setq x-sent-selection-hooks 'x-notice-selection-requests) |
93 ;;; FSF name x-get-cut-buffer | 93 ;;; FSF name x-get-cut-buffer |
94 (defun x-get-cutbuffer (&optional which-one) | 94 (defun x-get-cutbuffer (&optional which-one) |
95 "Return the value of one of the 8 X server cut buffers. | 95 "Return the value of one of the 8 X server cut buffers. |
96 Optional arg WHICH-ONE should be a number from 0 to 7, defaulting to 0. | 96 Optional arg WHICH-ONE should be a number from 0 to 7, defaulting to 0. |
97 Cut buffers are considered obsolete; you should use selections instead. | 97 Cut buffers are considered obsolete; you should use selections instead. |
98 This function does nothing if support for cut buffers was not compiled | 98 This function does nothing if cut buffer support was not compiled in." |
99 into Emacs." | 99 (when (fboundp 'x-get-cutbuffer-internal) |
100 (and (fboundp 'x-get-cutbuffer-internal) | 100 (x-get-cutbuffer-internal |
101 (x-get-cutbuffer-internal | 101 (aref [CUT_BUFFER0 CUT_BUFFER1 CUT_BUFFER2 CUT_BUFFER3 |
102 (if which-one | 102 CUT_BUFFER4 CUT_BUFFER5 CUT_BUFFER6 CUT_BUFFER7] |
103 (aref [CUT_BUFFER0 CUT_BUFFER1 CUT_BUFFER2 CUT_BUFFER3 | 103 (or which-one 0))))) |
104 CUT_BUFFER4 CUT_BUFFER5 CUT_BUFFER6 CUT_BUFFER7] | |
105 which-one) | |
106 'CUT_BUFFER0)))) | |
107 | 104 |
108 ;;; FSF name x-set-cut-buffer | 105 ;;; FSF name x-set-cut-buffer |
109 (defun x-store-cutbuffer (string &optional push) | 106 (defun x-store-cutbuffer (string &optional push) |
110 "Store STRING into the X server's primary cut buffer. | 107 "Store STRING into the X server's primary cut buffer. |
111 If PUSH is non-nil, also rotate the cut buffers: | 108 If optional arg PUSH is non-nil, also rotate the cut buffers: this |
112 this means the previous value of the primary cut buffer moves the second | 109 means the previous value of the primary cut buffer moves to the second |
113 cut buffer, and the second to the third, and so on (there are 8 buffers.) | 110 cut buffer, and the second to the third, and so on (there are 8 buffers.) |
114 Cut buffers are considered obsolete; you should use selections instead. | 111 Cut buffers are considered obsolete; you should use selections instead. |
115 This function does nothing if support for cut buffers was not compiled | 112 This function does nothing if cut buffer support was not compiled in." |
116 into Emacs." | 113 (when (fboundp 'x-store-cutbuffer-internal) |
117 (and (fboundp 'x-store-cutbuffer-internal) | 114 (when push |
118 (progn | 115 (x-rotate-cutbuffers-internal 1)) |
119 ;; Check the data type of STRING. | 116 (x-store-cutbuffer-internal 'CUT_BUFFER0 string))) |
120 (substring string 0 0) | |
121 (if push | |
122 (x-rotate-cutbuffers-internal 1)) | |
123 (x-store-cutbuffer-internal 'CUT_BUFFER0 string)))) | |
124 | 117 |
125 | 118 |
126 ;FSFmacs (provide 'select) | 119 ;FSFmacs (provide 'select) |
127 | 120 |
128 ;;; x-select.el ends here. | 121 ;;; x-select.el ends here. |