Skip to main content

C'est la Z

Tag: elisp

Learning Elisp 17 - a thesaurus mode

When we last left our heroes we had made the API call to dictionaryapi.com, gotten the response and coverted the json string into elisp data. Specifically an array that contained a hash table. Today's video will take us the rest of the way to our thesaurus mode - run the function and we'll get a list of synonyms for the word we're currently at. First, we had to pull out the synonyms from the response.
# COMMENTS

Learning Elisp 16 - using a web API

Sorry for the long break. Once December started, I spent the first few weeks spending my coding time on Advent of Code, then just got sidetracked but now it's time to get going again. This is the last elisp topic I specifically wanted to cover so this and the next video mmight be the end of this series, we'll see. What are we doing today? Using a web API. Basically, if we want to use some external data source or facility a typical way to make that happen is through a web API.
# COMMENTS

Learning Elisp 15 - cleaning up our minor mode

Today we're finishing off our emoji project. This video covers two quick things. The first is how we can make the mode use either of our replacement methods - one that actually replaces the text with the emoji and the other that uses text properties to overlay the emoji without changing the text. This is done with a variable that we can set telling us which function to call. We used one named emoji-replace-by-insert.
# COMMENTS

Learning Elisp 14 - defining a minor mode

Another short one today. We're taking the code we already wrote and making a minor mode out of it. In Emacs, a minor mode is a set of functionality that you can turn on (or off) in a buffer (or globally). For example, the built in auto-fill-mode can be turned on in a buffer will automatically add newlines when your line gets "too long." You can see the modes that you currently have on using the describe-mode function, usually bound to C-h m.
# COMMENTS

Learning Elisp 13 - Text Properties

Today's a short 10 minute video as we continue to work on the emoji project. In the last episode we replaced text in the form :emoji-name: with the emoji. This time, we're doing it a little differently - we're going to overlay the text with the emoji. This way we see the emoji but the underlying text is still present. This is kind of like when programming in a language that supports lambda, in many editors you can type lambda but it appears as the symbol: λ (note that the previous symbol is not an emoji but was entered using the RFC1345 input method).
# COMMENTS

Learning Elisp 12 - Emoji Replace part 2

Here's the next part of our emoji project. In this video, we make the magic automatically happen. That is, when the user types an emoji in quotes - like 🐘, Emacs will automatically replace it with the emoji, 🐘. Now, mind you, the way we're doing it isn't the best way. In fact, after I posted the previous video, Micky Peterson linked to an article he wrote on using input methods to insert emoji.
# COMMENTS

Learning Elisp 11 - Emoji Replace Part 1

Back from my trip and ready to continue the elisp series. Today we're starting our emoji project. When we're done we'll have a minor mode where we can type in something like 🐘 in a buffer and Emacs will replace it with the elephant emoji 🐘. That's part one. We'll then learn how to overlay the emoji over the text so that while it will appear as the emoji (🐘) the actual text of 🐘 will still be in the buffer and file if you save it.
# COMMENTS

Learning Elisp 10 - elisp data structures

I'm leaving our next elisp project for when I get back from my vacation but realized I could make a short video with some preliminaries - some elisp tools that we'll need that we can get out of the way. Specifically, elisp's built in data structures. We've already used the list data structure and in this video we go a bit more in depth. Lists are great for, well, list processing but they're not great for random access.
# COMMENTS

Learning Elisp 9

In this video, we're finally putting everything together for the function-header project. for the most part, it's just putting a function wrapper (defun) around code we've already written but there area a few new things. In order to parse the parameter string we use a few interesting functions. The parameter string might look something like this "int a, double d, int something, char c" - type name pairs separate by a comma and space.
# COMMENTS

Learning Elisp 8

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.
# COMMENTS