53 comments

[ 2.2 ms ] story [ 122 ms ] thread
The Emacs book was written in 2004 and is about Emacs 21.3. Current Emacs is 23.3, with 24.0 in pre-test.

I know things are relatively stable in Emacs world, but a fair bit has changed just from 23.x to 24.0.

Do you have any suggestions for learning emacs? I know that that 23.3 manual is online, but I don't see anything for 24.0. Does it make sense to just use 23.3 and get used to that, then move to 24?
There's some HN discussion about the new release:

http://news.ycombinator.com/item?id=2059909 http://news.ycombinator.com/item?id=1181589

And another link I found helpful:

http://batsov.com/Emacs/2011/08/19/a-peek-at-emacs24.html

But yes, your plan is a good one. Start by running

  C-h t
to get the native tutorial, then ramp up from there. I'm afraid I don't know many good online tutorials as I work with Emacs power users, but Stack Overflow has always been quite helpful for learning Elisp.
I would suggest just getting emacs 24. If you are on OSX you can build the emacs head using homebrew. There's some cool stuff in 24 like the emacs package manager (package.el) etc.

Once you have emacs 24 ready to go, it's a good idea to take a look at the emacs starter kit: https://github.com/technomancy/emacs-starter-kit

There's also a pretty good peepcode screencast on emacs, its a bit old, but gives a good overview of a lot of the basics.

Once you feel like delving deeper, your best bet is to snoop around on emacswiki.org

Besides the inline manual that emacs has in itself. I recommend you to start using the Emacs Starter Kit [1].

Try to read the source and understand what it's doing. You will learn how to configure emacs, and the basics of elisp.

[1] https://github.com/technomancy/emacs-starter-kit

I would just get _some_ version of Emacs and spend an hour with it. The core set of commands is what you want to learn. You don't care about any of the eye candy they've added in the last 20 years. Seriously. Save the "superior LISP session auto yanking" nonsense until you're a power user.

Emacs (and most of the Emacs clones) come with a tutorial. It's pretty decent.

After a while you may find yourself feeling bad that you've not done any customization. "Argh," you say, "This is supposed to be a customizable editor. I should start customizing it so that I can realize the awesome power of this fully operational editor!" No worries. I'm guessing that most Emacs users really don't change much. For C hacking or writing I usually just tweak some settings, add a few macros and I'm good to go. Most of my customizations are turning /off/ things that other folks thought were good features. No names, now. :)

tl;dr; Don't worry about the new shiny. There's plenty to learn before you get there.

[emacs user since 1979]

Come on now, the builtin Emacs tutorial is atrocious. It tries to teach you the most basic stuff, like what the CTRL key looks like or how to hit arrow keys. Do you really think anyone who does not know the CTRL key would pick up Emacs?

Honestly, at least one of my attempts to get into Emacs died because of disgust of tutorial. It could teach the very same content without being that condescending and outdated. I loathe it.

Funny enough, the gnu.org guided tour through Emacs is really good! Just rewrite the tutorial in a slightly more modern style. I am sure this would increase Emacs adoption quite significantly.

Well that's interesting; I started using emacs around 1986 or so, and the first thing I did was go thru the tutorial; I don't remember it being overly basic at all.
Alright. It took me a few minutes to actually find a suitable version of Emacs for Windows. Then it took me another minute or so to find the English tutorial.

As I quickly scan through the tutorial:

The tutorial assumes I am using a terminal. To be fair, I might. However, it specifically assumes that I am using a terminal from the 1980s. However, I actually have working arrow keys, a mouse and an ALT key. Not META or EDIT. This is what PCs, Linuxes and Macs have converged on. ALT keys, arrow keys and mouses.

Quote: "there should be a tall rectangular area called a scroll bar on one side of the Emacs window...", "Try pressing the middle button at the top of the highlighted area within the scroll bar. This should scroll the text to a position determined by how high or low you click". And so on. First off, it is left mouse, not middle mouse. Then, some of the described behaviors are plain wrong on a modern Windows system (or Mac or Linux for the matter). But really, does Emacs have to explain what a scrollbar is? Honestly?

