Re: using the x clipboard cut/paste functions from an xterm
Matt Price <[email protected]> Wed, 22 Sep 2004 22:30:50 -0400
| Newsgroups | gmane.emacs.xemacs.general |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Sep 22, 2004 at 05:43:28PM +0900, Stephen J. Turnbull wrote: > >>>>> "Matt" == Matt Price <[email protected]> writes: > > Matt> Again, I'm working from an xterm, not from a regular xemacs > Matt> window. > > Then you're out of luck: you need a connection to the X server under > program control. xterm has a connection, but isn't programmable in > this way and the xterm manpage doesn't mention the clipboard; xemacs > is Turing-complete, but has no X connection. You could open a frame > on the relevant X server from your xterm, or open a tty frame in the > xterm using gnuclient, then this should work: > I do use gnuclient in xterms, just with the -nw switch... is that what you mean? > (defun copy-to-clipboard (s e) > (interactive "r") > (own-selection (buffer-substring s e) 'CLIPBOARD)) > tried this -- it does copy the selection to the clipboard, but, oddly enough, it ends up way down the clipboard list -- instead of being the current clipboard ocntents, it ends up as the 5th in line or so. This is true whether I execute the command in a graphical frame or an xterm window using gnuclient. This is very different from the interaction of x and graphical Xemacs frames around yanking -- in a graphical frame, when I C-w a region, it gets put in the active clipboard -- that is, number 1. still, its a help. Unfortunately I don't read elisp well enough to really tell what's going on -- what does the (s e) mean, for instance? (start and end, maybe?) Any thoughts on how to make it behave exactly how I want -- and also on how to yank the current x-clipboard *into* a gnuclient session (run from an xterm)? thanks as alwyas, matt > ------------------------------------------- Matt Price [email protected] History Department, University of Toronto (416) 978-2094 -------------------------------------------- please don't use the following addresses: [email protected] [email protected]