mentioning it here in the hope that it is is useful to others as well...
mentioning it here in the hope that it is is useful to others as well...
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.
https://github.com/alphapapa/emacs-package-dev-handbook#lexi... says using lexical scoping is a best practice.
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.
Here's an example of Emacs running in the terminal with a few apps open: 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).