Then there is stuff like "when saving is finished...". Saving files does not take time any more. Especially not for novices, who are less likely to open several megs of log files.

Quote: "If you are using a graphical display that supports multiple applications in parallel...". What does Emacs think? That I am using Emacs on an iPhone, probably. It has been a really long time since I have seen a "graphical system" that did not support multiple applications in parallel.

Oh well. This should give you an idea. Apart from that the tutorial is not that bad. Just pretty boring. For what it's worth, I remember having quite a bit of fun doing the Vim tutorial, while the Emacs tutorial left me bored and confused. But maybe that has other reasons than the objective quality of the tutorials.

I learned a lot of things using apropos-command (after I got comfortable with basic editing.) When I found myself thinking "it would be cool if emacs did X", I just tried C-h a X Ret to see if there is a function for it. Emacs also tells you to which key sequence the function is bound (if any.)

Exploring Emacs that way is like browsing Wikipedia going from article from article: you don't follow a predetermined itinerary but end up learning a lot along the way.

Loads of cool new things, but not many changes in the areas that a introductory book would cover I think. Or am I wrong?
They've paid a lot of attention to defaults, pretty much for the exclusive benefit of newbies.
I learned emacs from the version of this book available in 1999. I don't think much of what I learned is hopelessly obsolete. Basics are basics.

I felt the book was a nice overview, both covering the basic terms and techniques and giving a tour of important features like dired and in-emacs shells. You'll want to augment by reading other online sources (there was no emacswiki in 1999, that I knew of) but the book is probably still worth the money. This is emacs. You'll appreciate having more than one tour guide, because the world is big and everyone knows one part better than others.

If it's any consolation, I found the Robbins vi book to be little better than adequate.
Emacs is a great platform. Its only weakness is as a text editor. :)
Let's also drag out "I know just enough vi to compile emacs" and "at least you can run vi inside of emacs."
Currently running Emacs with Vimpulse. Best of both worlds or crazy franken-editor? I've not decided yet :)
Although I use VIM pretty much exclusively and haven't really used EMACS in a while, I have been impressed with LaTeX mode in EMACS and wish that was the way things worked in VIM.

My guess is that you get some areas where it is a crazy franken-editor and some areas where it may actually be pretty cool.

I use evil-mode myself. And yes, it's definitely a crazy franken-editor, but I prefer it to dealing with vim's API. I wish that "." respected the previous visual mode, though. Makes indentation a pain.
Than contribute code! The moment there is a truly, truly, truly awesome vi mode for Emacs available, the editor-war is over for good.
>Emacs is a great platform. Its only weakness is as a text editor. :)

It has a text editor? I thought it was just a text adventure game!

Oh it is, my friend, it is!
I like O'Reilly as much as the next guy, but promoting this sale doesn't strike me as something that should make HN.
I don't interpret it primarily as promoting O'Reilly; I think the intention is to tip developers off to discounted, DRM-free educational resources.
+1 to that. I clicked through expecting an article and found an advert. Crass, crass, crass.
Sorry about that.

My intention was pointing out a promo for two DRM-free e-books (I own both) and the related Emacs vs. Vim vote.

I've just recently switched to using Emacs with Evil (A Vim mode for emacs). That's just simply awesome.
Emacs is powerful enough to emulate vi. Is the contrary true as well?
There is a lisp written in VimL[1], so it's theoretically possible. Practical, probably not. But possible. The long-running "emacs is a great OS without a text editor" jab is partly true; Emacs is best described as a Lisp environment that happens to be built around a text editor.

[1] http://www.vim.org/scripts/script.php?script_id=1986

Emacs isn't 100% Lisp, there's also C code at the lower levels.
I think that doing a usability study on both of them would reveal that the usability people would run shrieking from the building once the basics were explained to them. On one hand, you peck at the esc button like a hungry chicken to do anything useful, with the other, your hands play twister on the keyboard "pinky.... CTRL... thumb... ALT... index finger... S".

