Skip to main content
XEmacs - Still resisting the dark side

The other day, I had been contemplating changing to a fancier text editor.

Though I do little programming now, I still find a need for a programmer's editor as I will be frequently writing simple scripts or processing csv files created by Microsoft Excel or log files.

The other editor that I am familiar with is JEdit, which I had used for a brief period and have even contributed a macro. It had a good GUI, syntax highlighting for numerous programming languages and scripts, searching capability, plugin support, extensibility and so on. But, the one point it faltered was on the memory usage side. Just opening the editor took away a good 40MB of my scarce RAM. I guess it needed the memory to display those fancy icons and GUI controls.

XEmacs in comparison, ends up using less than 10MB and is way faster too.

Some indispensable commands

Over the course of time, I have started relying on a few commands, so useful that I use them almost daily. Your editor may have similar capabilities or you can hack them up on your own.

Smart Macros

XEmacs supports recording temporary macros. One technique that I use is, if I need to process a line, I record the activity. But in addition, I also record the key strokes that I use to get to the next line. This allows me to run the macro multiple times without manually placing the cursor on the next line.

The commands that I use for recording macros in XEmacs are start-kbd-macro and end-kbd-macro.

This technique in conjunction with XEmacs to add an universal-argument (repeat count) allows me to process text files in a jiffy.

Regular Expressions

Regular expressions are the most useful feature used to search and replace text. Two features that I use most are keep-lines and flush-lines. Both take a regular expression and keeps or filters out matching lines in the buffer or a selected region. This is particularly useful when you are processing CSV files or logs to quickly glean out useful text and remove the unwanted.

Most of the editors that sport good UIs may support some of the capability, but loose out on one of the most needed capability: The ability to quickly start and use less RAM. And that's why I still stick with (X)Emacs.

Comments

Popular posts from this blog

Inside a Text Editor Ever since my college days, after dabbling with vi and a few other editors, I always had an yearning to create my own. Now, I am still stuck with XEmacs and jEdit and had a chance to compile / study the sources and documentation of EMACS and a free editor component called Scintilla. Until now, I was under the the belief that text editors used a doubly linked list to represent the text in memory. The advantages of this approach being insertions and deletions are much more easier which is just a matter of just un-linking a node off the list. But the shortcomming is that they tend to fragment memory with each node or line take a bit of memory. The other alternative approach is to have a dynamic array which is a contiguous space of memory and can sometimes be directly written off to a file. The disadvantages are that insertion and deletion are costly and you need to reallocate quite frequently. While goint throug the source and documentation of text editors, I chanced ...
The time machine Managed to get a copy of the King Solomon's Mines by Henry Rider Haggard. The book was originally published at 1855, more than 150 years since I am reading it. I'm sure that it would transport me back in time revealing how people lived and the problems that they faced. Of course, you can get the text in an electronic form from the Project Gutenberg for free, but I prefer the traditional form of reading where you can 'shutdown' any time and 'restore' in a jiffy. The other book that I have in reserve is The Journey to the Center of the Earth by Jules Verne (1864). There are so many classics that you can get access to for free if you do not mind staring at your display or PDA. But don't miss them out.
Battle of Wesnoth Been on the lookout for a free turn based strategy game and chanced upon the Battle of Wesnoth . Despite it being an open source game (meaning, you get the source), it was incredibly polished akin to any of the other turn based strategy game (Alpha Centauri), be it the background score or the graphics or the tutorials. The game itself is set in a period similar to the D&D or nethack era. For the film buffs, if you have read or seen the Lord of the Rings, you would probably be able to relate to the clans that populate the game world. The game play, as with any turn based strategy game requires background information on each of the units that you own, their strengths and weaknesses and a lot of planning (a kin to chess, but with a lot more parameters) where factors like day - night cycles are taken into account (e.g, humans fight well during the day, but the orcs are better during the night). It is encouraged to keep your older units as they gain experience and beco...