This article can be seen as an introduction to emacs hacking. It features profiling, hooks, advice, and more emacs developer tricks. I haven't read it fully yet but this looks like a nice way to get to know emacs deeper.
Learning the concepts and ideas behind lisp really expanded my horizons as a programmer. For me, that all started with emacs. Though elisp isn't very fast and has some pain points, emacs as a whole gave me an extremely established customizable code base that I could play around and learn in.
Though it's cliché and often listed as a negative, emacs really gives the user more than just a program to edit text.
> Though it's cliché and often listed as a negative, emacs really gives the user more than just a program to edit text.
I would not recommend emacs as an editor these days to most developers, but it absolutely still remains one of the most visionary and well thought out pieces of software ever written. It is both hilarious and depressing how emacs has been literally decades in the future over all of its 45 years of existence, without even the most obvious clearly superior aspects diffusing into the sea of idiocy surrounding it at a rate faster than one or two decades per feature.
Not everything about emacs is great, or even were great, without downside (for example the extreme malleability and customizable bring a raft of problems as well). But a couple of things really were and in some cases still are just obviously, massively, better without the rest of the world being in any seeming hurry to adopt them.
Incremental search is the prime example. It has finally become ubiquitous, and yet Emacs was basically the only thing that had it for well over a quarter century. As Raskin quipped in The Humane Interface (2000), search is either incremental or excremental (unfortunately he seemingly also tried to steal the credit -- he had an interesting mode-less variant of incremental search in Copy Cat which deserves notice, but it still postdated emacs by quite a few years, and I've never seen him acknowledging emacs as prior art). So I would really love to understand why neither netscape or basically anything else in the 90ies had incremental search, despite often being written in large parts in emacs by people living and breathing emacs such as JWZ.
And to this day emacs remains one of very few programs with a proper (i.e. non-linear) undo system or a clipboard not suffering from severe dementia, or the ability to actually ask "what happens when I click here?".
> I would not recommend emacs
Why not? The whole rest of your comment is nothing but a list of (very good IMHO) reasons to use emacs.
Not OP, but long time (and current) Emacs user and fan who also doesn't recommend it to new folks:
Language servers has made most of the heavy features in dedicated major modes in Emacs sort of redundant; servers provide error checking, warnings, refactoring and so on. The gritty bits are in the server, leaving editors to do the syntax highlighting and project management.
This sounds great, but Emacs doesn't ship with support for them, and Emacs' built-in package management is kinda unfinished.
To get good C support, for instance, I would;
1. Install straght.el for its use-package implementation
2. Pull in the lsp-mode package (or eglot, I suppose)
3. Install ccls somehow, because Emacs won't
4. Pull in the projectile package, because the built in ede is kinda cumbersome
5. Pull in magit, because the built in vc mode is nowhere near as good
6. Configure lsp-mode to grok ccls
7. Pull in emacs-gdb, because the built in gdb-mi is cumbersome
8. Finally get to work
With, for instance, vscode I would:
1. Open a C file
2. Install the recommended extension
3. Get to work
And then C works well, the debugging is ok, and so on.
At the end of all the steps I find Emacs superior to use, but most folks will have higher productivity with vscode.
 https://github.com/emacs-ng/emacs-ng Disclosure I've posted about this on HN in the past, but I felt it was very relevant to the parent comment.
EDIT: I've finally figured out how to insert an asterisk around a word on HN without needing spaces. Is this documented anywhere? Just use double asterisks on either end like
Turns out this is in the FAQ, it's been a while since I looked at the formatting part of that so I guess it changed since 10 years or so ago or I'd forgotten.
The Advent of Computing  podcast recently put out their episode 47 which I think provides a sort-of explanation of this line of thinking. The short answer is that the context in which Emacs was originally developed (a contemporary of Unix, and not Unix itself, which was something I wasn't aware of before) emphasized user power and lack of restriction to a much greater degree than much of the current computing landscape does. Why would you lock users or developers into a fixed, defined plugin API when you could write the application in such a way that they have access to whatever they need?
Don't get me wrong - it would be a security nightmare, but there's a cost to trying to guarantee security through mechanism rather than trust.
> While emacs has parts written in C, that portion really exists to enable elisp.
You should do a line count; GNU Emacs has more than 250,000 lines of C.
Aren't macros a just form of code generation?
No, js is not powerful enough for getting the same features that Emacs have, because emacs is almost an operating system.
With js you could create a very simplified version, if you remove 95% of the emacs codebase.
Most people just use 1-2% of emacs anyway, and there are editors that just do that, control a simple text editor with js.
I use Emacs pretty casually, so it's cool to see the thought process of someone that actually knows their way around it when customizing it.
Its too bad you didnt title it:
(((a rabbit hole of lisp)))
Rather (of (rabbit hole) lisp) ?
I think it should be
(of lisp (hole rabbit))
haha... I havent written any lis since 2000 or so.... so I forgot any proper format...
edit: Why TF was this flagged???
tldr -- Author is inexplicably surprised how slow retrieving a directory listing of 70,000 files is over ssh. He installs a fast version of UNIX `find` on remote machine, and writes an elisp wrapper around an rpc to it.
"Rabbit holes" suggest a circuitous journey towards a deceptively simple goal fraught with red herrings and wrong turns. Author appears to be under illusion that reading a play-by-play of that laborious process is somehow entertaining or rewarding.
Not even reading that far:
As I write this I attempt to reproduce the issue by re-adding ‘ffap-guess-file-name-at-point’ to ‘file-name-at-point-functions’. I can't reproduce it anymore.
(Which of course is not to say that the article isn’t an interesting dive into Emacs and elisp.)
Get a daily email with the the top stories from Hacker News. No spam, unsubscribe at any time.