The Pug Automatic

Fix Your Last Input plugin for Adium

Written April 20, 2007. Tagged OS X, Cocoa, Adium.

Programmers like to correct their own chat typos with faux Perl type regular expression substitutions, like

12:34 Me: Hello. I'm making a tpyo.
12:35 Me: s/tpyo/typo/

There is a very cool plug-in for the Colloquy IRC client, Fix Your Last Input (Regex), that causes input like the above to actually end up as

12:34 Me: Hello. I'm making a tpyo.
12:35 Me: (s/tpyo/typo/) correction: Hello. I'm making a typo.

I wanted a plugin like this for the Adium IM client as well, so I made one.

Download plugin: Fix Your Last Input (SVN source).

To install the plugin: download, unzip and drag it to the Adium icon in the Dock. You will be prompted to install it and asked to restart Adium.

Just send s/find/replace/flags to correct your previous message. The plugin uses Perl behind the scenes, so you should be able to do most anything Perl substitutions do.

I spent some time in encoding hell. After many efforts, the plugin doesn't mess up non-ASCII characters, but it doesn't recognize them in the find part. So s/ä/a/g won't transform "foobär", but s/o/ö/g will turn it into "fööbär". Patches to make it Unicode friendly all the way are welcome.

I'm not sure about the name – I'd say it fixes your last output – but I wanted it to match the name of the Colloquy plugin.