Wednesday, April 23, 2003

Please, someone, cure me of my XEmacs addiction. And, no, Emacs is not a valid substitute. Neither is vi/vim/elvis/....

XEmacs is rather quirky, takes forever to start, and a huge memory pig. It doesn't work right when writing international documents. Depending on the system I'm on, it leaves pixel dust in random places.

But I can't break my addicition to font-lock-mode and indent-region. Other editors have font-lock equivalents (where it highlights various elements of my code in different colors). But I have yet to find a halfway decent substitute for indent-region.

Other editors have autoindent, where it inserts spaces at the beginning of a new line as you type. But that's a far cry from XE's indent-region, which analyzes the structure of my code (mostly looking for braces, but also has some intelligence as to some of the quirks of C/C++). If I tell it to do an indent-region on my code and it doesn't look right, 99.9% of the time it's due to a "fence mismatch" (e.g., too many '(' or ')', or trying to close '(' with ']', etc.). Compilers are horrible at picking out those kinds of errors and usually spew error messages to infinity and beyond. XEmacs is quite a time saver here.

I've tried to switch. gedit, kate, eclipse... even got an eval of SlickEdit. But like a crack addict, I keep coming back for my next XEmacs hit.

And, yes, I've even learned emacs lisp and have written extensions to make it behave as I like. For example, this causes F6 to insert the usual legal boilerplate that goes at the top of every file:

(defun insert-c-boilerplate ()
(interactive)
(let ( (filename (buffer-file-name)) )
(insert (concat
"/** @file " (if filename (car (last (split-string filename "/"))) "") "\n"
" * @brief \n"
" */\n"
"\n"
"// Copyright (c) 2003 Neolinear, Inc. All rights reserved.\n"
"// $Id$\n"))))

(global-set-key 'f6 'insert-c-boilerplate)


Sickening, no? And yet I understand it. There truly is no hope...

No comments: