Andy Piper <andyp(a)parallax.co.uk> writes:
> This at least makes the mswindows menubar Cut, Copy and Paste do the
> right thing. Activation is not correct as yet since there are no C
> hooks for determining this.
This is very cool. I started writing something like this two months
ago, but I was in the dark with the MS Windows selection code, and it
was of little practical importance to me, so I left it unfinished.
Thank for writing it.
BTW, I think that this could be generalized a little better, if MS
Windows primitives provided a little more control over the clipboard.
`mswindows-set-clipboard' and `mswindows-get-clipboard' look
insufficient to me.
> +(defun delete-primary-selection ()
> + "Delete the selection without copying it to the Clipboard or the kill ring."
> + (interactive "*")
> + (case (device-type (selected-device))
> + (x (x-delete-primary-selection))
> + (otherwise nil)))
Is this correct? Why doesn't this do anything under Windows?
> +(defun selection-owner-p (&optional selection)
> + "Return t if current emacs process owns the given Selection.
> +The arg should be the name of the selection in question, typically one
> +of the symbols PRIMARY, SECONDARY, or CLIPBOARD. (For convenience,
> +the symbol nil is the same as PRIMARY, and t is the same as
> +SECONDARY.)"
> + (interactive)
> + (case (device-type (selected-device))
> + (x (x-selection-owner-p selection))
> + (mswindows t)
> + (otherwise nil)))
Is this correct, also? Under Windows, is XEmacs really always the
selection owner?
> +(defun selection-exists-p (&optional selection)
> + "Whether there is an owner for the given Selection.
> +The arg should be the name of the selection in question, typically one
> +of the symbols PRIMARY, SECONDARY, or CLIPBOARD. (For convenience,
> +the symbol nil is the same as PRIMARY, and t is the same as
> +SECONDARY."
> + (interactive)
> + (case (device-type (selected-device))
> + (x (x-selection-exists-p selection))
> + (mswindows t)
^^^^^^^^^^^^^
Hmm?
--
Hrvoje Niksic <hniksic(a)srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
Unspeakable horrors from outer space paralyze the living and
resurrect the dead!