Live data from Hacker News

Learn Emacs Lisp in 15 minutes

bzg.fr

61–70 of 71 posts

Re: Learn Emacs Lisp in 15 minutes

#61
post #34

If you don't know Emacs Lisp, there's no point of using Emacs. You'd probably be more productive in Vim or [insert favorite proprietary editor here]. Emacs Lisp is probably the most featureless language you can think of; it doesn't even do basic threading and the async stuff is a joke. All the major programming language modes are implemented as ad-hoc Elisp regexp parsers making bugs impossible to fix. Virtually _eve…

I always get a chuckle out of people complaining that Emacs is too slow. Maybe I've just "gotten used to it", but when I first started using it I was sharing a Sun 3 with ten or fifteen other people. I'd also argue that modes in other editors are ad hoc regexp parsers in some other form... regexps, in the hands of someone who knows what they're doing, work well. And yes, virtually everything is implemented in Emacs L…

You're not going to notice any lags if you use Emacs to work on toy projects. Try a non-trivial operation on a repository of respectable size, like linux.git: if you don't classify those operations as being "completely unusable", you're living in the dark ages.

Incorrect. Several proprietary IDEs use real parsers. Which is precisely why they're able to provide all sorts of magic functionality like "refactor". And no, regular expressions don't "work well" by a stretch: even the common modes like shell-script-mode, perl-mode (cperl-mode is slightly better), python-mode are riddled with bugs. If you look at the relatively new js2-mode, you'll notice that the parser is an Elisp port of the Rhino parser. Also, Semantic Bovinator from the CEDET project was recently merged into emacs, although it doesn't have major users yet. Precisely because regular expressions aren't "good enough".

The reason everything is implemented in Emacs Lisp is because there is no alternative: Elisp doesn't have an FFI to speak of. Otherwise, I don't see the problem with using existing parsers; unless your "point" is to take everyone back to the dark ages.

No matter how you look at it, there are more alternatives to Vim/Emacs than there were 30 years ago. A lot of people are happy with TextMate, Coda, Visual Studio, Eclipse. It's not like there's something special about the year 2013, but what I meant is: Emacs will become extinct, and that is inevitable. And yes, I'm hoping for some kind of programmable editor to take its place soon.

Re: Learn Emacs Lisp in 15 minutes

#62
post #34

Earlier quoted context omitted.

I always get a chuckle out of people complaining that Emacs is too slow. Maybe I've just "gotten used to it", but when I first started using it I was sharing a Sun 3 with ten or fifteen other people. I'd also argue that modes in other editors are ad hoc regexp parsers in some other form... regexps, in the hands of someone who knows what they're doing, work well. And yes, virtually everything is implemented in Emacs L…

30 Decades!!! wow.

Emacs didn't work very well on the Bouchon loom (http://en.wikipedia.org/wiki/Basile_Bouchon) but dammit, they tried.

Re: Learn Emacs Lisp in 15 minutes

#63

Earlier quoted context omitted.

+1. Evil is great. I think it's made Emacs my favourite implementation of Vi yet.

Well, the problem is that these bindings don't usually implement the corner case Vim functionality I've come to rely on over the years. Can it record macros perfectly? Does :%s/foo/bar/ work? How about selecting, then :s/foo/bar/gi? Does the period key reproduce all actions properly? How about :%s/foo\([0-9]+\)/bar\1/ ? Do all of the basic actions do exactly the same thing as they do in a vim editor? Does % take you…

As others have said, Evil's emulation is really good. I've ran into the same problems you have mentioned in other Vim emulation layers so I had the same suspicious with Evil. Evil didn't disappoint. Very good so far.

Re: Learn Emacs Lisp in 15 minutes

#64

Earlier quoted context omitted.

Try textadept! It is structured in a way similar to Emacs: small core in C, most functionality written in Lua. In my opnion the only thing better about Elisp than Lua is that it has macros, everything else, from scoping to speed and coroutines is probably better in Lua. And the icing on the cake? The parsers use LPEG grammars and not regex! Of course there is a downside: it has a tiny fraction of Emacs's functionalit…

Let's put aside the fact that it's a one-man project for one second. I tried building it from sources for an hour before giving up: it depends on lots of custom packages which it fetches and custom patches [1]. Okay, so it has a really tiny C core [2], upon which lua modules build up the rest of the editor. I'm impressed: yes, this certainly qualifies as a programmable editor. It has some interesting ideas worth expl…

I didn't try building it from source, so I didn't know about any difficulties in doing so. I agree that that is a serious issue. In particular I wonder if patching Scintilla and Lua is really necessary...

