Emacs Chat 26: Ross A. Baker
Posted: - Modified: | emacs, emacs-chat-podcast, emacs-chat: Added transcript.
I chatted with Ross Baker about Emacs (including running Emacs 28), his Emacs config, and life.
View in the Internet Archive, watch or comment on YouTube, read the transcript online, download the transcript, or e-mail me.
Related links:
- Blog
- Emacs config
- matthewbauer/bauer: An Emacs+Nix IDE · GitHub
- Ross A. Baker: Multilingualism in a Global Web (DE, ES)
Find more Emacs Chats or join the fun: https://sachachua.com/emacs-chat
Chapters
- 0:00 Opening
- 0:46 What Ross does
- 2:06 How Ross got into Emacs, used other editors, and then came back to Emacs
- 4:58 Config focusing on built-ins
- 10:12 simple-orderless
- 14:29 Size indicator
- 16:40 Graceful degradation
- 17:48 emacs-lock-mode
- 19:52 exiting Emacs: yes-or-no-p
- 20:46 yes-or-no-p
- 21:45 Processes
- 22:18 Moving keymaps
- 24:23 Writing in Org Mode and Markdown
- 27:49 Ethersync?
- 29:16 Managing Github with Forge
- 35:49 Committing with work addresses vs personal
- 37:13 Emacs tinkering as stress relief
- 41:06 Under-appreciated Emacs built-ins
- 42:20 gptel
- 46:04 Getting older
- 46:46 Lindy's Law and tool longevity
- 49:51 Nix is good at managing package versions and customizing them; Matthew Bauer (Bauer IDE)
- 53:25 Custom fonts
- 54:30 Starter kits versus configs
- 55:34 Nix vs Guix; Mac
- 56:26 Non-work interests: Org for documenting; ox-hugo and multiple languages
Transcript
Expand this to read the transcript
use-package out of the box. It added... I can't remember when project.el came along, but it added these things that started... You used to have to get them from outside, or you used to have these other libraries, and Emacs got a lot better out of the box. I started to say, okay, I'm going to do one more bankruptcy. I'm going to see what I can do with built-ins. I started experimenting down those lines, even though I was always using that extended config. I was challenging myself. How much can I get from a built-in config and then just have a little bit of extra for those gaps? Because there are gaps. I do love Emacs built-ins, but I am more comfortable with the regular one. But I challenge myself that way. This month, I got put on a project where I have to work in a sandbox environment. So it's not regular operating procedure, but I have to do all my work in the sandbox environment. There's no network egress. I have to say, okay, if I want packages in here, I have to talk to the admins of that system and say, I want these packages. I lobbied for Emacs on it. They thought, well, that's kind of weird, but it's just one more line of apt-get in the Docker container, so they're fine with it. It was an old version of Debian Bookworm. I was running Emacs 28. I'm like, okay, well, I've got this built-in configuration. This is its moment to shine. I tried to run it on there. I was able to copy the file up there. I tried running it on there, and I run into things I’ve been using setopt. I’ve been using one of the XDG packages for setting your X desktop group directories, so to have a standard place to put your config files versus your cache files versus your state files. In Emacs 28, they had most of those variables, but one of those variables didn't exist yet. So I felt a few paper cuts that way. Up near the top of my config, I've got a compatibility layer. The compatibility layer, there's a nice compat package out there. I can't remember. I think Omar, who you interviewed recently, I believe he's one of the people behind it. And tarsius, I think he's involved in that too. I could be misquoting on that. Maybe I'm misattributing that. But anyway, there's this wonderful compat package out there. If you're a package author and you want to have your Emacs package running on older versions, it's great for that. But the whole point of this is I don't have any external packages. So where I need this compatibility layer the most, I can't use this lovely compat package out of the box. So I had to reinvent a few shims. I think I could bring that up. Am I sharing my screen? Sacha: Yes, you're sharing your screen. That was one of the things that immediately struck me about your config. You're so hardcore about not using external packages that even your adapting to older versions, you're re-implementing things yourself in order to be able to stick with your constraints. I think that's hilarious, by the way. You started it off with it as a personal challenge because, of course, people are allowed to set arbitrary challenges for themselves, and then it turned out to be surprisingly useful for you in this limited environment. Ross: Yeah, that's one that really saved my bacon. Sacha: Yeah, this is great. So even things like setopt… Then you have keymap-set. You’ve got some replacements for these modern niceties to make it still work in Emacs 28. Ross: Yeah, I leaned into the new keybindings. There’s keymap-set, keymap-global-set, keymap-global-unset. Those are roughly the same as what you had in older Emacs versions but you don't need to pass the keyboard macro around all the things, so it's a little bit more concise. There were a few more advantages to it and I'd already been on Emacs 29 or Emacs 30 everywhere else. I'd already leaned into those, and then I got into this environment. But as you can see, they're fairly easy. This is not a 100% full fidelity. There's a few nuances that get missed in doing this, but for the most part, it works pretty well. I'm not aiming for perfect here. I'm aiming for "this works well enough at Emacs 28 for the life of this project, which should last about a month." And otherwise, I've got the nice full glory Emacs for my daily driver. It's straddling that divide fairly well. Sacha: I just looked up when Emacs 28 was released. This is 2022, so four years ago. Ross: Yes. Sacha: A lot of Emacs has changed since then. But of course, Emacs being Emacs, there's a lot of effort put into making sure the old stuff keeps working, which is handy for these cases. That's great.
Sacha: So you have a lot of these shims, and one of the things that you've ended up re-implementing along these ways is a version of orderless that works without having to take the entire orderless package in there. Can you tell us a little bit more about what you like about your setup? Ross: I wasn't happy with any of the built-in completion styles. Well, some of them are okay, but the overall... I had used orderless in my more extensive config. Orderless, for people who don't know, is a way of completing things. Let's see if I can show it off. So I can do... If I do "file" and "find"... Well, I thought it would work. Sacha: Do you need a space? Ross: Yeah, I don't know why the space wasn't completing. So I can do "file". "find file". I could do the space. I could do it in any order as well. Or I saw there was an "ido" in there. If I do it in reverse order, that's the idea of orderless is if I'm using the space, I got thrown off there. It was auto-completing a hyphen on me I didn't expect. Anyway, if I remember some tokens and things, let’s say I’m looking for ido-find-file, but I type "find" first and then I do... What orderless does is it takes the input and it splits it by space and it will find them in any order. It's a nicer completion style than I think any of the ones that come out of the box are. I got used to it. But if I'm in this lean config, orderless is something... It is not a built-in. That's something that I was leaving behind. That was one that was really starting to itch. Then I found this blog post by James Dyer where he'd implemented a very slimmed-down version of orderless. It wasn't the full features that you get, but it was something that was good enough that captured the basic principles of it. I took that. I found a few bugs in it, and I found a few more things. It was a very, very simple version of orderless, and I wanted a couple more bells and whistles. The completions weren't quite right to my tastes. I took that blog post. I ended up with a middle ground. It's not as good as the full orderless, and it's a little bit more extensive than the blog post that I found. But I'm able to run that, and I don't really miss the full features of orderless that much. There are all sorts of cool things that it does where you can say, okay, these are regexp tokens. These are literal tokens. These are NOT filters. You could do all sorts of combinatorial logic with it with various syntax. You can customize the syntax for it. It's all great, but I wasn't using those extended features of that package that much. I am happy with this lighter-weight version. That way I'm able to use it even when I'm off here in the security sandbox. I'm able to do it there too. It exposes the underlying tension of this setup. I would recommend 100% use orderless. It's better maintained. The maintainer is a lovely person. It's more full-featured. You can customize it. I ran into a little bit of a hiccup here and it's my own config. This is something, it's going to be more professionally maintained if you're using orderless. So if you're not adapting to my built-ins only method, I would 100% recommend using orderless instead. But because I have this constraint, I'm building this up. What I built up is kind of nice. It's one of the more interesting parts of my package, or of my config. I could spin it off as its own package, but if I spun it off as its own package, it's just a strictly worse version of orderless at that point, so what's the point? That's one of the tensions that you have in these built-ins, is anytime that you build something that is really interesting, you want to spin it off and share it, but at that point, you've defeated the purpose of being built-ins only. Sacha: I think the idea then of looking at the packages that you really like and if you find that you're only using a subset of their functionality, being able to strip it down or take advantage of somebody else's work and stripping it down to the subset that you use makes it a lot easier for you to put it all together in your batteries included, built-in only configuration. Ross: Right. Sacha: It's not super long. It can be understood if you go through the function. So that's great. Are there other things like that that you find yourself wanting to extract from other packages? C-g doesn’t just automatically make it... Oh, C-g works for me, so I don’t know. Ross: It usually works for me, too. I don't know why it's not triggering a bell here. Sacha: That's OK. Ross: Curse of the demo. Sacha: Yeah, yeah. Anyone interested can go look it up.
Sacha: Then you have a couple of other things around, for example, making it easier to not kill a buffer. I hadn't known about emacs-lock-mode either. Ross: Oh yes, Emacs lock. Yeah, so there’s this emacs-lock-mode and it is not the same. It's easy to confuse this with the lock files. You know those files that you get the hash signs, like you get ".#name-of-the-file#". That's something from when Emacs was used more on multi-user environments. Whenever you had a modified file, it would create these lock files, and it would prevent two users who were editing the same file on their own Emacs from stepping over each other. How often in modern times are we working on a multi-user system? If it is a multi-user system, are they both using Emacs on the same file? That's something that was very important in the late 90s and is not very important now. This is not those file locks. This is a buffer locking, and with the scratch buffer... I've got this turned on. Evaluate it. Make sure it worked. Let's go to our scratch buffer. Here's my scratch buffer. I don't want to accidentally kill it. If I try to kill it, it's going to say "Buffer *scratch* is locked and cannot be killed." I'll use this for notes all over the place. I've accidentally killed things too many times. The scratch buffer is not typically backed by a file, and I've lost too many things. This way, I know this scratch buffer is always going to be a persistent place. There are other approaches to it. I think there’s a persistent-scratch package that's out there. But again, that gets me out of the built-in zone. That might be a progressive enhancement, something that takes your scratch buffer and backs it with a file. That would probably be a good thing to do. So that's one of the packages I'll be looking at adding in the other config. But emacs-lock is built in. It's one of those things that's so obscure you can't even find it in the Emacs manual. It's just out there. I don't remember where I picked it up. I think just scanning somebody else's config I picked it up somewhere, but I couldn't find it in the manual at all. emacs-lock-mode for the Scratch doesn't kick in if you're closing Emacs as a whole? Ross: Correct. Sacha: If you're closing Emacs as a whole, it will happily still discard your Scratch buffer, but as Ross says, you could also not exit Emacs. Ross: Yeah, I've got the flippant line in here: ¨Exit Emacs? Surely there's been a terrible misunderstanding,¨ But I do configure the way that I do it. I want to make sure that the confirmation of it, it's the yes or no. yes-or-no-p to the y-or-n-p so that way, they only have to type the one character. Emacs is fairly thoughtful about which ones that it makes you do "yes" or "no" versus the "y" or "n". The things that are quick and inconsequential, those are the ones where it gives you the prompt that it's just a "y" or "n" answer. The ones that are going to be more destructive and you really want to stop and slow down and think about, that's what the yes-or-no-p is for. People stomp all over that in their configs, and I think that's one area where I'm a little bit out of the mainstream. I like the defaults on Emacs there. It is thoughtful about which ones it prompts you for that on. But if I remember right, confirm-kill-emacs was one that was just a "y" or "n". That's one of the more dramatic ones that's out there. So I did customize that to make sure, yes, I really mean that. crab-juice--moved-to. I'll bind my old key map as I'm trying to move things around. I used to use Spacemacs for a while. I used Doom Emacs for a while. I've looked at a lot of the other configs and I've said, okay, this architecture makes a little bit more sense. I want to rebind my prefixes that way, but still, for the ones that are deeply ingrained, it's sort of like a deprecation warning, except for key bindings. It looks like I used to run on C-c g. So if I try to do that, it's going to say, nope, moved to C-c v c. And now I can do that. C-c v c, and there’s my Magit command. Sacha: Yeah, I like that you actually ended up mapping the whole keyboard shortcut instead of just the C-c g one because, of course, your muscle memory is getting you to put in the whole C-c g and then something. This one lets you have the full keyboard shortcut before it tells you the message. Ross: This is using user error. So I thought when I hit that one, I thought I would flash my mode line, but the mode line is not flashing. I know it flashes on my other machine. It flashes on my work machine. It doesn't flash on this one. Sacha: The challenge is getting a config to work in many different environments. You've got your work machine, you've got this personal machine, and then you've got the sandbox one that's got a really old version of Emacs on it. Okay, so a couple of other things that you've mentioned.
Sacha: You've mentioned Forge. You have some things in here for cloning to different directories depending on the repository, committing with different addresses, confirming before merging pull requests. Can you tell us a little bit about these quality of life improvements for you? Ross: Let me see if I can come up with an example here, first of all. So this is Forge for people who have not seen it. Let's do... Sacha: So when you don't need something like real-time collaboration, for the people who are watching, Forge lets you manage your Git repositories with the pull requests and other changes and things like that, right? I don't use it yet, so... Yes. Ross: Yeah, so it's essentially a GitHub client. So I was looking... I'm here in my Forge test directory. I'm trying not to share any of my work repositories. I use this primarily at work. I just set it up on this machine last night. Still probably a couple of rough edges. I can list the topics. And if I list the topics, I can see I've got pull request 20 open. I can hit enter on it and I can see, okay, it's open. It's in state pending. This is where it's going. These are the commits. I can look at the commit and see, okay, what is this person doing? Oh, they're trying to add another line to this file. And if I say, okay, that looks good. I can do, what is it? I can look at this and I can say... This works better if it is in a full screen editor. Let's do... I thought I was tracking this repo already. I had this working last night. Curse of the demo again. Anyway, I'm able to approve pull requests from this. I'm able to... Reject pull requests. I'm able to comment on pull requests. I can look at the diffs. So all of my integration with GitHub is done through this. I'm in an environment right now, I'm a staff engineer. I participate on a lot of teams. I get over a thousand GitHub notifications a day. The GitHub notifications that are built into the browser are just not sufficient. That's something I was able to pull it in with Forge. I'm able to tag things. I'm able to mass mark the things. I get a lot of infrastructure things that they're important, but they're not important to me. I get notified on them all the time through the various automations. I'll get them. I'll get a hundred of those at a time and I can just mark a region of those and knock out a hundred and say, okay, that's off my plate. Moving it into Emacs, as awkward as this demo is, it works great on my work machine. I'm able to keep up with things so much better than I was before. Let's see. I should be able to, if I want to look a little bit deeper and see things in the GitHub, at least this works.
Ross: I can open it and see this directly. Then if I want to merge it from here, I can. Or I should be able to merge. Now I can do a regular merge or a squash merge or a rebase just the same as I have this button here. That's all built in here. Let's go ahead and merge this pull request. Sacha: All right. That little detail about you dealing with like a thousand notifications a day? It makes the guardrails that you added to Forge in your config even more interesting because you can stop yourself from accidentally automatically merging in things that need more review or whatever, which of course is difficult to demonstrate at the moment because work stuff, private. But if other people are listening and thinking, they're dealing with a similar volume, you can modify Emacs to stop you from making mistakes like that. You can add just enough friction for the cases where you need to pay more attention. And @PuercoPop, there's a gh-notify package specifically for high-volume GitHub notifications. I'm not sure... Have you come across that one yet? Ross: I'm curious what that looks. The term "notify" concerns me, like if it's helping me manage notifications in bulk, I'm interested. If it's going to pop up something every time I get a new notification, I'm very much disinterested. I don't know whether to be excited or horrified, but I'll take a look. Sacha: I think because @PuercoPop is recommending it specifically in the context of high-volume notifications, it might provide you that inboxing where you can filter. I haven't looked into it myself, but I'm getting the sense that this is a problem that many people who use Emacs face and who solve it a very Emacs-y way. Ross: Yes. Forge has all these nice things built into it already, but I wanted to customize the workflow a little bit. It's right here in the comments, the things that it does. It makes sure that it's mergeable, there's no merge conflicts, makes sure that all the status checks ran, makes sure that all the approval is done. One thing that the Forge does not do is it does not show you comments on your pull request. There's a code-review package that's out there. It's been through a lot of forks. I'm still integrating that into my workflow. I've got a fork of a fork of a fork that I have. This is life in Emacs, for better or for worse. I've got a fork of a fork of a fork of a fork so I can see those comments. I haven't fully integrated it with Forge yet. That's a work in progress. But anyway, I didn't want to be merging these things and ignoring if somebody's taking the time to give me feedback. I don't want to merge things because sometimes people will approve things, but they'll say, hey, just a little nit to pick. You got a typo here. Don't want to slow down progress, but you might want to take a look at this. If I'm just sitting here entirely inside of this, I'll never see that. So this also checks for unresolved threads. I've got some embedded GraphQL inside of here that makes it all work and we grab that data from the GraphQL and then I'm able to just do this inside a list and prompt on these things and if it finds there's anything that isn't right it gives me these safety checks along the way and yeah it's really nice. repeat-exit-timeout and your mode-line-bell-flash-time, you’re like, okay, might change it to track my senescence. I appreciate your sense of humor. Are you finding that there are things that you like to tweak about Emacs in anticipation of change as you get older? Ross: Well, my font size is definitely bigger than it used to be. I guess that's something that has changed over the years. I used to be able to operate on a tiny font, no longer on that.
Sacha: Oh, actually, on a different tangent, one of the things I was curious about is a lot of your configuration is set up to work well with Nix. Since a lot of people in Emacs are curious about reproducible configurations and systems, could you tell us more about Nix and your experience with it in Emacs? Ross: Yes, so I'm using that as some people use straight.el to pin their packages. Some people, they don't bother pinning their packages at all. I'm using Nix for people who are unfamiliar. Nix is... Boy, the elevator pitch for Nix. It's a package manager, but it's more than an Emacs package manager. It can manage all of your packages for you. So I'm building Emacs with Nix. I'm declaring all of my packages that way. Then that's specifying... I have a very repeatable build of Emacs and it has this version of these packages. One thing that Nix is very good at is it's very good at customizing certain things. So if you want to run a patched version of a particular package, you're able to specify, okay, I want this package, I want to use this package definition, but I want to overlay these files on top of it. Nix excels at that. I'm running a lot of customized versions of various packages, things that I've tried to submit upstream, and the Emacs package might be abandoned, or they might be a slow maintainer. I need to use it today, and they'll get around to it, and they'll merge it in a month. So on a temporary basis, I'll want to run a patched version. Nix makes that workflow very smooth for me where I'm able to run patched versions of certain packages, like I'm running a patched version of Forge like I showed off. Some of the things I want to contribute upstream, I've got those pulled out. I just need to sit down and actually submit them upstream. But I've got those ready to go and I'm able to run those out of the box. It's able to run... It's not just managing Emacs. That's the real magic of it. If I need certain binaries to support my Emacs config, I can declare those, and that all comes together and if I pull down Emacs packages, those are all going to be there together. There's a really fantastic example of this. Matthew Bauer has something out there. It's Bauer, I-D-E. B-A-U-E-R is his last name. He has one of the very inspiring configurations to me where he builds everything in Nix and he bundles all of his binaries that he needs in Nix and then he configures his Emacs variables to point, not at the git that happens to be on the file system, but to the git that he installs via Nix. So he knows that the entire thing is self-contained. That's something I've taken a lot of inspiration from. If I'm on a machine that has Nix, I'm able to run this. If I want to run my standalone config, I can run this command and I can run this command on any machine that I have Nix installed on. It will run very fast here. Should run very fast here. and this popped up and this is my base config and I could have run this on any machine or the my packages are named. It's an old Simpsons joke when Homer is stuck in New York. So that's the khlav kalash and crab juice. I think I've got a link to the YouTube video somewhere in my config. And there's the fully built in one. That's something I can get on a new machine. I install Nix. All of my dot files are there. If I want to just run Emacs or if somebody else wants to run my Emacs, anybody can take that config and run it. C-x 8 key binding. Autocomplete if you need an obscure Unicode character, and it'll autocomplete on all those. So, okay, I want nice little built-in there. Sacha: Yeah, on Linux, I've just been using setxkbmap to switch my layout temporarily, but I also like just being able to set the input method in Emacs in case I just want to write something quickly, then I can just C-\, I think. Okay, I've got about one minute before the kid does lunch break. Thank you so much for doing this. Was there anything that you wanted to pass on as a key tip that you'd like people to know from your experience with using Emacs? What's something we haven't mentioned that you'd like to share? Ross: I guess I didn't mention the things that I think are exciting outside. We talked about the built-in configs, so the things that I missed the most, I would say... Well, I guess look at my crab juice config. Those are the packages that I found that I absolutely cannot live without. Magit, a few language modes. You can get by on the built-in thing a lot better than you think, but there are a few things that are out there that are the really special ones, and I think that's the distilled essence of that. Just take a look at that package. Those are the ones that, yeah, I tried really hard on the built-ins and I failed. These are the ones I really need. I'd encourage people to take a look at that as well. Sacha: All right. For folks who are watching, you can find all of that stuff at rossabaker.com. Thank you so much. You've got links to your GitHub and Berg. Thanks to everyone on the stream for hanging out and for sharing your questions and comments. I almost forgot to mention [@ispringle] had a tip about putting emacs-lock-mode on a keyboard shortcut so you can toggle it if you wanted to. Nice idea. Again, thank you everyone. We're going to end the stream here. I will work on the transcripts and all that stuff. Thanks again Ross for doing this, and I'll see everyone around probably in September or October because I have to be on summer vacation.Chat
- Ray-On-Emacs: How do you exit Emacs, then? Or do you never exit Emacs?
- pratikmishra4073: i stealing that lock mode hack. i too have killed scratch buffer accidentally before.
- ispringle: `(global-set-key (kbd "C-c l") #'emacs-lock-mode)` is handy for one off locks too
- PuercoPop: There is a gh-notify package specifically for high volume GitHub notifications
- blaiseutube: I keep procrastinating my return to emacs 😔
- gr1maldi: Yo, and stuff. Sorry I'm late.
- Ray-On-Emacs: Getting older! Oh boy! more tell me, please
- dubstepandlovee: fantastic chat so far! as a local agent user, gptel-agent looks like an interesting project
- Trevoke: Hopefully without starting a philosophical war, why nix over guix?
- dubstepandlovee: why nix over lix
- dubstepandlovee: (joke)
- Trevoke: shakes fist in F/OSS Thanks for the answer
- blaiseutube: recovering linguist here. English Spanish and French for work. Japanese Portuguese, Sanskrit and Swedish for fun.
- blaiseutube: c-x h ? I love it
- sachactube: Maybe C-x 8 RET
- blaiseutube: oh! thank you
- Ray-On-Emacs: Thank you!




