Archive for Coding

Emacs or bust

Anyone who knows me knows I’m a big proponent of Vim. But recently I’ve been hearing a lot of stuff about Emacs and how 1337 it is. So I’ve decided to go all Emacs for a week.

That’s right. No Vim.

It’s tough, let me tell you. There are very few mnemonics, which I use constantly in vim. Sometimes sequences use Meta/Escape and sometimes they use Ctrl. I have found no explanation or clear deliniation between the two. M-d to delete from the cursor to the end of the current word. (‘de’ in Vim — ‘Delete’ to ‘End of word’.) C-k to delete from the cursor to the end of the current line. (‘d$’ in Vim — ‘Delete’ to ‘$’, the standard regular expression end-of-line character.) It’s like German genders all over again!

Vim is regular, orthogonal. Emacs seems to require a lot more rote memorization. :-(

And then there’s things like replacing strings, which is made into a multi-step process, complete with a menu if you tab complete at the wrong time.

Vim: :%s/wrod/word/gCR

Emacs: M-x replTabsTab CRwrodCRwordCR

Even then, Emacs will only replace from the current position to the end of the buffer. So it’s really more like Vim’s :,$s///g construct. You have to prepend M-< to the start of that so you can lose your place and get to the beginning of the buffer to do a truly global replace.

And WTF is up with the circular undo???

Anyway, I’ll soldier on. I’ve been doing this for a couple of days, so I have until Wednesday at 21:00. I’m trying not to put off my big editing projects; I’ll never learn it if I don’t USE it. But the lack of a (count)(action)(object) paradigm (or anything similar) is really messing with me. Assigning random keys to unrelated and needlessly specific actions doesn’t seem like the most sensible way to go about writing an editor.

I miss my text objects!

Comments (1)

Working on Ph Client

Ever since a few weeks ago when I got a “thank you but could you add this for me please?” e-mail from a professor at SDSU, I’ve been working on fixing up Ph Client for a new release. I’ve been working on a system by which users can add their own ph servers, which is sensible. Don’t know why I didn’t think of it before. It’s going to look very much like Fire’s Away Message manager, if you’re familiar with that. And not only because I have the code for that, either --- I really think it’s going to be the best way to go. I’ve been kicking it around, trying out different things for days, and this is what I’ve decided on.

Tonight I discovered that if you connected to some international servers, you’d get back accented characters. Characters which are clearly not in ASCII. So they were coming across as &Eacute; and ^ and the like. Non-optimal.

The solution? Interpret text in the value portion of the server’s query response as ISO Latin-1. Thanks to Latin-1 being a superset of ASCII, servers which respond in ASCII will still work.

Interestingly, since the RFC requires field names composed of [A-Za-z0-9_-], there’s no problems there. I found a French school in Quebec that was using elided names (Telephone) for the fields, and then including the full French name in the value (Téléphone). Kind of strange, but whatever floats your boat.

The more bugs I fix, the more I wonder how people can use the version I released two years ago. :-)

Update: It was brought to my attention that this wasn’t very clear. I’m not removing accented characters, I’m making them work. Thanks, Mr. Lorca.

Comments