6 ms·
Evolution of Emacs Lisp [pdf]
- triska 8y agoElisp is awesome! Emacs is truly an integrated development environment also thanks to this great extension language. This paper provides a nice overview of past and also very recent language developments. For example, support for bignums (Section 7.3) is one of the most exciting new features. Thank you very much for putting this together, and for all your work on Emacs!
- blablabla123 8y agoDo you know maybe a good documentation for it? The official manual seems a bit verbose, not containing much code :-)
- another-cuppa 8y agoIf you're not already a lisper I would recommend learning Common Lisp from one of the many excellent books. Learning the differences for Emacs Lisp afterwards is a breeze, and you get a much a more general purpose view of Lisp.
- blablabla123 8y agoAlready have a basic experience with that. But it seems Emacs provides a lot of APIs, for instance for Widgets.
- triska 8y agoPersonally, I regard the reflective and introspective capabilities of Emacs as extremely powerful tools for learning more about Elisp and the entire environment. For example, every time you press a key (or key sequence) that results in any action, Emacs internally invokes a function (most of them written in Elisp, some of them in C) that achieves this action. So, when you want to automate a task and have a rough idea how to achieve it by pressing key sequences, you can inspect their associated functions and their source code, and study how they are called and even how they do it. As a quick start, you can—using Emacs itself!—display a list of all functions that are bound to any key sequence. To get this, simply press: C-h b This gives a good first indication of which functions are important for editing, because functions that are very frequently needed are typically available via a predefined key sequence. But then, your next question may be: What did C-h b actually do? That is, which function did this actually invoke? Of course, one straight-forward way is to simply search for "C-h b" in the buffer that shows all these key bindings, because you know it must appear there. Another way is to use C-h k C-h b. But then, what did C-h k actually do? To find out, we apply C-h k to its own key binding: C-h k C-h k and from this, you see that C-h k internally invokes the Elisp function "describe-key". At this point, it is essential that you also have the (Elisp) source code installed. If you have it, then you can simply browse the Elisp definition of describe-key, and see how it achieves its task. The same goes for every other function you may be interested in: You can browse its definition, copy it (for example) into the scratch buffer, change it, evaluate it and run it. You will find that not much is needed to get started with Elisp, because many tasks can simply be written as a sequence of standard commands of which C-h b provides a good first overview. You can also press C-h l to get a list of the last few input keystrokes and the invoked commands. In addition to that, to automate simple tasks in Elisp, you often only need a few simple commands that let you fetch text from any position in the buffer and to insert it (see for example the functions buffer-substring-no-properties and insert), the ability to launch external processes (the "Processes" chapter in the Elisp info documentation is great) and a way to perform editing operations in a temporary buffer (see with-temp-buffer). To find out more about these functions, simply use C-h f. And, of course, you can simply use C-h k C-h f to see what C-h f does! One essential point: To make Emacs keybindings more convenient, I recommend to turn Caps Lock into an additional Ctrl key.
- village-idiot 8y agoCounterpoint: Emacs lisp is effective because it’s in Emacs. Within the editor space, Elisp is an absolute star, since the nearest competitor is vimscript... As a stand-alone language it’s pretty weak, even compared to other lisps. Default dynamic scoping comes to mind.
- celeritascelery 8y agoWhile I mostly agree that Elisp is fairly weak compared to other lisps, I should point out that it does support lexical scoping (and that is the recommend usage)
- CamTin 8y agoNot only that, but you can situationally decide which kind of binding you want, which is sometimes pretty useful.
- chongli 8y agoVimscript was a mistake, if you ask me. The power of vi is its edit commands and the ability to bang text through shell commands. A very careful, considered expansion of a few features in vi to improve its integration with outside script interpreters (Perl, Python, etc.) as well as language servers could've produced an extremely compelling editor. As it is, I've found that you can do a lot with just vi, tmux, and bash (along with all of the utilities).
- pault 8y ago> A very careful, considered expansion of a few features in vi to improve its integration with outside script interpreters (Perl, Python, etc.) as well as language servers could've produced an extremely compelling editor. Isn't this what neovim is for?
- chongli 8y agoNo, neovim is still the same concept: you're scripting the editor. It's still this gargantuan thing with all of these things you bolt on and reams of documentation to wade through. It still has the vim philosophy (which is the same as the Emacs philosophy, only not as good): my editor is an operating system and I want to rewrite all of my software to run inside of it. I'm thinking of something altogether different: you leave the editor alone and you script the operating system around it, using the editor only as a flexible control interface for everything. This is the original vi philosophy. It means you don't have to rewrite anything. Any new program you install, if it can send/receive text on STDIN/STDOUT/STDERR, then you can use it in vi. So what's wrong with vi? It has a few shortcomings: no unlimited undo, no ability to pass the cursor (row,col) position to an external command, and working with multiple buffers is more painful than it needs to be.
- stiff 8y agoIf you are used to any reasonably modern programming language, writing any serious Elisp is an exercise in frustration, it is hard to even find out at all how to accomplish basic things, and once you do, there are tons of pitfalls, it is a legacy platform and it feels like its evolution over time was largely accidental. I am talking about doing basic things, working with lists, maps and strings, opening files, running processes, making HTTP requests, etc. For example, if you want to use a map, you have three choices: you can use alists, plists or hash maps. There are no namespaces in Emacs Lisp, so for each of the three data types you get a bunch of functions with weird names. For alists get is assoc and set is add-to-list, for hash maps get is gethash and set is puthash, for plists get is plist-get and set is plist-put. For each of those types it is easy to find basic use cases that are not covered by the standard library, plus it is easy to run into performance pitfalls, so you end up rewriting everything several times to get something working. The experience is the same across the board, when working with files, working with strings, running external processes etc. There are 3rd party libraries for all those things now because using the builtins is so painful. In many ways it feels like programming some old web browser where you either need to patch the standard libary with 15 dependencies or learn complicated incantations for really basic tasks. The ideas behind emacs and emacs lisp are great, so I really wish someone succeeded in creating a modern implementation from scratch and it gaining some traction, basically what Clojure did for Common Lisp. By the way even Common Lisp is way more modern than Emacs Lisp...
- nemo846 8y agoI believe there have been attempts at integrating GNU Guile (enabling the use of Scheme) into it and replacing ELisp going forward. The project seem dead in the water though.
- bjoli 8y agoI don't know if I would call elisp awesome. In fact,I would probably not be alone in calling it the worst lisp dialect in widespread use. The only thing really good about elisp is that it is integrated into Emacs.
- username223 8y ago> The only thing really good about elisp is that it is integrated into Emacs. But that's really, really good compared to most programs, which are customized by dialog boxes or INI files. Imagine how great it would be if you could script your web browser using some semi-decent programming language, and your scripts would work 30 years from now.
- nickdrozd 8y agoEmacs has a function for transforming a window of text under ROT13, rot13-other-window. The Emacs manual [1] says, "For example, a review of a film might use rot13 to hide important plot points." This example was added in 2012. The source code [2], on the other hand, gives a different use case: "ROT13 encryption is sometimes used on USENET as a read-at-your-own-risk wrapper for material some might consider offensive, such as ethnic humor." This comment was added no later than 1992. [1] https://www.gnu.org/software/emacs/manual/html_node/emacs/Rmail-Rot13.html https://www.gnu.org/software/emacs/manual/html_node/emacs/Rm... [2] https://github.com/emacs-mirror/emacs/blob/master/lisp/rot13.el https://github.com/emacs-mirror/emacs/blob/master/lisp/rot13...
- UncleEntity 8y agoNot really sure what your point is...
- civility 8y agoI think the implication is that once upon a time, Emacs had a comment/docstring which wasn't politically correct. Let the shunning or boycotting begin...
- deleted 8y ago[deleted]
- another-cuppa 8y agoThe person who wrote that did something useful with his life. You are not doing anything useful with yours.
- dang 8y agoWe've banned this account for repeatedly violating the site guidelines. Would you please not create accounts to do that with? https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- josteink 8y agoDoes anyone have a non-PDF version of this available? PDFs are terrible on mobile.
- michaelmrose 8y agoCheck out moon reader pro which handles mobi/epub/pdfs/etc
- antoineMoPa 8y agoI use emacs all the time, but I don't really extend it. More recent editors are extensible via web tech such as javascript, which sadly often comes at the price of having an electron base. Javascript does have the advantage that you can console.log() everything and discover functions easily for a given object. I still don't know how to discover stuff when I need it in elisp except M-X apropos which often fails to find something useful.
- tsuru 8y agoDo you use something like `counsel` or `helm`? I personally use `helm` and have found `helm-apropos` to be a much better experience mainly due to fuzzy matching. I'm sure there is a counsel analog. Out of curiosity, do you happen to have an example of a search you've tried that doesn't produce something useful?
- antoineMoPa 8y agoDid not know about helm. I just installed it and I think that this alone might solve 75% of the problem, thanks! As an example, let's say I'm new to elisp and I am wondering how to insert a character to a buffer. `apropos` "insert" just returns too much stuff. `heml-apropos` seems much better though, with a readable output. However, you still have to know that the function is named "insert", which you can spend lots of minutes on. In a Javascript parallel universe, there is a high probability that I would have done `console.log(buffer)` and I would have found the `buffer.appendChars()` method in seconds. You can quickly find what you can do with an object in Js/Python/PHP, but in elisp, I have yet to find.
- dmortin 8y ago> Did not know about helm. I just installed it and I think that this alone might solve 75% of the problem, thanks! Helm has a lot of extensions, here are some popular ones: https://emacs-helm.github.io/helm/#helm-applications https://emacs-helm.github.io/helm/#helm-applications > As an example, let's say I'm new to elisp and I am wondering how to insert a character to a buffer You can use google as with any other software. If you search for 'elisp insert character' with google the first hit is the insertion section of the manual which tells you the functions: https://www.gnu.org/software/emacs/manual/html_node/elisp/Insertion.html https://www.gnu.org/software/emacs/manual/html_node/elisp/In... As with any other software using google you can find things much more efficiently than with the builtin searching functions.
- wiz21c 8y agoIf you don't have time, just read the condlusion, it's veryinspiring for all of us who are "individuals who code for the benefit of others"
- DonHopkins 8y ago>During the early years of Emacs, the main complaints from users about the simple mark&sweep algorithm were the GC pauses. These were solved very simply in Emacs 19.31 by removing the messages that indicated when GC was in progress. Since then complaints about the performance of the GC have been rare. Most of them have to do with the amount of time wasted in the GC during initialization phases, where a lot of data is allocated without generating much garbage. At 300 baud, I bet the GC messages took longer to display than the GC itself.
- deleted 8y ago[deleted]
- pjmlp 8y agoNice that they go over XEmacs time period, it was my favorite variant, as it provided better GUI tooling support back then.