comparison lisp/select.el @ 487:54fa1a5c2d12

[xemacs-hg @ 2001-04-28 07:48:36 by ben] misc changes, some for 21.4 remove bogus lines setting zmacs_region_stays to 0. remove debug lines. Correct general info about init file. Fix up Cygwin section. More contributions. Fix spurious setting of zmacs-region-stays to t after a non-shift motion command. Sync up with FSF 20.7, to fix bugs handling some etags line formats. Move non-window-system specific code that was duplicated in all window systems into the generic code. * gutter.el (init-gutter): Removed. (unused) Clean up the rectangle code w.r.t. selections. You'll now get the right text copied into the primary selection (but not the clipboard yet, unfortunately -- that really requires defining our own rectangle type).
author ben
date Sat, 28 Apr 2001 07:48:46 +0000
parents 576fb035e263
children 943eaba38521
comparison
equal deleted inserted replaced
486:a83afd50994d 487:54fa1a5c2d12
194 "Paste the given string to the window system Clipboard. 194 "Paste the given string to the window system Clipboard.
195 See `interprogram-cut-function' for more information." 195 See `interprogram-cut-function' for more information."
196 (own-selection string 'CLIPBOARD)) 196 (own-selection string 'CLIPBOARD))
197 197
198 (defun disown-selection (&optional secondary-p) 198 (defun disown-selection (&optional secondary-p)
199 "Assuming we own the selection, disown it. With an argument, discard the 199 "Assuming we own the selection, disown it.
200 secondary selection instead of the primary selection." 200 With an argument, discard the secondary selection instead of the
201 primary selection."
201 (disown-selection-internal (if secondary-p 'SECONDARY 'PRIMARY)) 202 (disown-selection-internal (if secondary-p 'SECONDARY 'PRIMARY))
202 (when (and selection-sets-clipboard 203 (when (and selection-sets-clipboard
203 (or (not secondary-p) 204 (or (not secondary-p)
204 (eq secondary-p 'PRIMARY) 205 (eq secondary-p 'PRIMARY)
205 (eq secondary-p 'CLIPBOARD))) 206 (eq secondary-p 'CLIPBOARD)))
206 (disown-selection-internal 'CLIPBOARD))) 207 (disown-selection-internal 'CLIPBOARD)))
207 208
208 ;; from x-init.el
209 ;; selections and active regions 209 ;; selections and active regions
210 210
211 ;; If and only if zmacs-regions is true: 211 ;; If and only if zmacs-regions is true:
212 212
213 ;; When a mark is pushed and the region goes into the "active" state, we 213 ;; When a mark is pushed and the region goes into the "active" state, we
218 ;; Note that it is possible for the region to be in the "active" state 218 ;; Note that it is possible for the region to be in the "active" state
219 ;; and not be hilighted, if it is in the active state and then some other 219 ;; and not be hilighted, if it is in the active state and then some other
220 ;; application asserts the selection. This is probably not a big deal. 220 ;; application asserts the selection. This is probably not a big deal.
221 221
222 (defun activate-region-as-selection () 222 (defun activate-region-as-selection ()
223 (if (marker-buffer (mark-marker t)) 223 (cond (mouse-track-rectangle-p (mouse-track-activate-rectangular-selection))
224 (own-selection (cons (point-marker t) (mark-marker t))))) 224 ((marker-buffer (mark-marker t))
225 225 (own-selection (cons (point-marker t) (mark-marker t))))))
226 ; moved from x-select.el 226
227 (defvar primary-selection-extent nil 227 (defvar primary-selection-extent nil
228 "The extent of the primary selection; don't use this.") 228 "The extent of the primary selection; don't use this.")
229 229
230 (defvar secondary-selection-extent nil 230 (defvar secondary-selection-extent nil
231 "The extent of the secondary selection; don't use this.") 231 "The extent of the secondary selection; don't use this.")
292 (setq previous-extent (list previous-extent)) 292 (setq previous-extent (list previous-extent))
293 (default-mouse-track-next-move-rect start end previous-extent) 293 (default-mouse-track-next-move-rect start end previous-extent)
294 )) 294 ))
295 previous-extent)))) 295 previous-extent))))
296 296
297 ;; moved from x-select.el
298 (defun valid-simple-selection-p (data) 297 (defun valid-simple-selection-p (data)
299 "An obsolete function that tests whether something was a valid simple 298 "An obsolete function that tests whether something was a valid simple
300 selection using the old XEmacs selection support. You shouldn't use this 299 selection using the old XEmacs selection support. You shouldn't use this
301 any more, because just about anything could be a valid selection now." 300 any more, because just about anything could be a valid selection now."
302 (or (stringp data) 301 (or (stringp data)