Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!bcm!convex!texsun!newstop!exodus!netcord.Eng.Sun.COM!holtz From: holtz@netcord.Eng.Sun.COM (Brian Holtz) Newsgroups: comp.windows.open-look Subject: Re: A Unified Theory of Cut and Paste Message-ID: <10985@exodus.Eng.Sun.COM> Date: 3 Apr 91 21:00:23 GMT References: Sender: news@exodus.Eng.Sun.COM Distribution: comp Organization: Sun Microsystems, Mt. View, Ca. Lines: 34 In article dowding@ai.sri.com (John Dowding) writes: >I am using OpenWindows 2.0, and a variety of applications: cmdtools, >xterms, xmh, gnuemacs, calentool, plus many of the desk top tools that >come with Openwindows. Is there a simple way to be able to cut and >paste across all these different application types? If you put this in your .Xdefaults, then by pressing a button in xcutsel you can slam the CLIPBOARD into CUT_BUFFER0, or vice versa. This is as "simple" a way I can find to cut and paste across gnuemacs, Xaw-, and XView- based applications. ! Here's the deal. Emacs only uses CUT_BUFFER0, xterm uses PRIMARY by ! default, and OpenWindows uses CLIPBOARD. My solution is to have ! xterm cave in to the OpenWindows world by preferring CLIPBOARD ! whenever it is deciding what to insert, except I nod to Emacs by ! having middle click first try to insert not CLIPBOARD but ! CUT_BUFFER0. That way, Emacs-style pasting is always done with a ! middle click, and OpenWindows-style pasting is always done with the ! Paste button (L8). I convert between Emacs and OpenWindows by running ! xcutsel -selection CLIPBOARD. ! ! select-end(): order of arguments is insignificant ! insert-selection(): order of arguments is significant ! XTerm*VT100.Translations: #override \ Shift Select: select-cursor-start()\ select-cursor-end(CLIPBOARD, CUT_BUFFER0, PRIMARY)\n\ ~Ctrl ~Meta : insert-selection(CUT_BUFFER0, CLIPBOARD, PRIMARY)\n\ ~Ctrl ~Meta : select-end(CLIPBOARD, CUT_BUFFER0, PRIMARY)\n\ L8: insert-selection(CLIPBOARD, CUT_BUFFER0, PRIMARY)\n\ L6: start-extend() select-end(CLIPBOARD, CUT_BUFFER0, PRIMARY) -- Brian Holtz