web developer & system programmer

coder . cl

ramblings and thoughts on programming...


why I still use emacs?

published: 10-07-2012 / updated: 10-07-2012
posted in: development, emacs, programming, tips
by Daniel Molina Wegener

There are many Integrated Development Environments to work with, but still I am using Emacs as my main editor, some times as IDE due to its wide variety on working modes, like Emacs Code Browser and CEDET, where both are making Emacs my main C and C++ editor due to its flexibility and extensibility. Also, I am a Lisp programmer, so I usually code some small extensions to make easier my work, like directory specific hooks to ensure that the indentation style is strictly related to the project that I am working. Emacs is an editor that can work as IDE, also provides extensibility through its embedded Emacs Lisp interpreter, allowing very nice modes and extensions to be programmed in a well known functional language.

On Emacs almost all events have a hook, where each hook is an event handler. For example to change the indentation style for each C and C++ project that I have I use ecb-after-directory-change-hook, where the event handler has an assigned function symbol to be called by the hook handler every time that the event is triggered, and this case the event is triggered on each directory change on the source tree navigator — called Speedbar — with two arguments, where the first one is the old directory and the second one is the new directory. So, KNF style based projects and Python Style based projects are respecting its indentation thanks to this hook. Thanks to this kind of features I have all my C and C++ projects with its own include paths, styles, and its own search tools, like CScope and Global. And those really large projects are quickly indexed with the proper tools. I really cannot imagine Eclipse with CDT indexing the Linux Kernel or indexing the FreeBSD Kernel, and I cannot imagine Code Blocks indexing both projects.

Emacs with FCM Project

Emacs with FCM Project

I have tried using Eclipse and similar ones with C and C++ projects, with Haskell, Python, and various other languages — currently I am working only with C, C++, Haskell, Lisp, Python and Java — and every IDE that I have tried is not working well as Emacs does. Also they are not easily extensible, they require to build its own extension projects and similar stuff. Too much work to add a small feature like directory hooks and others like completion hooks as semantic-idle-completions-mode-hook helps me on filtering symbols.

They compare Emacs with operating systems, because there are many modes, including audio playing modes — to listen mp3 and similar audio files — and seems to be true. I usually have my Emacs session open with my task list on org-mode and some other nifty modes that are making my work even better than using integrated desktops. The problem with Emacs is the learning curve, because it is very slow if you do not know anything about the Lisp programming language, but learning Lisp is not so hard as you think.


2 comments to “why I still use emacs?”

  1. Any plans for uploading your .emacs/ to github?

  2. Yes, I will probably upload a modified version due to my private data, but good enough to be shared (I will remove some hooks too), but it will stable enough to be used.

post a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>