Archive for the 'Incidentally' Category

emacs & slime for people like me

Peter Christensen has published his "Ultimate n00b SLIME/Emacs cheat sheet" as a Work In Progress. It’s a very handy quick reference.

NSLog an NSString

NSLog(@"hello, %@", @"world");

mercurial error ‘ValueError: unknown locale: UTF-8′ on MacOS 10.5

Having installed mercurial via macports, any hg command fails with:

   <nasty Traceback snipped>
   ValueError: unknown locale: UTF-8

This is mercurial 0.9.5 and Python 2.5.1, but its seem that its caused by Leopard’s Term.app not setting the local encoding correctly. To resolve this, add the following to .profile:

   export LC_ALL=en_US.UTF-8
   export LANG=en_US.UTF-8

as noted in the mercurial mailing list.

installing SVK via macports

When installing SVK (2.0.2) via MacPorts (port install svk) make sure that CPAN is installed and has been configured, otherwise the SVK install will go into an infinite loop wating for user input.

This is evident with a port install -v svk. Without the -v it will simply appear to hang at the Configuring svk step); see also MacPorts bug #12050. The problem is that because CPAN has not yet been configured, it is prompting for the configuration that it needs in order to install SVK.

The first time cpan is run from the command line, it will prompt for configuration data; the process can be re-run using o conf init from within the cpan shell, and individual variables can be set with o conf <variable> <value>, e.g.:

   cpan> o conf wget /opt/local/bin/wget

to set, and to unset:

   cpan> o conf wget ""

syntax error before ‘AT_NAME’ token

I also ran into this rather less-than-obvious error message compiling Objective-C code on MacOS X 10.5:

   syntax error before ‘AT_NAME’ token

I eventually resolved it thanks to this blog entry. The compiler was moaning about a missing @end in a header file.