15 ms·
My Emacs Lisp book is finished
- 098799 5y agoThanks for the submission. I was hoping it would be finished and didn't want to purchase an incomplete book, so it's helpful.
- rStar 5y agoI felt like Superman the first time I hacked some emacs lisp. One of the most enjoyable programming experiences of my life. Thanks for this book.
- mrspeaker 5y agoI think this book would be perfect for me - I have been using Emacs for quite a while, but never mastered elisp: I could never figure out how to structure things properly. Looking at the book landing page, I think I would have passed on it because the Table of Contents make it look a bit like the book is just covering specific tasks (about rearranging sentences) rather than general tasks, like using best practices for creating packages. It would be good to include the paragraph from your blog in the book landing page: In the first chapter, it tells you basically how to find Elisp functions doing things you need. In the second, longest chapter, it walks you through writing a complete, useful package, showcasing lots of Elisp features and good practices. In the third, last chapter, it hints at a few more advanced techniques – functional programming, lexical scoping and regular expressions. This made me a lot more excited about the contents!
- bjarneh 5y ago> I have been using Emacs for quite a while, but never mastered elisp You are not alone in that boat :-)
- rvdginste 5y agoAs a developer, I find it a bit embarassing that I started using Emacs in 2000, that at some point I even read my email with it, and that I never took the time to really learn emacs-lisp. Still, some day I will. This book might help me. :)
- bjarneh 5y ago> Still, some day I will I said I'd lean Spanish some_day® as well, according to duolingo that was 9 years ago :-)
- rvdginste 5y agoUh... well, it would be even more embarassing to admit how long I've been telling myself that I'd start learning emacs-lisp in earnest... so I won't. :)
- bloopernova 5y agoI'm just a devops person, not a coder by any stretch of the imagination, but I found that maintaining my .init.el in git helped me to learn enough elisp to be useful/dangerous. I really dig that it's a full on language used for the configuration files. It just makes so much sense to do it that way. (I also like VSCode's json prefs) Also I love sharing snippets of my .init.el: 40 │ ;; Taken from https://karl-voit.at/2017/02/11/my-system-is-foobar/ 41 │ ;; Check if system is Darwin/macOS 42 │ (defun my-system-type-is-darwin () 43 │ "Return non-nil if system is darwin-based (Mac OS X)." 44 │ (string-equal system-type "darwin") 45 │ ) ... 65 │ 66 │ (when (my-system-type-is-darwin) 67 │ ;; EXAMPLE: (global-set-key (kbd "C-z") 'shell) 68 │ ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-Rebinding.html#Init-Rebinding 69 │ (global-set-key (kbd "s-/") 'comment-or-uncomment-region-or-line) 70 │ (global-set-key (kbd "s-<backspace>") '(lambda () (interactive) (kill-line 0))) 71 │ )
- jolux 5y agosystem-type is actually a symbol, so you can do (eq system-type 'darwin) for the same effect. here's my macOS section: https://github.com/bklebe/.emacs.d/blob/b0ca255032d1240942ff885b98be51c9b5a37106/README.org#macos-configuration https://github.com/bklebe/.emacs.d/blob/b0ca255032d1240942ff...
- bloopernova 5y ago
- ljm 5y agoI would love a dead tree version too. I've never managed to get on well with ebooks and PDFs.
- ashton314 5y agoThis is very exciting and I will definitely be looking into this when I have a little more time! I’ve tried writing my own Emacs packages before, and I have never felt like I knew what I was doing. A guided tutorial like this is filling an important hole in the Emacs documentation I feel. Also, I love the Brandon Sanderson quote. Absolutely excellent epic fantasy.
- taeric 5y agoI've been happily reading the updates as they were released. Fell behind on the last one, actually. Very fun book that I think shines for showing some fun of using emacs. Highly recommended!
- zephyr9 5y agoBut did you write it in Emacs, using Texinfo? ;)
- marviio 5y agoI would bet it was written in orgmode.
- sokoloff 5y agoIntro of the book confirms: “It is written in Org-mode, first made by Carsten Dominik and then developed by many other people. Diego Zamboni wrote the Org exporter to convert Org-mode syntax to Markua, expected by Leanpub.”
- codetrotter 5y agoFor anyone else curious about Markua: https://leanpub.com/markua/read https://leanpub.com/markua/read
- kangaroopouch 5y agoGreat to see resources being created for Emacs. How does this compare to https://www.gnu.org/software/emacs/manual/html_node/elisp/index.html https://www.gnu.org/software/emacs/manual/html_node/elisp/in... ? That's a great manual and available in Info format (popular amongst Emacs users).
- kangaroopouch 5y agoAh it sits between the intro ( https://www.gnu.org/software/emacs/manual/html_mono/eintr.html https://www.gnu.org/software/emacs/manual/html_mono/eintr.ht... ) and the reference manual.
- deworms 5y agoElisp is a really poor language compared to almost anything else, more work should be done to allow Emacs to be configured in other languages.
- nonameisfinetoo 5y agoDude, I think you might have a problem
- shidima 5y agoMaybe if you would elaborate on why you think that, you would not be down voted so much. Having said that, if you don't like it maybe you should find an editor that suits you more?
- Koshkin 5y agoTo be fair, the parent is not talking about the editor but rather its configuration language. Indeed, there have been attempts to replace elisp with other languages, such as Scheme (guile) and Common Lisp.
- mindcrime 5y agoThere is apparently a Guile enabled version of Emacs available. https://www.emacswiki.org/emacs/GuileEmacs https://www.emacswiki.org/emacs/GuileEmacs https://www.emacswiki.org/emacs/GuileEmacsBuild https://www.emacswiki.org/emacs/GuileEmacsBuild
- NeutralForest 5y agoEmacs and Elisp are too intertwined at this point. This interview https://www.youtube.com/watch?v=LKegZI9vWUU https://www.youtube.com/watch?v=LKegZI9vWUU of the creator of Doom Emacs talks about this exact problem.
- klibertp 5y ago> Elisp is a really poor language compared to almost anything else What makes Elisp a "poor language" in your opinion? Elisp is actually a really good language. Especially compared to other languages used for scripting, like Lua or JS. In some areas Elisp is significantly more advanced than either: pattern matching (pcase, dash), object orientation (multimethods, multiple inheritance), iteration (loop), data types (Lua has 3, JS a bit more, while Elisp gives you lists (pairs, proplists, assoc lists, trees), vectors, maps, unicode strings with optional metadata, queues, rings, and more. While the lack of reader macros is unfortunate, the macro system along with hooks and advice allow for writing libraries that integrate seamlessly into the environment, and ones that cleanly hide a lot of complexity (ie. use-package). Additionally, Elisp performance is not very bad (though of course worse than JITed languages) and it got AOT native compiler recently, which should help improve upon it. Namespaces are the only lacking feature at this point. I mean, there are lots of places where Elisp could and should be improved, but it's in quite good shape already. Definitely not "really poor", especially compared to the other scripting languages.
- okletsb 5y agoYour website is not responsive
- saint_angels 5y agoas author calls it "intermediate-level book", what would be a more suitable resource for an elisp beginner?
- gauchojs 5y agoI'm on mobile but check the sample, the author mentions an introductory resource.
- phyrex 5y agohttps://www.gnu.org/software/emacs/manual/html_node/eintr/index.html https://www.gnu.org/software/emacs/manual/html_node/eintr/in...
- saint_angels 5y agothanks! I thought whole gnu manual is a dry reference, but linked intro looks exactly what I was looking for! https://www.gnu.org/software/emacs/manual/html_node/eintr/Who-You-Are.html https://www.gnu.org/software/emacs/manual/html_node/eintr/Wh...
- praptak 5y ago"Emergency Elisp" by Steve Yegge.
- truly 5y agoCongratulations! As a curiosity, how did you set the page width? I find it a bit wide, making it difficult to read.
- bloopernova 5y agoSokolof's comment elsewhere in this thread: Intro of the book confirms: “It is written in Org-mode, first made by Carsten Dominik and then developed by many other people. Diego Zamboni wrote the Org exporter to convert Org-mode syntax to Markua, expected by Leanpub.” So the page width probably was set by Leanpub themselves during typesetting. I am assuming that the Markua language is converted to LaTeX, with the page size/layout being set in that language.
- signa11 5y agoi have used "Writing GNU Emacs Extensions" available here: https://www.oreilly.com/library/view/writing-gnu-emacs/9781449395056/ https://www.oreilly.com/library/view/writing-gnu-emacs/97814... from a long time past for elisp programming. mentioning it here in the hope that it is is useful to others as well...
- rvdginste 5y agoSince 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.
- NeutralForest 5y agoCool, always glad to see more Emacs stuff out there.
- xrd 5y agoI enjoyed reading the O'Reilly "Writing Emacs Extensions" book years ago. I just never got into the mode of using Elisp on a daily basis and it's faded from memory. I'm excited about this book. And, I really wish there was a book that showed how a developer using a more modern language like JavaScript could use it to customize Emacs. This is why VSCode is winning, because it embraces modern languages in a really powerful way. When I install a new Emacs into a new debian machine, i still struggle to get package installation working. But I'm getting really worried about the direction Microsoft is taking with VSCode and wish I could be as productive in Emacs. Opening up that environment to modern developers who could tweak their own tools would be amazing and revolutionary.
- grogenaut 5y agoTry neovim to see what this approach might look like, yes it's vi not emacs, but they allow python and rust plugins and have a plugin framework now. It's killed sublime for me. And I used to use emacs over vi. Personally I'd like emacs a lot more if it's plugins system just worked like vscodes does and as you said let me use languages I'm familiar with.
- fayten 5y agoUnfortunately it looks like it's a dead project, but https://github.com/kiwanami/emacs-epc https://github.com/kiwanami/emacs-epc builds out an RPC framework for emacs. This would theoretically allow you to use any language you want. The repo shows node.js, python, and ruby integration.
- PaulDavisThe1st 5y ago> This is why VSCode is winning, because it embraces modern languages in a really powerful way. This notion that Javascript is superior to (e.g. elisp) because JS is new and elisp is "old" is really irritating. The reasons JS exists has absolutely zero to do with any issues with elisp or lisp or C or haskell or any other programming language. The fact that you know it and do not know elisp is a real thing, but it says nothing about the qualities and properties of either language.
- Abhinav2000 5y agoEh is the book GPL though :-/ Can somebody confirm
- 8589934591 5y agoAny chance you offer regional pricing?