Hacker News new | ask | show | jobs
by snorkel 5892 days ago
It's a fair question. Emacs is one of few editors left that makes it possible to work on multiple files at once without taking your hands off the keyboard. No fumbling with the mouse. Watch someone who has mastered Emacs edit some code and you'll understand its appeal.
4 comments

Going a little further, Emacs is itself (at least a lot of it, including js-mode, for instance) written in Emacs Lisp. This makes most of it modifiable by its user. It's not impossibly hard either - I have made a minor mode for Pyccuracy tests in a couple hours. Learned some in the process.

Even the "configuration files" are, really, Lisp code, not bags of values and options.

Just to add to the language-configuration thing on the vim side...

Vim configuration is also not a bag of options and values; by default, it uses vimscript. vimscript is an interesting language (supports a form of OOP) but only really usable in the vim world, so it is up to you if you want to learn it to do things besides assign values to options.

Alternatively, vim allows you to do editor customization in perl, and while I have found very little documentation for it, it also supports mzscheme.

How does this kind of thing help anyone? Why is Notepad just not good enough? You can add entire text-manipulation features to your editor, including Intellisense to your specifications, tools for refactoring, integration with other tools outside the editor, and so forth.

Both editors have large communities and have few real competitors for fast and powerful text editing (I hear TextMate comes close).

I just checked the breakdown with sloccount.

C: 20% ELisp: 78%

The parts that are written in C are mainly the lisp interpreter itself, and some windowing stuff. Unless you are doing something really strange you never need to dive into the C internals.
What's the last 2%?
"magic"... ;-)
I'm too tired to think of just the right witty comment, but no one ever truly masters emacs; there's simply too much to learn. Which is what makes it so fun - it's a continuous learning process, where there's always something new and cool to be dug up.
Hmm, I'm still not quite sure I 'get it.' For instance, your comment, 'no fumbling with the mouse' confuses me. I've always viewed the mouse as something that saves time, a shortcut to where you want to go or what you want to do. Especially on a Mac with non-maximized windows and Exposé mapped to a mouse button, I've never felt like I was 'fumbling.' I guess I'll ask an Emacs user to demonstrate next time I meet one.
Exposé breaks down when you have a hundred buffers open, though. iswitchb cuts through that like a bullet through butter.

The mouse is better for some things (especially relative/spatial stuff), and the keyboard for others, but interfaces that make you switch back and forth are clearly problematic. Rather than popping up dialog boxes and alerts, Emacs displays results (such as compiler output) in another buffer. If it needs immediate input, it uses the minibuffer, a one-line buffer at the bottom of the screen.

In either case, its full text-editing functionality is available. You can run a directory browser/editor, a web browser, shell, interpreter, e-mail client, irc client, etc., and it's just another text window.

FWIW, Marco Baringer's SLIME screencast ( http://common-lisp.net/project/movies/movies/slime.mov ) is a pretty good example of proficient Emacs usage. That convinced me to try Emacs after using vi for several years.

Ok after watching that link and reading these comments i'm starting to understand a little. I installed Aquamacs (other emacs clients were too ugly IMO). I can see that emacs perhaps had a lot of features Visual Studio had BEFORE vs, and that it's a stable, multi-platform, multi-language environment. I can see also that some of the text editing/formatting functions would probably work better than what I currently use Excel for. I can see the attraction of an uncluttered dashboard/interface too. And extensibility. But as a beginner I can't yet relate to this 'context-switching' problem and the appeal of running all sorts of applications inside a text editor.
No problem. I'm not trying to convince you one way or the other (heck, I use vi too), but I figured a video might help.

Also, for you or anyone else reading this thread, http://emacswiki.org/ is the place to go for info.

Thanks for the slime.mov link, I learned a couple of nice things about Emacs UI from that.
There are operations where the mouse is more efficient than the keyboard and vice versa. Anyone who says otherwise is selling something.

That said, I often trade the time + context switch of moving to the mouse for a slightly less-efficient keyboard command. Overall it's probably a toss-up, I just like to stay near the home row.

My friend at work uses the mouse a lot and he's very good at using it to edit text.

Agreed. IDE with extensive keyboard shortcuts + using the mouse occasionally for the odd-length text jump/highlight VS emacs baroque command structure is probably about the same for those who have mastered each. Years of surfing the web have most people very adept and quick with a mouse.
Huh? I can edit multiple files in Windows Notepad by pressing Alt+Tab. There are some nice features in Emacs but any editor allows working on multiple files without a mouse.
That is technically true, but no one would actually be productive in that environment. Switching to the file you want is an O(n) operation with that workflow. That would drive anyone insane. In proper editors you can switch to the file you want by hitting a command and then typing a few chars of the file you want, then return.
Nonsense. I've done it both ways, and doing it the way you describe is actually slower.
It's slower for small N. That's why emacs has Tabbar mode, which I have bound to \C-Tab.

http://www.emacswiki.org/emacs/TabBarMode

Tabbar works great for switching between the 3 haskell files I have open (note: tabbar only switches between files of the same type).

Regular buffer switching (or even better, anything mode http://www.emacswiki.org/emacs/Anything) works great for switching between the roughly 200 java files I have open right now.

You can bring up Emacs' buffer list sorted with the most recently used at the top (bs-show). This is equivalent to alt-tab in the worst case. Because I can search this list (it's a standard Emacs buffer), I can get to anywhere in the end or middle far faster. You cannot see filenames in alt-tab until you select the icon.

Further, Emacs standard switch-to-buffer command selects the last visited file by default so you can flip between files with C-x b RET. Slightly longer than alt-tab, but not much once it becomes muscle memory.

Perhaps that says more about the person than the method.