Archive for the 'emacs' Category

Frank C. Weiler asks me about emacs color


On 2007-04-29 Frank C. Weiler asks the following (on my about me page as it happens):

Dear DRJ11, I have been trying too long to locate where in the Emacs distribution a particular colour scheme is defined for a particular distribution that I have grown to like (Mandrake 10). I now run Fedora 6, but their solour scheme is black and white, and trheir window scheme sucks. I program in Fortran (all varieties), C, awk, and others, and like the fact that reserved words, constructs, etc, all appear in color, on a standard medium green background (soothing to the eyes) and a tan-yellow type set. Anyway, you seem to have found out all about Emacs colour, so can you point me in the correct direction? In really want to extract this colour scheme from this old version and tuck it away for all future invocations that I use.

Well, I don’t actually know much about emacs, and less about color. Did you read the bit in Stupid colour, stupid slime, stupid emacs where I say that I only use emacs for programming in elisp, info-mode, and inferior-lisp mode? I don’t use it for editing files (I do that in vi). Also, syntax highlighting generally annoys me so I usually switch it off.

So I’m not sure you’ve come to the right person.

Having said all that though, you might find the “frame parameters” node of the emacs info manual useful (C-h i d m emacs <RET> g frame parameters <RET> at least on my emacs 21.2.1 distribution that came with my MacBook).

And it seems to matter a lot whether you run emacs in tty-mode (inside a Terminal window, like I do), or as an X application (which is probably much more common these days).

Good luck.

Stupid colour, stupid slime, stupid emacs


Why is it so many things try and customise the colour of something and so many things get it wrong?

I’d heard lots of good things about slime. I’m learning Common Lisp, so I decided to try it out. The first thing I notice is how much junk this adds to my .emacs. My emacs startup time goes from about 500ms to about 1500ms (oh okay, I actually went and measured it; it turns out that emacs has a command line option specifically for timing how long it takes to startup (well, is there any other use for emacs --kill ?). Anyway, old version: 29 ms, new version: 246 ms. To my surprise vi (vim really) is slower at 46 ms. The mighty ed scores 11 ms).

Oh well, I only use emacs for 3 things anyway: reading the info documentation for stupid GNU tools that think that I shouldn’t be using man to read my documentation; testing and debugging what little emacs lisp I write; inferior-lisp-mode. Anyway, the next thing I notice is that my prompt is cyan. This colour just happens to clash horribly with the colour of the Terminal window in which I am running emacs (which is #E78C3F). THIS HAS TO STOP. Coloured slime. Great. Should slime start with colour enabled? No. Should slime provide the ability to decorate its UI in colour? Of course. There’s no way that any particular default colour scheme provided by slime will match an arbitrary colour scheme chosen by me, so that’s why it shouldn’t use colour by default.

I think I have some sort of default colour scheme curse. All you hackers out there writing colour schemes must use ultra-black or something; I generally run my Terminal windows with a light background and black ink, and I often fall foul of default colour schemes for stupid programs that stupidly use colour by default. All you people creating ad-hoc colour schemes for your crappy little tools (slime, emacs, vi, ls) stop it. Make sure the default is to not change any colours.

So I spend another half-hour trying to find and change the relevant parts of customize-group slime (naturally this involves finding a bug in this interface which makes it impossible for me to save any changes the first time). Part of the customize-group interface are almost unbearably unreadable because of the choice of colour. Great, now my .emacs has grown from 2 lines to 17. It’s the start of a slippery slope.

Would you like to see how bad info-mode looks? Okay, here it is: Emacs screenshot with nasty clashing colours

I knew I was right to fall in love with FreeBSD when I saw Linux embrace colour ls.