About opening files and navigating buffers: I must have been a very naive Emacs user because I didn't really miss anything basic. I open files by typing the file name, with tab completion. I switch to buffers in two ways: if I have only 2 or 3 buffers, I advance between them; if I have more, I jump between them by typing portions of their their names. To navigate inside a buffer all I use are motions by character, word, line, paragraph, page; jumping to matching parenthesis, bracket or brace; incremental search; jumping to line numbers. All of this is present in Textadept, so I felt the basics were covered. (I am sure that more expert Emacs users will definitely find lots to miss in Textadept.)

Indenting of course is much more primitive in Textadept, that's definitely true. I'm used to indenting manually (well, not totally manually: having each newline start with the indentation of the previous one and then adding or removing indentation using tab and S-tab), from using other non-Emacs editors and esoteric languages for which no Emacs mode had been written at the time, so I didn't mind that much.

The first thing I really missed was eval-last-sexp, so I quickly wrote a basic substitute (since Lua doesn't have those easy to match parenthesis around everything, I evaluate either the selection or, if empty, the whole line; that works for me). I have the Lua code evaluated in an environment where the usual print function inserts text in the buffer instead of writing to stdout.

Re: Learn Emacs Lisp in 15 minutes

#65

1. Every book on computers, or anything technical should read this guys blog before they get fire up the word processor. 2. My biggest gripe about 99.9% of COmputer programming books are: They are long. They are poorly written. They read like a telephone books. 3. I once heard one famous programmer state, I won't read a programming book with more than 500 pages. I think he was off by 400 pages? 4. I truly believe if…

writers get paid per word, still wondering why 80% of book has no substance?

Re: Learn Emacs Lisp in 15 minutes

#66

1. Every book on computers, or anything technical should read this guys blog before they get fire up the word processor. 2. My biggest gripe about 99.9% of COmputer programming books are: They are long. They are poorly written. They read like a telephone books. 3. I once heard one famous programmer state, I won't read a programming book with more than 500 pages. I think he was off by 400 pages? 4. I truly believe if…

I have a similar one, I don't buy a book with more than 200 pages, as I'm unlikely to read it.

Re: Learn Emacs Lisp in 15 minutes

#67

Earlier quoted context omitted.

LightTable is proprietary software. Please use Emacs instead.

The facts are more complex. "I'm a firm believer in open source software and open source technologies. I can guarantee you that Light Table will be built on top of the technologies that are freely available to us today. As such, I believe it only fair that the core of Light Table be open sourced once it is launched, while some of the plugins may remained closed source. At some level, this is an experiment in how open…

I don't have high hopes.

1) He's not working in the open, he just says "I will free it, honest." Maybe he'll go through with it, but as of now he's distributing proprietary software.

2) He says that some of the plugins will be nonfree. We know that through Emacs that the plugins are essentially everything. Nonfree plugins means a nonfree editor.

I'll be sticking with Emacs. Emacs is still improving. There is a project to replace the existing ELisp VM with GNU Guile, which will improve performance and bring many new features, such as an FFI and threading.

Re: Learn Emacs Lisp in 15 minutes

#68

Earlier quoted context omitted.

Indeed. The most value I got from from learning to customize Emacs wasn't the functionality I implemented but seeing how powerful a domain specific language can be. The ways that Emacs Lisp supports working with text, whether data or code or documents, showed me what I should be aspiring to when I create a DSL.

Imagine, then, what a wonderful thing Open Genera was.)

Apparently an older version was opensourced at some point. I don't see why the people who love it don't port it to x86.

Re: Learn Emacs Lisp in 15 minutes

#69

Earlier quoted context omitted.

The facts are more complex. "I'm a firm believer in open source software and open source technologies. I can guarantee you that Light Table will be built on top of the technologies that are freely available to us today. As such, I believe it only fair that the core of Light Table be open sourced once it is launched, while some of the plugins may remained closed source. At some level, this is an experiment in how open…

I don't have high hopes. 1) He's not working in the open, he just says "I will free it, honest." Maybe he'll go through with it, but as of now he's distributing proprietary software. 2) He says that some of the plugins will be nonfree. We know that through Emacs that the plugins are essentially everything. Nonfree plugins means a nonfree editor. I'll be sticking with Emacs. Emacs is still improving. There is a projec…

I will bet you a bitcoin that Light Table is released under an OS license before the ELisp VM is replaced with Guile. Deal?

If Emacs was what I wanted, I'd have started using it ten years ago. Remember, editors are religion; please be polite.

Re: Learn Emacs Lisp in 15 minutes

#70
post #8
post #5

Basic Emacs lisp is well worth learning. It takes Emacs from being an editor to being your editor. With something like Eclipse, even adding a little bit of functionality is an undertaking. You have to create a project, write a bunch of boilerplate, load it and so on. With Emacs, it's basically effortless: a line or two of elisp can do wonders. Sometimes I add functionality by just executing elisp directly (with M-:),…

An excuse to dive into lisp like that just might pull me away from Vim (Vimscript is terrible, sigh).

This is basically the reason why I switched from Vim to Emacs.
Post reply on HN