5 ms·
Emacs Lisp Elements
- NeutralForest 2y agoWhen Prot writes something I try to make place to read it. He's a very nice person and also inspiring, he's living following his values and is very insightful.
- precompute 2y agoGreat! This could serve as an easy introduction for users new to Elisp.
- mfld 2y agoNice - I feel this introductory guide fills a gap. Also, I really like his video tutorials.
- algo_lover 2y agoOne of the good things to happen in emacs was the inclusion of `seq.el`. It makes easy functional operation over sequences, so no longer need `dash.el` or `cl-lib.el`. (dash still has many more functions inspired by clojure which is awesome when you need them) But I still wish the emacs community could adopt a modern data structure library. It's difficult to consolidate usage of sequences (lists/vectors) with alists and plists. This would make it so much more accessible.
- tom_ 2y agoThanks for the tip. I'd managed to miss the addition of these. I had somehow noticed the addition of the newer string- functions though, and immediately found them a huge improvement over the mishmash of randomly-named crap that was there before, so I expect seq- to be similarly transformative. I immediately notice there's seq-filter, which can kill off one of my helper routines. And then (now I'm looking...) I've discovered this was always equivalent to cl-remove-if-not. But I never realised, because of the mystery meat naming conventions.
- ajross 2y agoSeems clear and useful. That said, there's nothing particularly bad or inaccessible about the actual Emacs Lisp manual: https://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Introduction https://www.gnu.org/software/emacs/manual/html_mono/elisp.ht... Or the official tutorial: https://www.gnu.org/software/emacs/manual/html_mono/eintr.html#Preface https://www.gnu.org/software/emacs/manual/html_mono/eintr.ht... (which to be clear I haven't read, but have heard nice things about). Of all the things for which emacs can be criticised, documentation rigor is really not one.
- db48x 2y agoAgreed; Emacs is the gold standard for documentation. It comes with a reference manual (400k words), an Emacs Lisp reference (600k words), _and_ 64 other manuals for individual Emacs modes or features including one just for Calc mode (250k words), a manual just for Org mode (130k words), one for Gnus (180k words) etc. All told it adds up to about 2.6 million words of documentation. Still, another manual written from a different perspective probably won’t hurt anything.
- beepbooptheory 2y agoThe Gnus manual in particular has certain whimsical Pratchett-esque charm to it that I love so much.
- kstrauser 2y agoThe manual (https://www.gnus.org/manual.html https://www.gnus.org/manual.html) starts with: > See what the critics say about the manual: > “Often when I read the manual, I think that we should take a collection up to have Lars psycho-analysed.”
- spudlyo 2y agoOne reasons Prot himself was able to become a bonafide Emacs Guru in just a few years is because he's the kind of person who reads manuals. He speaks highly of the included docs, and often credits them for his knowledge.
- mijoharas 2y agoIt's a shame it doesn't really go into keywords, or alists/plists. (Or different argument lists, he mentions `&rest` but there's optional, and more too iirc)
- tikhonj 2y agoI've had a great time using Emacs Lisp over the past 15 years: it's one of the easiest ways to quickly whip up personalized tools for my own use, and, at the same time, my code has been surprisingly resilient and stable over this time. And this is despite the fact that Emacs Lisp routinely flouts every single software engineering "best practice". The language is dynamically scoped by default! It simply doesn't have namespaces! Static types? Hah! (And I, an inveterate Haskeller, don't even miss them.) You can—and people routinely do—hook directly into all sorts of implementation details from other parts of the codebase. And yet it just works. And it works remarkably well. My theory: what matters isn't "best practices", it's have a coherent conceptual design and code that reflects that design. Emacs is designed around a small but expressive set of core concepts that it uses in a consistent manner. Text with properties, buffers, modes, commands, customization variables... Almost everything more complex in Emacs is structured out of these (+ a handful more), and, once you've internalized them, it's surprisingly easy to both learn new higher-level tools and to write your own. The design of both the user interface and the code directly reflect these concepts which gives us a naturally close connection between the UI and the code (it's almost trivial to jump from an interaction to the code that powers it), makes both UI and code units effortlessly composable and generally makes it easier to understand what's going on and how we can change it.
- nothrabannosir 2y ago> My theory: what matters isn't "best practices", it's have a coherent conceptual design and code that reflects that design. Just because something has a >0 level of success doesn't mean there are no negatives. "Best practices don't matter because Emacs Lisp doesn't follow them and it just works" isn't a valid argument: it could very well be that Emacs (Lisp) would shine fifteen-fold brighter if it did also follow those practices. It just happens that having those elements you mentioned as positives are enough to keep the train going in spite of the shortcomings. I use Emacs and program in Emacs Lisp to scratch my itches, and I agree that there are elements that make it work and hey, I'm still here, but I will bet good money that a parallel universe with Emacs Lisp', Now With Namespaces would work even better. "Working" isn't binary.
- 2y ago
- sauercrowd 2y agoProt - the author - is a pretty incredible guy. He maintains a bunch of nice Emacs packages and themes. But maybe even more remarkable: he got kicked out of his flat in Greece, couldn't afford a new place, bought a small plot of land in the mountains and started building a hut from materials he was able to afford or from things neighbours gave him. Really the bare minimum (he often sat in his hut with a jacket in winter cause it wasn't well isolated/heated) Absolutely inspiration, all documented on his YouTube channel https://youtube.com/@protesilaos?si=MnjV7MhKtsT5RDSM https://youtube.com/@protesilaos?si=MnjV7MhKtsT5RDSM
- hollerith 2y agoA video of the inside of the hut: https://www.youtube.com/watch?v=W2T_lihBs9I https://www.youtube.com/watch?v=W2T_lihBs9I
- kleinishere 2y agoHe also offers 20EUR/hr eMacs coaching. For those jumping in or graduating to a new level. https://protesilaos.com/coach/ https://protesilaos.com/coach/
- dima55 2y ago"emacs". It is called "emacs"
- dan-g 2y agoThis happens with iOS autocorrect → https://en.wikipedia.org/wiki/EMac https://en.wikipedia.org/wiki/EMac
- musicale 2y ago"Wouldn't it make life easier for us at Apple if we added all of our product name capitalizations like iMac, iPod, etc. into the autocorrect dictionary? Marketing would probably love it too." -Someone at Apple, probably, circa 2006 And here we are.
- deleted 2y ago[deleted]
- ptx 2y agoHmm, there seems to be no mention of dynamic vs. lexical binding, which is a difference from some other Lisps I was hoping to gain some insight on.
- sctb 2y agoIf you're still interested: https://www.gnu.org/software/emacs/manual/html_node/elisp/Lexical-Binding.html https://www.gnu.org/software/emacs/manual/html_node/elisp/Le.... Basically modern Emacs Lisp works like Common Lisp.
- mark_l_watson 2y agoWhat a great find. Not sure why I have not discovered Prot before. Bookmarked the article and this thread. I have been using Emacs for about 40 years, and as a crazy side effect of the mountain of LLMs hype, with a lot of productivity enhancing goodness, I think that Emacs can only gain in popularity because of several excellent Emacs LLMs packages. Most of the world is exploiting LLMs with VSCode and its variants, but Emacs is also just about perfect for integrating LLMs into workflows and for having fun and playing around.