That said, I've never been even remotely tempted to move to anything besides Emacs, and at this point, it's ingrained in my fingers, so non-Emacs things really piss me off.

> so non-Emacs things really piss me off

I'm just glad that C-x doesn't quit most applications while I'm trying to save.

As someone who accidentally closed many, many firefox tabs by pressing C-w, especially when I am writing in a textbox which is even more annoying, I can't imagine the havoc it would wreak if C-x were to quit apps.

I know there are alternatives like It's All Text extension [1] which lets me hook emacs into Firefox, but it's not been updated for recent versions of Firefox.

[1] https://addons.mozilla.org/en-US/firefox/addon/its-all-text/

(I'm somewhat replying to the next message but HN didn't let me reply to it)

There's conkeror that use the same renderer engine of Firefox but with emacs mentality of keybindings and customisability.

Also, I've read that some people like to rebind their ctrl+W to something else so they don't have the habit to close their windows in other os/apps. IIRC, C-w is kill-region? Personally, as stated earlier, I use evil so I don't have that problem (I press d to delete the selected region).

That usability study has already been done in 1980s and published in CHI, the conclusion is that vi is a better text editor than emacs.
The philosophy is very different. Emacs is really a lisp repl with a good API to manage windows. So, in a way, it's not an editor. I mean, you can use it to check your e-mail, chat on IRC.. or basically anything that can be interacted through a window (I.e. mostly anything)

Also, mostly everything is a command in Emacs.. So, when you press "a" it basically translate to "call the function insert-character 'a'". So, in a way, Emacs keybinding are really just a little api over the real commands.

In vim, it's a totally different philosophy. Everything is based on making the editor as efficient as possible. Yes you can hack stuff and go on IRC with Vim but conceptually, it's not what it's been designed for and you'll likely hit lots of problems down the road and will have to use all kinds of hack.

So, is putting emacs in Vim possible? Vimscript, even thought being an abomination (my opinion), could implement elisp.. with all the necessary wrapper. So, maybe that'd be possible.. but rather useless.

Finally, my personal opinion.. with Vim, I really felt like "tweaking/hacking" it when I tried to customize it. For instance, I'd try lots of different mapping/paste things found on internet and hope it'd work. Sometime it'd fail for obscure reasons.. and you'd add another hack on top of the hack to fix it.

On the other hand, in Emacs, I feel like I'm really coding my editor as I want it. I'm not surprised by its behavior or its interface. I.e. You can bind an event to call a function when a buffer opens. If you know a little bit of lisp, you'll feel right at home. And if not, there's no better way to get started with that fabulous language.

I would contest the assertion that emacs is powerful enough to emulate vi. Every attempt I've seen so far has been a superficial effort that enables some keystrokes but doesn't really get at the heart of what makes vi(m) what it is. I was actually a full-time emacs user for several years. There was a lot I liked: lisp, programmability in general, readable-if-verbose-identifiers. But I went back to vim because it offered enough programmability (I had been using plain vi before!) to suit my needs, but it had the addictive center of the vi experience. That is:

* The action + (motion | text object) system. I haven't tried evil yet, but viper and vimpulse just don't seem to get this right. It's there but it's incomplete, which kinda kills it for an experienced user. More importantly, though, it's broken. Text objects aren't real, atomic elements at the deepest level -- they're simulated programmatically, which means the illusion breaks down if there are errors in the middle. It also means there are things which vi gets for free in all circumstances that the emulator has to laboriously simulate each time -- like atomic undo. Of course, you CAN do all the programming (hasn't happened yet) but all of that circumlocution has a cost, which is...

* Performance. I was shocked, when I tried out vimpulse on a relatively modern machine several months ago, 15 years after I last used emacs regularly, to find that emacs still feels like a movie with the framerate set too low. It's especially noticeable when, courtesy of viper and vimpulse, you can compare commands somewhat apples to apples. There's just this little delay. It might be milliseconds, but when it's something you're doing all day every day, that really starts to annoy.

