Episode: 3892 Title: HPR3892: Emacs package curation, part 1 Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr3892/hpr3892.mp3 Transcribed: 2025-10-25 07:32:40 --- This is Hacker Public Radio Episode 3892 for Tuesday 4 July 2023. Today's show is entitled Immax Package Curation Part 1. It is hosted by DNT and is about 36 minutes long. It carries a clean flag. The summary is, let's go through every single package installed in my Immax configuration. Hello and welcome to another exciting episode of Hacker Public Radio. This is your host DNT. It has been a while since my last one but I am back and today I would like to talk to you about some Emax Packages. To paraphrase class 2 I am going to say, let's go through every single package installed in my Immax configuration. So I have been using Emax for maybe 6 years or so and probably most of what I use is just org mode to organize some of the stuff I do to think about it and write about all kinds of things. I used to use one of those so-called Emax distributions which is kind of like a pre-configured distribution of Emax that you can kind of further configure yourself but that somebody else took care to set up a lot of things and that's really handy because often when you first download Emax the thing is so minimal that you can struggle to figure out what to do. That's not really true, that's a bit of an exaggeration I think but that's what a lot of people feel like when they first open Emax after downloading it and I certainly remember having that experience and then there are some distributions of which the most popular ones are called Doom and Space Max that kind of ease that experience and make it feel more like a more feature full text editor like the other ones we may be used to. That's a really handy thing to use. Those distributions it's an excellent way to use Emax but a lot of people will eventually move to having their own configuration which tends to be simpler and only limited to what you actually use because these Emax distributions there, you would have to be a developer who can understand, I don't know, tens of languages to actually be able to use all of that. Essentially it's trying to serve a lot of different people and you can actually make an Emax configuration that's just meant to serve you. What's interesting too is that the people that make these distributions like Space Max and Doom, they also do in addition to providing the distribution which is very fancy in itself. They also do a significant service in curating the packages that are out there and this is a little like, Emax is a little like Lattec, the type setting system otherwise known as latex where there's like thousands and thousands of libraries and packages created by others, not created by those who make the system itself and without using those packages you're really pretty limited. It's kind of like the actual experience of using Emax in my opinion involves using packages that people have written that make Emax what it is to most people. In building my own configuration eventually I did go through a lot of the modules that I used in Doom before doing this and I actually looked into what all those packages were, what they do and then I picked the ones I actually want to use. Of course I did this over a long time, I started making this my own configuration a while ago and I would just basically test it. I wouldn't really use it, I still used Doom for my everyday work but then eventually as tends to happen then you get to a point where the thing is usable and then you can start using it and then you speed up improving it until it gets to a stable point so that's where I'm at now. Anyway, I made a configuration that's made up of three files and the purpose of it is that I will load the first file and then the other two files will load conditionally depending on my environment and the purpose there is so that I can have the same configuration on my Linux laptop, on my Windows computer that I use for work and also on Termux on Android which I don't use very much there but anyway I figured I would do that anyway. So basically Termux will load only the first file then on Windows it will load the first and the second file and on Linux it will load all three files so that allows me to have a configuration that works on all three and I don't have to make changes to the configuration I can basically, I can push a change to it on my Linux laptop and then I can pull it later on, Windows and it will still work there as well. And then the other thing that I think maybe a good reason to use your own configuration is that it's a lot easier to make it light enough to work well on different systems especially Windows because Emacs on Windows is pretty tricky. It gets slow very fast so all these distributions I think are nearly unusable on Windows but my configuration is perfectly usable on Windows it worked very well for me. Starting with the first file. We start out with this Bootstrap boilerplate stuff that's supposed to pull in a package that's called Strait and Strait is one of the package managers that exist for Emacs so Strait is going to install the other packages that I'm going to use. So we install Strait then using Strait we install another package manager of sorts that's called Use Package that's a very popular one. It's so popular that you will often have packaged developers will have use package snippet for installing and configuring their package. It's very common to see that. Then the rest, pretty much the rest of my configuration is just a series of Use Package incantations, let's say. Then we start off with a package that's called Diminish. It's a very simple one. So Emacs is mainly made up of major modes and minor modes. So major modes are generally associated with the type of file you're opening. So for example, there could be a major mode for viewing your emails and there could be a major mode for editing Python files or org mode is a major mode. For example, for editing org files. So the major mode will make a bunch of key bindings and things syntax highlighting and all that kind of thing available to you when you are in this mode. And obviously you will want to enter this mode automatically when you open a file in which would be appropriate to have this mode turned on. And then minor modes are modes that you can have multiple of them activated at the same time. So minor modes are like more minor tweaks to your experience of using Emacs. Whereas a major mode, you can only be in one major mode at a time, right? So minor modes, they can do things like check your syntax or spelling and highlight words to like underlying a misspelled word, for example, let's say they can also, I don't know, do things like restrict the width of your text block on your screen or that kind of thing. So well, anything else you can imagine, probably. So when you have a minor mode activated, the name of this minor mode in this kind of a shorthand form will appear in your mode line. The mode line is this line at the bottom of your screen in Emacs. So the minor modes will all appear there. But there are some modes that you basically have them on all the time so you don't really care to see them there all the time. So the package diminish helps you hide these minor mode flags based on the mode, right? So it integrates with use package so that when I make my use package incantations to pull in all my packages, I have an option that says diminish and then I can, if I just turn on that option, then this minor mode that's associated with the package or a minor mode that I can name explicitly will be diminished, which means it will not be reported in my mode line. Okay. Next we have evil evil is the Emacs via layer. It's for, there's a saying that goes Emacs is like the only thing, something like the only thing that Emacs is missing is a good text editor. So evil is a package that fixes that by making it work like a modal editor in the sense of a VIM or a VI. So yeah, it basically just implements the modes, the editing modes, like insert mode and normal mode, visual mode and so on. And it implements all of your key bindings just like in VIM. So if you're used to VIM, you can use VIM in Emacs and then it's going to be pretty good. Not that I really think that Emacs keep bindings and that whole thing is necessarily terrible, but in my opinion it's like the VIM way of editing a text file where you have these modes you switch between, you enter insert mode and then you exit it and so on. It's objectively better in my opinion. Because it's like a transient mode, you don't have to keep holding down a key to remain in this mode that you generally are going to stay in for a bit when you enter it, right? So I guess when you leave it, it's kind of more temporary, but that's the risk that happens with Emacs modes and that kind of mode is accidentally editing your text, right? And that's what VIM editing helps with, you don't, you're less likely to edit your text accidentally. So in the use package and plantation here, we can create some configurations like binding keys and setting other variables to configure the behavior of this package. So that's what the use package package does. It just helps you kind of have a very tidy looking configuration. You just make this one self-contained declaration, use package, evil and then all your configuration and all your bindings so that if you stop using evil, all of a sudden you could just delete that entire block and you wouldn't have to do anything else. So moving on, we have evil collection and that's a whole bunch of kind of other bindings and integrations with other packages. Just like sometimes you install evil collection and then you start using not much for your email in Emacs, for example, and then you don't even realize that the evil bindings for the not much mode actually come from the evil collection package. You would have to go in and read the package, the evil collection package files to even realize that that's the case. Then I have a package that's called evil surround and I think there is a corresponding VIM package that's surround so this provides those commands where you can select some text and then press a key and then press another key and you will surround the text with something. So like I can select a word, press the S key and then the parenthesis key and it will surround my word in parenthesis, right, the opening and the closing parenthesis. Next we have company, company is an in buffer completion package. In buffer completion means you're in the buffer, you're editing your text file or whatever and you can start typing something and this package will provide completion, it'll show you or show you options by while you're trying to type that in the buffer, right, when you're editing your actual file and then we have company box that's a connect with company and company box is it just shows kind of like a fancier completion and I think it's this package that provides a pretty nice thing where if I'm editing an elisp file for example, which is the type of file that a max is configured with, I can start typing the name of a function and then it will show me the completion options and I can press up and down to view each one and it will actually show me the documentation of the function in another kind of tooltip thing. So that is pretty cool to be able to see all that so quickly. But there are other ways to do it if you prefer, if you prefer a more quiet experience. So all right, next is the package called which key and which key is another essential one where you as you start typing keys to activate commands which key will show you what are the options you have now and what they will do. So for example, in EMAX there are two very important keys that are control X and control C. So control X is basically about the application, options about the application will be behind the control X binding and option about modes, especially major modes will be behind control C. So then I might press control C and then after about like half a second or something which key will show me on the bottom of my screen, it will kind of expand the area where the mode line is and show me all the different options that I can press next and what they will do. For example, it might show me, let's see, control C, then I'm seeing exclamation point as a prefix. So if I press that it means I'm going to go to another set of options and if I press alt P, I will open the perspective map which is to do with another package that we'll see later on that's kind of like workspaces and if I press G, I activate right good mode which is another package we'll see later on. So this means if I press G now, I will turn on right good mode. So the full command I ran was control C and then G. Anyway, so that's what which key does. Next we have Anzoo ANZU. No idea if that's the right way to say that but the Anzoo, I believe it gives you feedback about your search queries when you're when you're doing a search in your buffer. It shows you everywhere the term occurs as you are typing it. I've never really tested disabling this package to see what it will do, what this will look like without that so I don't know I could be slightly wrong about what this package does but anyway I have it installed that's yeah that might happen. Next we have Vertico. Vertico is I guess they call it vertical completion and this is completion in the mini buffer. The mini buffer is the area at the very bottom of your screen under the mode line where you enter commands and things like that where you see commands at times for example if you run something that requires decrypting something using your GPG key the mini buffer might be where you type your your GPG key pass phrase for example. Vertico is one of the nice things about it is in comparison to other mini buffer completions I guess if that makes sense is that others you have to rebind a lot of keys for things to go through the completion and it seems like Vertico somehow does it on its own so if you have Vertico installed and then so for example if you're going to search files you're going to search a file to open right normally you would type in at the bottom of your screen in the mini buffer and I think by default there is some completion but it's like horizontal so the different completion options appear side by side only on the bottom line of your screen and then with one of these vertical completion packages it shows as a list right vertically and a lot of these other packages you have to remap the key that the command to open files which is control x control f you have to remap that to a different command that would be called I don't know maybe like council find file for the council completion package and with Vertico you don't have to do that I don't know why it is I haven't looked at the code but anyway so I copied a bunch of I guess boilerplate from the Vertico GitHub they have a few other commands that they suggest you use in your configuration and within a use package declaration for emax itself I don't know you could do that and I to be honest I haven't really looked through this to understand very well what it does I just copied and paced it sorry about that but it's pretty short I don't think it's doing anything very revolutionary and so next we have the package orderless orderless is a pretty cool package it's anytime you're using the vertical completion it allows you to type terms not in the same order as they appear in your match so let's say if you have a file called fubar in your home directory and you want to open it you can press control x control f and then you could type bar space foo and the Vertico would still find the file for you it would still show you as a match even though you typed bar and then foo but the family was foo bar next we have marginalia that's a very nice one too marginalia is in vertical as well it will show you a bunch of information alongside the match it's showing you so for example when you can when you put press alt x which is the command to just it's to run an emax command not by a key binding but by just typing out the command so this is similar to pressing the colon key on vim you you can type your commands there this is using Vertico to show me all the options I have to choose from and then it actually tells me to the right of it it actually says what the command does this is taken from the the functions from the commands doc string right that short little string that explains what the what the command does so marginalia is to be thanked for that that's the package that makes that happen so it does that for all kinds of different things as well like it will show you some of the permissions information when you're looking at files it's pretty clever so all right moving on this is all I think this is all coming mostly from the the vertical snippet they kind of suggest you use a bunch of other packages alongside it as you can see all these packages integrate pretty closely with vertical and they provide all the use package declarations for you so you can just copy and paste all this if you want so the next one is called consult and this is about searching for text it has a bunch of new commands related to searching for text in your in your files in your buffer et cetera okay the next one is called perspective and that's kind of like workspaces so you know let's say I'm working here I have my my main org file and then I call up my agenda then I'll see the agenda on the right side of the this the window will be split and on the right I'll see the agenda on the left I'll see my main org file and then let's say all of a sudden I want to quickly open this other file but I want to be able to come back quickly to this arrangement I have here that's what perspective is for you just create a new perspective give it a name then do whatever you want to do then you can switch back to the old perspective and it's right there just like you left it all right then next we have doom themes doom themes is provided by doom emax the emax distribution it's all of their themes so this affects all the colors and including the syntax highlighting et cetera um so I like those they're they're pretty good so I use the default one from doom that's called doom one so I just call in this package dome themes and then I load the doom one theme next we have power line power line is um is a mode line theme so the mode line is that bottom of the screen there um power line is uh you know it defines what will appear in the mode line exactly so it adds a bunch of different things it shows like the VM uh the mode that I'm on it shows what branch uh I'm on if um if the file is uh get is under get um and it shows the name of the perspective I'm on and all that kind of thing then next um so uh next I have airline themes so airline themes is a different theme for power line so there's uh this is exactly like the the vim airline package that exists for vim that some of you may know so it just changes the look of your mode line I like the way it looks uh next we have solar mode solar mode um all it does is whenever you create um a buffer that is not showing you a file that buffer will be darker than the the regular buffers so uh let's say I again that example where I'm looking at my main org file where all my to-do's are listed and uh project notes or whatever it is um or things that have come to my attention they're all in there and I open the uh my agenda the agenda is one of these kind of fake buffers let's say so that'll be shown on the right and then the background will be darker than my regular buffer it's kind of nice to have that distinction between these sort of transient buffers in your actual editing buffers so I like that next we have yes snippet why a snippet it is yet another snippet management package it's a very popular one I think pretty much everybody uses this one um and you know you have uh snippets you can make keep them in a directory and then you can quickly paste them into your file nothing much to say here not much of mystery there next we have projectile um that's to do with project management I to be honest I don't use it a whole lot I mainly just use it for the projectile rip grab command which is it just runs a search in all the files that are in the same um uh get checkout that I'm in so yeah I'm you know you're in a repository and you want to quickly search through everything you can use the this projectile grab command it does a whole bunch of other stuff I'm sure but I don't use much of it and next we have rgrgs just to use rip grab within emax that's all it does rip grab is like a pretty nice grab command that'll basically grab all the files in the directory you're in so it's like grab from multiple files I guess then we go on to org so org is org mode it is that um sort of project management document um document uh writing package and syntax format whatever you want it's that one that you should never decide you're gonna stop using it because you're just gonna come back to it later so um it is that thing that's um humanity has been trying to reinvent ever since it first came into existence and it has so far failed so like I was just saying if you use org and you start thinking about stopping and switching to something else just don't because you're just gonna come back to it and if you don't use org you know hopefully you will soon um we could spend hours and hours talking about this so let's not moving on org up here is a package that when you're editing your org file um there are some things that by default the um org mode the major mode will hide from you and it'll to make it look more readable right and there's a command that's called visible mode that makes everything show all the actual plain text will actually be displayed in buffer so a lot of times you want to do that you want to turn on visible mode quickly to make a very targeted edit let's say so this org up here makes it so when you enter insert mode in a line just that line will have visible mode activated uh and next we have evil org which is just key bindings for um uh vim um vim-like key bindings for org mode then moving on we have some kind of general settings here we um i guess i'll call out just uh you know i hide the scroll bar i hide the menu bar and the toolbar so there are no window decorations at all um i set up where my custom file is gonna be which is uh this file that it's gonna store some um information some some kind of transient configuration information let's say i'll i'll make it i'll say that so yeah yeah you're supposed to tell it where uh you want it to be otherwise it's just gonna put it at the bottom of my um configuration file but i don't want that because then it's gonna keep showing up and get um as changes right and then i have a conditional commands here when i have a window system running i already touched on those the scroll bar menu bar and toolbar so i'm turning those off when there's a window system on because if there's not the commands are just gonna fail and uh then i have display time display battery mode the the display those two things in my mode line here because otherwise don't have any kind of taskbar or anything next we have server start and what that allows is for you to um quickly and i'm in kind of an easier way just um open a new buffer in this emax instance instead of uh opening a new instance right i guess that's kind of a decent way to explain that anyway so then i have the conditional logic here for loading the other two files so if i am um if there's a window system i'm gonna load the next file that i call init base and then if my window system is from Microsoft then i will load i mean unless it is from Microsoft excuse me then i will load the next one which is init extra so basically the only case where there's not gonna be a window system is gonna be termux or if i happen to open emax in the terminal before starting x um in the console excuse me or um if i'm on termux on my phone so that will load only this stuff which is basically just the the basics for me to look at or and even more than that honestly but i don't know it's fine and then if there is a window system we will load the next file which is init base which has a few more things that i use both at work and on my Linux laptop and um finally if uh if we are not on that Microsoft display server then we'll load the last file so that file will only be loaded when i open emax on my Linux laptop and finally we have the line that says provide init provide init it's uh it just tells emax that uh this is what we're gonna call the stuff that this file is providing we're gonna call it init in this case it doesn't do anything um i will come back later with another one where i'll go through the packages in init base in init extra so my hope is that you know maybe you'll learn about a couple packages here and there uh that maybe you didn't know about um if you use emax and maybe you'll try them out um otherwise um hopefully this will lead you to try out space max or doom or even my configuration here which all make available in the notes okay i thank you for tuning in now if you have time you can do like i'm doing here and uh after work you just get in front of your computer pick up your phone and start talking into it just go on and on about uh you know this stuff that um maybe there'll be like two or three other people who will be interested in uh listening to it right um hopefully there are some emax fans out there that'll sit through three minutes of this all right anyway so i hope we will hear from you soon um just record your episode and send it into hacker public radio so you we can get to know you and listen to you thank you and come back tomorrow for another one buy you have been listening to hacker public radio at hacker public radio does work today's show was contributed by a hbr listener like yourself if you ever thought of recording podcast and click on our contribute link to find out how easy it really is hosting for hbr has been kindly provided by an honesthost.com the internet archive and rsings.net unless otherwise stated today's show is released on their creative commons attribution 4.0 international license