Category: emacs
Today's video gets us closer to our function header, um, function.
It'll take one more video to get there but today's video goes over the programmatic elisp that we'll need.
Before we get to that, a couple of elisp regex niceties. To be honest, I didn't know that these existed when I made the last video so thanks for those of you who made me aware.
First is the built in rx macro.
# COMMENTSOur next elisp project us going to write a function that will automatically generate function headers. This was actually the first useful elisp I ever wrote around thirty years ago. I forget how I wrote it then so this is a total rewrite.
Nowadays we have Javadoc for java and tools like Sphinx for other languages. If we write specially formatted comments in our code, these tools will pull out the comments and build a web site or document with hyperlinked documentation.
# COMMENTSTwo more videos to finish up the rot13 project.
The first video covers about prefix arguments. The idea is when calling an Emacs function interactively, you can specify a numeric argument either by typing C-u # where # is a single digit or M-x ## where ## is an integer which can be positive, negative, single or multiple digits. You then type the key for your command or invoke it with its full name M-x.
# COMMENTSRather than one long boring video, I thought it would be better to split up the remainder of the Rot13 project into 4 shorter boring ones :-).
Here are the first two.
Before we can really do anything interesting, we need to be able write programs that make decisions. For that we need conditionals or if statements. That's covered in the first video.
Like other languages, elisp has an if statement but it's more of an if function.
# COMMENTSIt's been a couple of weeks since my last post. Sorry - been repainting the apartment so I was limited to my laptop for a while.
Now that we've gone over a few basics we can explore new elisp features while building "useful" things. This video has us building code to implement ROT13. ROT13 is a particular instance of a Caesar or rotational cipher. In a Caesar Cipher, you take each letter and "rotate" it by a certain number of places.
# COMMENTSHere's another short video - this one on declaring functions in elisp.
Not much to say about it. It's similar to other languages.
In Python or C++ you might have:
# Python def add2(a, b): return a+b // C++ int add2(int a, int b){ return a+b; } Elisp is similar:
(defun add2 (a b) (+ a b)) But it's a little more "mathy." You've got the special form defun, then the name of the function, parameters in parens and then the body - all wrapped in parentheses.
# COMMENTSI was planning on writing this yesterday but caught up in watching "Paths of Glory."
The plan was to have each topic revolve around a "real" project but I realized that first we have to cover some basics. Specifically, variables and functions. I was going to cover them together but the video was getting a little long so we're doing variables here and writing functions next time.
Like other languages, Emacs uses variables to store values.
# COMMENTSHere's the first video in my learning elisp series.
Elisp is a lisp variant embedded within the Emacs editor. You could actually describe Emacs as an "elisp machine" in the same sense of the old lisp machines. It's not quite the same as the way most other editors have extension or plugin languages. Other than the core of Emacs, which is written in C, everything is elisp. Even when you type in a key.
# COMMENTSBefore I get to my elisp series, I thought I'd do a short video on elfeed-webkit. This was suggested to me by jcs. Even though I think elfed-webkit is great - a mini-gamechanger for me, I thought that there wasn't enough for a video. Then I realized that in order to run elfeed-webkit you need to have xwidgets enabled in your Emacs build. I thought I'd make a video on how I build Emacs and enable features like xwidgets and then I quickly set up elfeed-webkit.
# COMMENTSIt's been quite some time since my last Emacs video. The lack of content has been for two reasons. One was my overall feeling of burnout and the other was that most of my videos involved looking at new packages and I really wasn't playing with anything new.
Now that I've started my retirement the burnout is gone and I'm starting to think about what my next adventures will be.
# COMMENTS