When something in MacOS-land copies something to the pasteboard, X11.app automatically copies that to the X11-land "clipboard" selection, which is good. But when something in X11-land copies something to the X11 clipboard selection, it is not automatically copied to the OSX pasteboard, and that's lame.
When running XEmacs under X11 (local or remote) I find that
- (setq interprogram-cut-function 'own-clipboard
interprogram-paste-function 'get-clipboard-foreign)
I really wish there was some way to make drag-and-drop of selected text work with XEmacs, though. But that doesn't even work in Linux.
Update: No, scratch that, using interprogram-paste-function is useless. It seems that sometimes copying things in OSX programs updates the X11 clipboard, but not always. I can't figure out when it does and when it doesn't.
Update 2: Incidentally, it is not lost on me that the most frustrating parts of my Mac experience involve X11, which I'm only using at because I just can't put down the Emacs crack-pipe, despite it being the source of much suffering.
Update 3: My current guess as to what is going on is that, every time focus moves from an OSX program to an X11 program, the X11 clipboard is overwritten with the OSX pasteboard (regardless of which is newer). Conversely, when focus moves from an X11 program to an OSX program, nothing is changed at all.
Update 4: Why I don't use Carbon Xemacs: select the following u-umlaut character in Safari -- ü -- copy it; then paste it into Carbon Xemacs and watch it crash. (Oddly, it does not crash if you copy it from Firefox instead of Safari!)
Update 5: Andrew sent me a patch that fixes the Carbon XEmacs crash, yay! I assume it'll be on his site soon.
This isn't exactly answering your original question, but since your reason for caring about this is probably mostly driven by XEmacs...
I was driven nuts by this exact same problem.
Then I built a copy of Carbon XEmacs, it works great, and now I don't care about X11's clipboard anymore. It turns out that there's nothing I need X11 for now that I use in a clipboard-relevant way.
Drag-and-drop isn't there, but at least XEmacs has its kill-and-yank unified with the OSX clipboard.
I used Carbon XEmacs for a while, but it crashes all the fucking time. Ironically, about one third of the time that I try to paste anything into it.
I've used it since 10.3, and a recent download on a clean 10.4 install has been crash free. Usually, crashiness has been me doing random alt-tabs while using scroll bars causing events to get posted wrongly.
I don't even have X11 on my Mac now. Probably the first time in 20 years I've not had a machine that could run an X server...
The version I have is a self-compiled 21.5.20 on 10.4, which is, I think, still the latest version.
I have a bunch of remote machines I have to admin, so I don't think that totally giving up on remote X11 xemacsen is in my future.
Hm, no VPN?
I've been VPN-ed in to $client today, mounted some shares, edited locally, wrote back.
Much as I love lumpy X over the internet, I'd rather have a snappy local editor and a slow load/save of files.
I have never used VPN. I know almost nothing about it, but it frightens me.
Also, none of my servers run NFS and never will as long as I'm still breathing.
Do have a look at openvpn. It's low tech, can be tunneled over ssh. Or is uses the SSL protocols in a good way. IPSec is scary, bad and wrong IMHO.
Who uses NFS these days anyway[0]? Samba all the way. At least for simple stuff like this.
[0] Yeah, yeah.
Doesn't "Samba" mean "NFS levels of reliability, plus Microsoft levels of security"?
For stuff like having a Mac pick files up off a linux server for editing purposes it's plenty reliable.
As for security - we're VPN-ed in to $client's LAN. It's a reasonably trusted environment, surely?
See update -- copy "ü" in Safari and paste in Carbon Xemacs to crash it.
Nope, yanked into Carbon emacs perfectly for me.
Maybe I'm running some Eurotrash locale that expects it?
BTW I'm running:
GNU Emacs 22.0.50.1 (powerpc-apple-darwin8.1.0) of 2005-06-07 on iBookG4.local
And meta-W then apple-V just worked to paste that string the other way.
Hello, "Carbon Emacs" != "Carbon XEmacs".
Now we're splitting hairs. Obviously this matters to you, but to me Emacs is Emacs, X or otherwise. I switch freely between the two. One works for me and doesn't crash. Sorry it doesn't work for you.
Perhaps you are unfamiliar with my resume, but yes, RMSmacs is firmly in the "unacceptable" column.
Not that part particularly, but now you mention it, I guess it would be a problem :-) Back to bashing on Carbon XEmacs and trying to fix the crashiness then!
Not wanting to be churlish, but I just went to try to install it just to see for myself and it's still pretty much build-it-yourself? Andrew's probably done a great job on it, but making a binary package would help getting it out there more with People Like Me.
Yes, it's compile-yourself, and yes, I agree that's craziness.
Well, I'm not whingeing. The supply of tuits is finite. It's on the do-list for when I have some.
I guess you don't know much about the history behind the emacs / Xemacs split.
...OK, I do now. Thanks. 1996 was a good year otherwise.
There's pbcopy, which takes the standard input and places it in the pasteboard. pbpaste does the opposite.
I don't know of a way to force quartz-wm to sync the pasteboard to the clipboard (but hope there is one.)
Yes, I know about those. In what way is that even remotely an answer to the question I asked?
shell-command that in interprogram-cut-function? (It's a bit rube-ish, but should work.)
Yes, I am fully capable of writing a program that does this. Please note that I asked "is there a program that", not "how would I go about writing."
awful bitchy today eh?
lemme answer your question- "no".
awful bitchy today eh?
You must be new here.
JWZ: perhaps you need a bit of boilerplate every time you ask the Lazyweb a question that says "If you don't know the exact answer to the exact question I asked, kindly fuck right off". You usually end up adding it after the fact anyway.
I suspect that boilerplate would be about as effective as push/pull signs on doors.
The closest I've ever been able to get to integrating the two clipboards is is by using autocutsel. I know there are people out there claiming that you don't need it anymore but they appear to be lying.
Oh, and the patch in my patch directory tells me that autocutsel.c:506 should read setpgrp(0,0); rather than setpgrp();
Before I switched to a Carbon Emacs, I also used autocutsel.
My notes say this: If you are having difficulty using copy and paste between X11 X?Emacs you can use autocutsel to keep the different X11 selection buffers in sync. Just use the emacs C-y and M-w to paste and copy from the Mac copy buffer.
autocutsel can be installed via fink or http://www.lepton.fr/tools/autocutsel/
You can set the selection-sets-clipboard XEmacs variable if you're still having problems. (setq selection-sets-clipboard t)
The documentation for autocutsel says that it synchronizes the X11 clipboard with the X11 cut buffer. I don't use anything that uses cut buffers. I want to synch the X11 clipboard with the OSX pasteboard. (The reverse of that already happens.)
Yeah, I know. I suspect that quartz-wm sucks and picks up the cut buffer with the pasteboard rather than syncing the clipboard like it should. So, using autocutsel to sync the clipboard and the cut buffer ends up also syncing the pasteboard.
All autocutsel seems to do is periodically overwrite the X clipboard with the contents of the OSX pasteboard. It never goes the other way, so running it has the side effect that anything copied in an X11 program just tends to vanish in favor of whatever the previous thing copied by an OSX program was. That's pretty much worse than useless...
I'm unclear on the terminology here, but the Quartz WM seems to automatically synchronize CLIPBOARD to the Mac OS pasteboard, but it only puts PRIMARY to the pasteboard when one hits Command-C.
I got around this by hacking up X11.app to copy PRIMARY to CLIPBOARD whenever they were different. (quartzwm is closed-source for some unknown reason.) Also, I inserted code to swap Command and Option before the key event was passed to the MacOS menus so that I could use Command for Meta without causing random services to fire on some emacs chords.
This solution pretty much sucks. Sorry.
I use XDarwin rather than X11.app, but the clipboards automatically synch for me. (This might've been one of the reasons why I stuck with XDarwin, which I had been using since 10.1, when X11.app came out.)
Why don't you just run the OS X native version of XEmacs? That should avoid the entire problem of two different "clipboards".
Because it crashes all the fucking time, usually when I'm trying to paste something into it.
Ok, that sucks. I would recommend using the native version of GNU Emacs, since it's been rock solid for me, but I guess that wouldn't go over well considering.
uh... in 10.3 land, the X11 has a Copy which is cmd - C that seems to work.
and i realize thats not how X does it. but it does seem to work.
WOW, NO SHIT?
And the great thing about that "solution" is that you have your choice of either having a meta key or a cut-and-paste shortcut! Not both! Who would ever want to use the inferior meta key as a (yuck) meta key, once they'd seen the glory of Apple's perfect keyboard shortcuts?
This has been pissing me off for quite a number of months now, and the answer to the problem is inevitably "suck it up, you can't have your cake and eat it, you know." Which has the astounding effect of making the MacOS cut-and-paste even more broken from the point of view of Me, The Guy Actually Trying To Use The Box, than X11's is normally by itself.
MacOS X has so much hate.
Why not just use an xmodmap file to remap, oh, say, the key right next door to the command key as your meta key?
Possibly because he has a TiBook like me, where the option key is the size of a flea and just about as durable.
After both of mine broke (which took about three to four months each) I implemented the evil X11 source hack described above and have been happy since.
I have "enable keyboard shortcuts" un-checked in the X11 preferences, meaning OSX mostly doesn't interfere with XEmacs. But, that's why I want X11 to treat the X11 clipboard and the OSX pasteboard as one and the same thing: so that there (appears to be) only one paste command, not two.
Sorry for being completely off topic, but you were wondering about anti-aliasing on OS X making coloured text look bolded... I only just noticed when looking at your site, but it looks like 10.4.2 has substantially changed the way text is rendered... this blog looks boo-tiful now :).
Are you using Apple's 'quartz-wm' or another WM? If you are using another WM, there There is some coverage of how to enable selection proxying:
http://developer.apple.com/qa/qa2001/qa1232.html
If you are using quartz-wm, then I'm not sure why it's not always working (I don't use X11 enough)... I know you hate speculation, but I wonder if the reason why it sometimes works for you has to do with the API used to develop the OSX app (Carbon vs. Cocoa)... Nothing about this is mentioned in the above FAQ.
I'm using the default setup.
recompile greasemonkey.
too much work. Who needs umlauts?
Do you, for one, uh... welcome...
Ah, fuck it.
http://business2.blogs.com/business2blog/2005/07/camel_robojocke.html
I use it all day every day, I've never pasted anything but text in; on the other hand, I paste text in a lot, because I cut it out of the browser and cut/paste through Emacs to lose the stupid formatting before I paste it into mail or chat.
See update -- copy "ü" in Safari and paste in Carbon Xemacs to crash it.
I just did, it worked fine. Oh, hold on, this is Emacs not XEmacs; can't imagine why that would be a problem for you :)
To be precise, the one they talk about here: http://www.mindlube.com/products/emacs/