Wednesday, August 20, 2008

Clipping My Emacs

Unlike René Seindal I haven't been using Emacs for 20 years.

More like 11 at most, and most of that time it's been NTEmacs, for Windows platforms.

That isn't enough time. I use Emacs daily. I know maybe at most one percent of what Emacs is capable of. Most of it is inscrutable. For me. There are those who can do wonders with it, but it's hard for me to even find the configuration options. Or if there are any for what I want to do.

I sort of feel I should be ashamed of this but probably not. I haven't learned Lisp and won't bother. And why would I anyway? Lisp? Arrr.

Without Lisp you can't learn all the internals and do intense scripting. Or even understand a lot of what people say.

The official Emacs manual leaves me dizzy. Sometimes I learn a thing or to, but only after I read a piece six or seven times, finally decide it just may be the thing I'm looking for, sort of, hopefully, and then spend half a day in trial an error mode trying to guess at how to implement whatever it is that the manual writers said.

Or what I think I thought they said.

Sometimes I'm lucky. Sometimes it works.

A while ago I bought a PC from ZaReason with Ubuntu installed. I switched it to Kubuntu and overwrote Windows XP on an older machine. On yet a third box I reinstalled Windows XP (after a disastrous "upgrade" to Service Pack 3) and am now dual booting that machine with Linux Mint, which is choice.


We all have at least one but.


One really annoying thing on Linux is that it takes an extra step to copy or cut text in Emacs and then paste it somewhere else. In Kubuntu I've been having to make a trip to Klipper, the clipboard tool. It's sort of a buffer where clipped items can be stored temporarily, or exchanged.

For some reason or other what I copy in Emacs is visible in Klipper, and I can put that text into Kubuntu's clipboard, but only after going to Klipper and selecting it there.

OK, so last night I decided to search for a fix and found one almost immediately. This is after about two months of messing around and forgetting to move things to the clipboard about 10 times a day. It's pretty easy, just type Ctrl-Alt v, then down arrow to the selection and hit enter. If that is easy.

No. It isn't. Not when I could type Ctrl-k in Emacs, followed by Ctrl-y for cut-and-yank (cut and restore) and have things in the system-wide clipboard under Windows.

So now I find that under Emacs version 22.1.1 there is a customization option under "Group Emacs | Group Editing | Group Killing | Option X Select Enable Clipboard". Now the only thing I can't understand is why I didn't look there before. So blindingly obvious. But then that's me. So oblivious, me.

Or is it Emacs? One of us is mucked up.

Anyhoo, now I have a clipboard that works in both directions. Formerly I could cut or copy anything and Emacs would receive it, but this now also works from Emacs to everything else. As it should. I think.

I'm not really sure, since I'm not smart enough to figure out any reason at all why every other application I've used under Linux directly accesses the clipboard and not Emacs.

Anyway I have what I like now. I am so relieved.



René Seindal: With GNU Emacs you can always learn.

Clipboard: Emacs Documentation, By Juergen Haas.

Quick tip for Linux users having trouble with Emacs (or XEmacs) copy/paste.


Post a Comment