[comp.emacs] x-store-cut-buffer doesn't work?

cwilson@NISC.SRI.COM (Chan Wilson) (07/03/90)

Using emacs-18.55, with X-windows interface (xemacs) running under 
X11R4,  x-store-cut-buffer does not put the text into the cut buffer of 
X.  

Has anyone else run into this?  Does it have something to do with R4,
our X installation, or our emacs installation?  (ennie meenie minee moe...)

Thanks for any help...

--Chan

		 -- For the snark >was< a boojum, you see... --
     Chan Wilson 		SRI International, Network Information Center
 Inet:cwilson@nisc.sri.com   AOL:cwilson  GEnie:cwilson6   verbal:415/856-6612
     -- I ain't the prez of this company, don't take my word as gospel. --

carroll@m.cs.uiuc.edu (07/03/90)

You have to be careful. Under R4, most clients have moved to using selections
instead of cut buffers. My impression from fiddling with xterm's
(for instance) is that they will use the cut buffer only if there is no
selection available. If there is, they'll use that instead of the cut
buffer.

Alan M. Carroll                Barbara/Marilyn in '92 :
carroll@cs.uiuc.edu            + This time, why not choose the better halves?
Epoch Development Team         
CS Grad / U of Ill @ Urbana    ...{ucbvax,pur-ee,convex}!cs.uiuc.edu!carroll

beldar@Mips.COM (Gardner Cohen) (07/04/90)

carroll@m.cs.uiuc.edu writes:

   You have to be careful. Under R4, most clients have moved to using
   selections instead of cut buffers. My impression from fiddling with
   xterm's (for instance) is that they will use the cut buffer only if
   there is no selection available. If there is, they'll use that
   instead of the cut buffer.

I mailed this to the original poster, and will offer it here in case
anyone else has the same problem.

Add the following to your xresources:

! emacs only copies to cut buffer 0.  xterm by default 
! wants to paste from the PRIMARY selection 
XTerm*VT100.Translations: #override ~Meta <Btn2Up>:
insert-selection(CUT_BUFFER0)

... to make R3 or R4 xterm paste from the cut buffer.  I think R3
xterm always copies to both cut buffer 0 and the primary selection.  I
haven't used R4 enough to determine its behavior; check the man page
for related translations.

R2 xterm appears to dump core when confronted with this translation,
so I use .Xdefaults-hostname to set this on machines I know have r3 or
later.  Your environment may vary.

Alternatively, the r4 client xcutsel allows you to copy back and forth
between cut buffer 0 and the primary selection.

Hope this helps.
--
Gardner Cohen     beldar@mips.com   {ames,decwrl,...}!mips!beldar (408)
524-8267

cwilson@NISC.SRI.COM (Chan Wilson) (07/04/90)

Thanks to all who responded.  Turns out that emacs is putting the 
desired text into CUT_BUFFER0, whereas xterm, etc, usually take
stuff from the PRIMARY buffer.  

Two possible fixes:  

a) Keep an xcutsel around, which lets you transfer stuff betwixt 
   primary and copy buffer 0.

b) Add a line similar to the following to your .Xdefaults file:

XTerm*VT100.Translations: #override ~Shift <Btn2Up>: insert-selection(CUT_BUFFER0)

Thanks to Gardner Cohen <beldar@mips.com> and Steve Weinrich <weinrich@orchestra.ecn.purdue.edu> for their assistance!!

Hope this helps someone else out there...

--Chan

		 -- For the snark >was< a boojum, you see... --
     Chan Wilson 		SRI International, Network Information Center
 Inet:cwilson@nisc.sri.com   AOL:cwilson  GEnie:cwilson6   verbal:415/856-6612
 -- Oh, I'm a lumberjack and I'm okay, I sleep all night and I work all day... --