So, no. I don't think emacs CAN emulate vi, if you actually consider what most vi users value in their editor. At best, it reaches the level of, say, eclipse emulating emacs movement keys. I would love an editor with vi speed and the movement model, but a sane programming environment. I'm still waiting.

(Sublime text 2 seems like it might be heading there, though for now its vi mode is not much better than vimpulse.)

Are you finding Evil to be an improvement over Vimpulse at the moment? I tried Evil and it seemed to do some weird things with the point...
Evil is the most recent 'vim-mode' for Emacs.. I'm sure there're still few bugs in it but as far as I can see, it's really good. The nice thing is how easy it is to configure/change the default behaviors and also how fast the mainteners/implementers answer your question.

Also, I think it's important to point out that these mode try to "integrate" as best as they can with Emacs. So, it's not Vim in Emacs, but more, Emacs with Vim' best features and keybinding. (Arguably the best feature of vim). For instance, evil for emacs is a little bit like clojure for Java. I.e. it's a totally different beast but doesn't force you to make dozen of wrappers.. you simply use both at the same time.

Please tell more. I tried Emacs with the Viper vi emulation but it was less than spectacular. Eg. text objects were missing.

I really really like Vi for doing text editing, but Vim's integrated tools are pretty crappy. The sorest point is definitely the lack of a decent debugger interface, but there are other tools I'd like to use too. Emacs is far superior when it comes to integrated tools.

So I'm looking for a good Vi mode for Emacs, or rather, any sort of language agnostic IDE that has a decent Vi-like text editor mode.

Evil is the most recent 'vim mode' for Emacs. I've had a couple of problems.. submitted an issue of github and it was resolved in hours (if not minutes). (For instance, :<number> was missing to go to a line.. fixed in minutes. I wanted jk to behave like <esc> in insert mode, I've been redirected to a post explaining how to do it, etc.)

The great thing about evil (and other vim-mode) is how it is easy to customize it as you wish. IMO, it's even easier to hack than with vimscript. For instance, I rarely use shift+j in normal mode and decided to use it to go go 4 lines down.. same for K and I want it to work in visual mode. Here's how I did it with evil:

  (define-key evil-normal-state-map "J" "jjjj")
  (define-key evil-normal-state-map "K" "kkkk")
  (define-key evil-visual-state-map "K" "kkkk")
  (define-key evil-visual-state-map "J" "jjjj")
  (define-key evil-normal-state-map "0" "^")

So basically, I find it pretty cool that I can customize how I want my vim-mode to behave. And obviously, from vim-mode I can call any normal elisp functions.

It's impossible to find an editor that'd fit exactly your need without you customize it because that's how we are.. everyone using Emacs or Vim use it because they want to have their own personal editor with their own function/binding.

However, Emacs with Evil was what I was seeking for a couple of years. I wish I could have made the switch sooner.

Hm, in vim one can do

  :map J jjjj
But I guess using existion elisp functions might be useful.
Well the thing is how easy it is to customize your evil keybindings. And, don't forget it's Lisp.. so it'd take a second to write a macro behaving like:

    (map J jjjj)
Another shop that forces me to login (thus create account) before I can review my shipment options. I had to spend my energy to look around a site to find, well.. nothing. So if you have a shop, please provide complete price before I have to write down my mail and credit card details. Most of the time the prices are fixed so you just need the country to tell the price. See ebay for good example.

summary: I didn't buy any of the books because I didn't know how much I would have to pay.

This deal is about ebooks, so I figure shipping would be whatever your isp charges you for traffic in this particular case.
Well, now I feel stupid. But still, if you sell something that needs to be shipped - show the shipping price as soon as possible.
Yeah, I can actually agree on that. I think there's a few times where I've registered and jumped through hoops only to find that, no indeed, "we do not ship outside of the USA"
It's hardly a shootout when you don't even control for price (not to mention up-to-date-ness, as intranation noted).