4 ms·
Since that book is over 20 years old, is it still relevant and useful?
by rvdginste 5y ago
Since that book is over 20 years old, is it still relevant and useful?
- jhbadger 5y agoPretty much, yes. I'm sure there's a few things that have changed, and a newer book is welcome, but Emacs hasn't really changed much in 30 years.
- ragnese 5y agoI don't know my Emacs timeline very well, but I'd be nervous about lexical scope and the more recent cooperative async features of Emacs (lisp) not being represented in a 20 year old book. EDIT: Yeah, Emacs 24 had support for lexical scope, and that was in 2012. You'd be doing a disservice to yourself, IMO, to write dynamically scoped Elisp today, unless you had a specific reason. And if you don't even KNOW that lexical scoping is an option, it would be unfortunate.
- draven 5y agoI checked the book's TOC and was surprised to see that lexical scoping was introduced in the last chapter. https://github.com/alphapapa/emacs-package-dev-handbook#lexical-binding-1 https://github.com/alphapapa/emacs-package-dev-handbook#lexi... says using lexical scoping is a best practice.
- klibertp 5y agoYes. Emacs takes backwards compatibility seriously. Not kernel-level seriously, but seriously. Moreover, a book written 20 years ago was still written more than 20 years after initial Emacs release. By then, a lot of best practices were already discovered and they remain common in Elisp code to this day. There was a lot of development in that time and many things became easier to do, but the basics of writing Elisp programs didn't change. IMO the book is especially worth a read if you want to change your perspective: it does a really good job at showing that Emacs is, in essence, a runtime environment and a development platform akin to web browsers, with a huge stdlib of libraries and applications, and focused on mostly-text display. Next time you find yourself reaching for ncurses, stop and go for Elisp instead. You'll get the (optional) GUI and sane defaults for free, along with rich text editing functionality where needed.
- rvdginste 5y agoOk, thanks, good to know.
- guessbest 5y agoAre there any good guides or examples on using elisp to build an environment like ncurses?
- klibertp 5y agoYou can take a look at basically any of the larger apps, like M-x magit, speedbar, neotree, treemacs, calc, undo-tree, proced, tetris, gnus, epa, dired... (some built-in, some 3rd party). By default, when you start Emacs, you are in the lisp-interaction-mode app, which allows you to write (and execute) Elisp code. But, if you start any of the apps above, you'll get window(s) with semantics having nothing in common with editing text. They still display with text (or emoji under GUI), but they treat the buffer contents as something else than just text, and you can create panes with such content anywhere on the screen. I think this is more or less what you get with ncurses. Here's an example of Emacs running in the terminal with a few apps open: https://klibert.pl/statics/images/emacs_terminal.png https://klibert.pl/statics/images/emacs_terminal.png You can see treemacs, helm, dired and magit in action. I could probably give a better example if you said what exactly you'd like to build. There's a lot of apps written for Emacs, not many of them are truly standalone (meaning they tend to integrate into Emacs instead of integrating Emacs into the app), but there are a few like that, too (ie. music players or games).
- guessbest 5y agoThanks, this is a good starting point for me.