3:38 how does a new person experience Emacs? Emacs is always fun.
4:07 Markov keyboard project, moving to Finland, right-handed Dvorak, split keyboard; Jeff Raskin; I am not a koala
6:45 Purpose-specific function keys
7:34 Trackballs, scroll
8:17 1" trackpad rings
8:58 Pair programming: ttyshare, shwim
13:20 Recurse Center, "What is that keyboard? What is that editor?!", Emacs bankruptcy and starter kits
16:09 hippie-expand
17:18 yasnippet
19:01 Function keys
20:05 Org Mode
21:17 Show Org agenda when idle
22:03 Programmers want flow. When programming, light turns red
24:27 ef-themes and modus-themes, season
25:58 htmlize (does this still work on Wayland?)
26:40 lsp-ui-imenu, jumping through rust code
28:30 laptop with 126GB of RAM
29:48 LSP coolness, Haskell, treesitter
32:02 Combobulate
32:52 What else are you using your 126 gigabytes of RAM for?
33:27 TalonVoice
34:46 NixOS, following Steve Purcell about 5 years behind
35:06 envrc
35:54 time-tracking
37:05 taxes with Org Mode, remote lookup
41:02 finding notes with C-s
42:38 Org Mode, managing inbox
46:30 Timestamps
49:14 Org timers
53:56 Org Mode snippets
57:16 Compilation finish function: handle success
Transcript
Transcript
0:00Intro
Sacha: Okay, so I'm going to actually remember to hit go live.I've got a 10 second delay, so if we need to panic, we can panic.Okay, so let's see.I think we are live.Hi, everyone.This is Emacs Chat number 22 after a long hiatus.And today, I'm here with Shae Erisson, who is also likean Emacs friend from a long time back.So this is it.As you were just saying, this is the first time we're actuallytalking live.And I'm looking forward to hearing about your configuration, how youuse Emacs, Shae.But before we dive into that, can you give us a little bit of context?Who you are, what sorts of things you do,and how you use Emacs for that?
0:571999, IRC, community building in Haskell
Shae: I would say that...I guess I started using Emacs in 1999 when I moved to Finland.And I remember about the same time I was on IRC and I was reallyfrustrated.I remember I got on the Perl IRC channel and I was like, hey, I wantan editor that has syntax highlighting.I want to see colors to these words when I'm typing them.And they were like, noob, and they kick-banned me.And I was like, well, maybe I don't want to learn Perl, which I neverdid.And I guess that was an early introduction into I wanted to be partof communities where people were sharing positive things and buildingup each other.Actually, I ended up starting the Haskell IRC channel a couple ofyears later, and that became a very big thing.I would say that I'm mostly known for my work in community buildingin the Haskell programming language community, because I did thatfor, I don't know, 15 or 20 years.But I really like Emacs.
1:58Emacs as a light-weight build-your-own-editor toolkit
Shae: So like last week at the same time I had the standing chat with afriend of mine who is also a programmer and he said oh so you'regoing to do this thing in a week do you want to give me like apreview of the talk and I was like yeah I guess so and some of thethings that were really interesting was he was like I've never reallytried Emacs I don't know much about it I kind of have this impressionthat it is a very lightweight build your own editor toolkit and II was kind of taken aback because, you know, I guess I still havethis long ago and far away.I don't know if you remember 8 Megs and Constantly Swapping is whatpeople used to call Emacs and things like that.And I was, it was just kind of, I realized I'm still in my littleecho chamber.And this is why I like to talk to other people all the time isbecause I want to have some exposure to what other people are doing.
Shae: I guess things about Emacs that really changed stuff for me islanguage server protocol, TreeSitter.Those, I think, are two very powerful tools that are much moregeneric than, I mean, Magit, of course, is like magic.Although I've mostly switched to jujitsu lately instead for the lastyear.Let's see, I had, I guess, let's see, I did C++, I did Python, I dida whole lot of Python.And then I had Haskell jobs for five or six years.And then I switched to Rust about a year and a half ago.I now have a Rust job.And one of the things that Prot had asked, I think, or you had asked,and I forget exactly how this went.
3:35how does a new person experience Emacs? Emacs is always fun.
Shae: It was great fun watching your livestream.And it was, how does a new personkind of get comfortable with using Emacs for a particular purpose.And I look for things, in fact, like how do I use Emacs for Rust,Rust development?And I found a couple of good guides on, and I was able to follow mostof them, although my Yesnitit stuff is broken and I don't exactlyknow why tab doesn't work, right?But, you know, like there's always, Emacs is always fun, right?There's so many cool things you could do with it.
4:03Markov keyboard project, moving to Finland, right-handed Dvorak, split keyboard; Jeff Raskin; I am not a koala
Shae: I noticed, I actually hadn't seen your preview page and I noticedthat you found my Markov keyboard.Sacha: When you say Emacs is fun, I'm reminded of all of your fun,crazy keyboard experiments.It's like, what?I have a feeling you like to tinker with things.Shae: Yeah, so I think actually the influences as to how I got towhere I am are pretty interesting.So the person that I ended up moving to Finland to for dating her, westarted a company, we did projects, and I was the programmer. We hadthis pretty big project. I guess it was like 350,000 euros.And I mean, that was going to be over four yearsand we had to kind of complete the whole thing,and I was the programmer and we'd had the lowest bid...I had an IBM model M, you know, the super clicky with like all the...And about three years into it, my arm started really hurting a lot.But I was the only programmer.And nobody else knew all the code.And we had to ship it, because that's how we got paid.And so I ended up pushing through.And at the end of it, my arm just didn't work anymore.So for about a year and three months, what I did was I actuallytaught myself to type right hand....Dvorak, because I was already using two-hand Dvorak,and so I kept programming, but I just...One of the things was... like, I like programming,I like using computers, I don't want to wear out my arms again,I don't want to blow them out,so I ended up switching to split keyboards,and I will show you.This is very much the kind of thing that I like to use,and that is like this.Shae: This is an Ergodox Infinity,but there's a lot of other keyboard flavors like this.And one of the things that I particularly like about this...So around the same time I met Jeff Raskin,who wrote the Inhumane Interface.And so for this particular thing, this is like Control and Alt andHyper and Super and Shift.And this means that under one thumb, I have a lot more modifier keysthan you get off of a standard.And it also means...A lot of my problems started with Emacs pinky,the dreaded, the infamous...I think that one of my... I made a keyboard layoutcalled "I am not koala." You may not know this,but koalas have two thumbs. They have one on each side.And that's cool, but I don't have two thumbs,and I realized that when I was trying to grab something,I didn't put my pinky on it. That would be silly, right?I want to put my thumb around it.And so I decided I would moveall of my chording keys under my thumbs.And that's kind of how I...
6:43Purpose-specific function keys
Shae: And another thing I did was when I wasreally only able to use one hand,was I made my function keys mostly purpose-specific.And that was from Jeff Raskin's writings in The Humane Interface.So I guess I'm a programmer who really likes writing code, doesn'twant to wear out my arms, and likes to do fun keyboard things, yeah.Sacha: Definitely. You're in it for the long term.You don't want to use up all of your arm capacity nowand not be able to keep programming in the future.And now there's hardware to make that easier.So I'm glad.Split keyboards with extra thumb keys seem to be very popular inthe Emacs community.I'm now tempted to find space in my desk in order to make that happen.
7:30Trackballs, scroll
Shae: Another thing I ended up switching to was I started usingtrackballs.Oh yeah, yeah.I tend to go completely overboard when trying out new things, so Ibought 20 different models of trackballs and ended up settling onthis one.The nice thing about this one is that this is how you scroll, and ithas four buttons.Sacha: That is really cool. I like using ThinkPads,so I've been just living off the tiny littlemouse in the middle of the keyboard.But back in the day, I also used a trackball.If I can get to the point where I want to take my hands off thekeyboard again in order to do mouse things, that would probably bethe direction I would go.
8:141" trackpad rings
Shae: I had an experiment in that area, which is where I purchaseda one-inch touchpad, and I strapped it to my finger.And it was a PS2, and it had a USB converter plugged into it.And the idea was I could keep typing, and then I could move the mousearound without taking my hands off the keyboard.And now they actually have touchpad rings.They came out six months or a year ago.It's relatively recent.But the idea is no change in context.Sacha: I've only seen the scroll rings,but now there's a touchpad version.That is interesting.Shae: Yeah, I think that's pretty cool stuff.Hardware is actually improving things.
8:54Pair programming: ttyshare, shwim
Shae: Oh, another thing, one of the things you talked about with Prot washow do you learn other people's stuff?And one of the things that I use for pairing, so I have one coworker,and it's a strange, interesting job.I like it a lot.And I met this coworker at a previous job, and one of the things,let's see if I can find it.So we used to, at the previous job,we used this thing called ttyshare.Have you heard of it?ttyshare.It's great.You can run it in a terminal and then you can effectively share yourterminal with someone else.And so you have multiplayer terminals and that's neat.It was kind of a pain to set up.You had to make sure that you weren't NATed,you know, like you had to have effectively...someone had to have a public IP.You had to do a couple of other things.And as part of my job, I'm now, I guess, part maintainer for MagicWormhole, the software.Shae: And so one of the things that my coworker wrote was this nifty thingcalled ShWiM.And it's basically "shell with me."And it's a wrapper around TTY share so that with one single command,you can share a terminal.And the way that we use this is...We both run Emacs as a server, and then we use emacsclient in theterminal to connect.Shae: I don't know if you've ever done this, but I can have a terminalright next to this, and if I run emacsclient in a window, then I'msharing the same thing.This is a graphical chat with Sacha,in the terminal or in the UI, and both of them are updated.Sacha: That's fantastic.I remember people were using tmate for something similar beforewhere you could share that.But yeah, it's just making it seamless, making it frictionless.And on the other side, I have also just beenusing wormhole to send large filesback and forth between Karthik and John Wiegley because we have thisother Emacs chat thing where we're going to post it eventually,once I finish figuring out how toredact all the personal information and Org files.But yeah, it's great for being able to send things without having toworry about, oh, you know, what's my public IP?Can I tunnel all the different things to get past whatever firewallsthere are?So if this also works for terminal things plus Emacs client, thatsounds really, really exciting.Shae: We've tried some other experiments.One of the things we tried to do was, and the only downside is like,what if my terminal has a different size, then you have to kind ofshrink and match.And so we tried to honestly directly bridge to Emacs clients.And because I don't know if you're aware that there's effectively alocal socket for the Emacs client that you can have multiple thingsconnect to.But it turns out there's some sort of like system so I couldn't likereach across the network and directly use my co-workers Emacs sessionand he couldn't use mine.Weird things happened when we tried to do this cross host.As far as I can tell the Emacs client only works in the same host.Sacha: That's interesting.Lately, I've also been experimenting with CRDT, which has thatEmacs-less plant as well.So that's been nice.But yeah, of course, a lot of people will be kind of stuck with thefirst challenge of finding someone that they can pair in Emacs with.Shae: I understand.And I think I'm honestly very happy that my one single coworker atthis job is also a big Emacs user.And so we exchanged cool ideas and worked on stuff.And I'm very happy about that.Sacha: Were they already an Emacs person before they joined?Or did you pick the coworker because they were an Emacs person?Shae: They picked me.They were pretty much the person who started this thing.And they picked me because they'd worked with me at the previous job.Although I did have an experience like that.I had this massive Emacs config file, like 20,000 lines, and half ofit was comments because it had accrued over 20 years.
13:13Recurse Center, "What is that keyboard? What is that editor?!", Emacs bankruptcy and starter kits
Shae: And in 2019, when I first went to the Recurse Center, well, my firstbatch, I just was extremely extroverted and social.But my second immediate following batch, which is not the commonpattern, I was like, okay, my goal is to write a bunch of Haskell,get some Haskell jobs,And so I went to the quiet room on the quiet floor.But then someone else came in, Marianne, my favorite programmingfriend.And she was like, what is that keyboard you're using?And I was like, ah, this is an Ergodox thing.And then she's like, what is this editor you're using?And I was like, oh, that's Emacs.And I was kind of a grumpy, like, I'm trying to get stuff done.But she was persistent.She was like, show me this thing.And so I was like, I'll show you Emacs.And she was like, this is great.And I was like.This thing?OK, cool.And I was like, I don't think you want my config.You'll probably want a starter kit.And she was like, well, what are starter kits?And I was like, well, I've heard about Spacemacs.I've heard about Doom.And I would try one of those.So she tried Spacemacs.And I guess this next part happened over several months.She tried Spacemacs.And then she was like, I like it, but it's slow.So I'm switching to Doom Emacs.And I would pair with her.And I was like, wow, look at all these cool things that the starterkits can do.I ended up flushing my entire 20-year-old config and kind of startingover and stealing a lot of great ideas from the starter kits.And Marianne is very ambitious, independent, hardworking, veryfocused.I'm not very focused.But I've learned a lot of things from her and watching her kind of...I haven't done C in Emacs in a long time so it's great fun to watchher learn these new things and then I learned stuff too and yeah it'sgood to have collaborative people to work with.Sacha: So it sounds like if people would like to encourage morepeople to talk to them about Emacs, feel free to use your strangekeyboards out in public.Shae: I like that.That's good.That is good.Yeah I think that's reasonable.Sacha: Yeah, and I've just recently started digging into thestarter kits too, because I realized I don't know much about them.It is really interesting going through them and discovering all theseEmacs 31 options that you can enable to simplify your config orimprove your workflow and all that stuff.So there's a lot of good stuff in starter kits, even for people whoare not newcomers.Shae: I agree.And I think there's nothing wrong with just learning a bunch of newthings, trying them out, and also throwing them away if you don'tlike them.Sacha: Now that you've declared Emacs bankruptcy and rebuilt yourEmacs on top of other people's starter kits, what has made it intoyour config?What have you kept from those 20 years of tinkering with Emacs thatyou really wanted to stick around?
16:06hippie-expand
Shae: I think the only thing that has absolutely stuck around is myuse of hippie-expand, which is, I believe, a very old...an ancient tool from a different time.Most of the other stuff is kind of gone.Gone to the wayside.But I really like, I honestly really like hippie-expand.And I know that like, I have rarely heard of other people who usehippie-expand.But you use it?I think you just muted yourself.Sacha: I also vote for hippie-expand.It's a nice way to try different functions and just say, I just wantall these different possible completions to go in there.Shae: Yeah.The thing for me that really sold me on hippie-expand is that most ofthe time when I am...When I'm doing something, I want to say, like, I can already see thatword, just pick that one.And so I'll type the first characters and hit, like, meta forwardslash, and ta-da, it's usually there.But then sometimes I do really want, like, some Elisp or some otherstuff.And so I actually spent a lot of time tuning this the first time.
17:14yasnippet
Shae: I actually only changed it for the first time recently because I wasreading a how to write Rust well inside Emacs and they said oh wellyou want to use yasnippet and so I you know the funny thing is thatyasnippet I believe is the thing that got me into Emacs like in 1999I met this Finnish person Erno Kuusela in Oulu, Finland.Really cool guy.I was like, wow, how do you do this?As soon as you open a file, it's got a substructure and a skeleton.And when you type part of a function or something,it just populates it.And he was like, I'm using this snippet command in Emacs.That's why I was like, what's Emacs?It was very exciting.And at the time, I was using Vim.And Vim was not as, I don't want to say, automatable.Sacha: Yeah, now with Neovim and Lua, people are writing moreextensions for it.But before, you had to know a lot of magic in order to customize Vim.Shae: Right, right.I agree.Let's see, what else do I do?I run my own email server, and I, of course, read my email in Emacs.In GNU, no less.Which is, I know, an NNTP reader, but it's still also a great...I used to use twiddle compile and I think that stopped working likesix years ago, so I need to get rid of this comment, but there'sstill a lot of kind of cruft from earlier times.
18:52Function keys
Shae: Remember how I said that I use function keys to have like purposespecific stuff?This was especially true because, I mean, I had my left arm strappedto my chest for like a year and three months before I even startedregaining any flexibility, and that meant that...I'm amazed that you could just map them directly to single commandsinstead of giving in to the temptation to make them prefixes forlonger keystrokes.I didn't really have the choice because I had only one arm thatworked. It was just a lot harder to do any chording at the time.I still have a lot of these.F3 I use a lot, which is like, oh, what am I working on right now?That is org-clock-goto.A lot of times, I want to have a terminalthat's in Emacs, so that's vterm,
20:02Org Mode
Shae: And I actually really do use the calendar all the time. This is likejust switch to whatever it is. Of course, my email is here. You knowwhat, let's see... So this... I don't know, have you seen thisbefore? Have you seen this thing called STARTED in an Org mode file?Sacha: I use a STARTED state, yes.Shae: Well, I got it from you!So if I look at like, my Org Mode configuration,a lot of this STARTED stuff I have from you,I don't know when,but you were the person who introduced me to it.Sacha: It's the reminder that I did start working on this.I tend to get distracted by intermediate tasks, so it's nice to beable to say, try to finish these ones first before you move on to thenext thing, maybe?Shae: I agree. I have the same thing, yeah.And I keep meaning, because this is...I know that you can put Org Mode configuration into the firstTODO item. I would really like to move it into the elispand I just haven't gotten around to it.And it's been 10 years. I mean,maybe I should just do it.
21:14Show Org agenda when idle
Shae: One of the things I did that I found fun...I really have written almost zero Elisp,but I did actually puzzle my way through this a year ago.Since so much of my life is in Org Mode, I learned how to make timers.This is very close to what you get directly out of how to do timersin Emacs.After some amount of time, I want my Org agenda to pop up because Iwant to say like, oh, what is the stuff I'm supposed to be doing?And what am I forgetting?What has been scheduled?And what is on my to-do list?And I also like to look atwhat is the stuff I've been working on lately?And I really like that a lot.
21:58Programmers want flow. When programming, light turns red
Shae: Another thing that I realized is that I had a blog postthat was wildly popular.Where did I put it?And it was all about Emacs.I don't know if you saw the... Here we go.It was... Ah, here it is.So here it is in... This is very much an Emacs...Sacha: Oh, yeah, I remember that one.I put it in Emacs News.I thought it was great.Shae: All right, cool.Sacha: I would like the kiddo to sometimes be able to acknowledge this,but this is not happening.Still, yes.Shae: Right, right.Yeah, and so this was really fun because, like...I had a friend who was in development and there was like millions ofdollars spent on how do you detect whether a programmer is in flowand it came down to if they're typing they're probably in flow so andthat was it because they tried to look at EGs and doing all kinds ofother stuff but it was like if they're typing don't interrupt them.And I don't know, because I do so much in Emacs, I'm not sure howaccurate this was. But basically,that's where I learned to do timers the first time.Or maybe... I don't remember which one I did first.And the idea then was as soon as basically my average typing intoEmacs has gone up a certain amount,then it will actually switch to busy.And it works just fine. It was a lot of fun to write.Sacha: So yeah, interesting use of getting the activity.I've seen other fun implementations of this.I think there's a c-c-c-combo package that makes some funanimation appear if you're typing really quickly.Shae: Oh, oh, yeah.I'm guessing because I think Atom, the Atom editor had that for awhile.I guess that's where it came from.Sacha: So yeah, because you can instrument Emacs and play aroundwith it, you can certainly do all sorts of things based on thatinformation.Okay, so you've got it, you've got it set up so that when you comeback to your computer, it'll show you the stuff that you've beenworking on.And when you're working on the things, you can tell it to tell therest of the world not to bug you.Gotcha.Shae: That's right.[Sacha: What other fun stuff do you have in there?
24:25ef-themes and modus-themes, season
Shae: I discovered that I love the EF themes.I love the Modus themes.They make me very happy.They're just unreasonably pleasant.As someone who has tried every single Emacs theme ever, they're justmy favorite themes.Shae: And so, at the moment, it'ssummer... Where did my summer go? How can this be? There we go.How come I'm in spring? Wait, isn't spring over?Hasn't summer just started?You know what I was thinking would be fun would be take the time ofday, and you know that the EF themes has spring, summer, autumn,and winter, and I'm not sure if there are dark versions of each ofthose, but I thought, like I know that Modus themes will do this likecheck for the local time of when it turns dark, and then itwill go from the light theme to the dark theme as soon as the sunhits, and I was like, well, what if I do that for seasons, you know,wouldn't that be cool?Sacha: There's this subtle sense of change as you go through the year.But of course you also have this thing therewhere you just randomize it.Shae: Well, I like that.Sometimes it's like I'm just kind of like, ah, I'm bored.I'm just bored of what I'm looking at.And so I will just change my thing.And it's just time for something.I don't know.It seems to work.It's like it gives me a little brain break from what I was staring at.And I did not know I was going to reset the effects scale, but that'sfine.Interesting.What else do I have in here?
25:56htmlize (does this still work on Wayland?)
Shae: Oh, Emacs HTMLize.I'm a little sad.I switched to Wayland.And if I remember correctly, HTMLize only works with, or maybeHTMLize still works, and it's the SVG one that doesn't work.Emacs SVG is a thing that if you're running with an X11 backend, youcan turn your current screen directly into an SVG, which is reallycute.It does not work in Wayland.I think HTMLize does still work.What other things do I have in here?I don't know.I guess a lot of it lately has been trying to make Rust things worksmoothly.I've been trying to do some... I wonder does... Oh, cool.That was not what I expected.
26:37lsp-ui-imenu, jumping through rust code
Shae: I just started doing this thing with imenu.imenu integrates nicely with LSP.Sacha: That is a very pretty sidebar thing, and I need to learn howto do that.Shae: So because I have all these extra modifiers, my s-i islsp-ui-imenu.And the reason that what I mostly use that for is when I have like abunch of Rust code and I want to quickly jump through the structureof it.Basically that integrates with LSP, finds all the definitions, and Ican quickly jump through it.I used to use lsp-treemacs for that, but lsp-treemacs puts things inits own order, not quite the same order I want, although treemacs isquite nice.I think that the thing to do is that you and I at some time maybe thenext time if we do this again we should set up with a Shwimconnection and you and I can both share our Emacs and then you canshow me cool things that you do and I can show you cool things that Ido and then we can start filing over some of the things.How about that?Sacha: That sounds fantastic.I know we'd wanted to experiment with pair programming a long timeago so that sounds like a seamless way to do it.And therefore I will go and figure out how to install shim and get itworking.I will probably need your help to actually test it.I don't know, I think I can rustle up.Maybe it'll work off my phone.You haven't tried that.But lspui, okay, so I've just been using straight up imenu, like onNeanderthal, but lsp-ui has this fancy grouping of things and colorsand stuff, so I definitely want to check that out.Shae: I'm a fan, yeah.I don't know.Do I have anything else exciting that goes with this in here?
28:25laptop with 126GB of RAM
Shae: I will say that at the moment, the system I'm working on, I likebuying unreasonably powerful laptops.And so, like, this system has 128 gigs of RAM and 24 cores.My previous laptop has 192 gigs of RAM.Long story short, I end up in a lot of cases where I want to use morememory.I've got all these cores.Can you do something with them?Perhaps you've already seen things like LSP doctor, which will say,have you tried this thing?Have you done this other thing?LSP has really changedSacha: I have not.Sorry, would you like to show me this LSP doctor thing?Because I have not ever seen it.Shae: Yeah.Do you use language servers much for your development?Sacha: I am only just getting used to having a relatively modern2018 instead of 2010 laptop.And so I have the red squigglies and various things, but I don't knowwhat to do with them yet.Shae: Well, I mean, I'm doing a lot of this.So I have...
29:46LSP coolness, Haskell, treesitter
Shae: Originally for me it was like I spent a lot of time with the Haskelllanguage server because I was doing so much Haskell and it was asuper powerful thing.In fact, somebody decided to hammer in half of a proof assistant intothe Haskell language server and that was magic.You could do incredible stuff with that because you could just graball of your local variables and transform the whole shape of yourfunction and you could just write little snippets and just have itwork.And that was amazing.It wasn't quite... One of the goals that I believe is...For future development of all programming editors, I believe thatsomething like Emacs macros, but instead for abstract syntax trees, Ibelieve this is an essential ingredient that we do not yet have.And I think that TreeSitter is the first step towards there.We now have one of the hats, right?Which is where we can take... TreeSitter is, you know, if you've usedit...It is like you write some effectively C code to produce a really fastparser.Or is it like JavaScript that then compiles to C code?I forget exactly how it works.But the nice thing about TreeSitter is, I don't know if you remember,I'm sure you do remember, that if you were writing Python code andyou used a triple-quoted string, you had to then add a comment withanother quote because regular expressions is how Emacs was doing allthe syntax highlighting.And honestly, that was kind of crap.And then there were projects like the Semantic Bovinator that made afull parsing suite in Elisp, which to me is half brilliant and halfinsane.And then there was TreeSitter, which kind of took over the worldbecause it was... I think that the language server and TreeSitter arethe first two of these editor generic pieces, and I suspect therewill be more.I think that something where you can modify the abstract syntax treeand then put back to the sourceis one of those potential paths forward.I hope so.Sacha: Yeah, that would be great if you could just do themanipulations and then roundtrip it back into source code.Just regenerate the changed part of your code.That sounds fantastic.So it sounds like you were able to do some kind of manipulation withthe Haskell use case that you were describing.Any chance you can show us like the awesomeness?Shae: Sadly,that sadly does not work anymore.
31:58Combobulate
Shae: But you know, if you're looking for something in that area, have youheard of a Emacs library called Combobulate?Sacha: I have heard of it.I haven't dug into it.Shae: So it uses TreeSitter for source code manipulation by, andit's a lot closer to the way that like, you know, in Org Mode, youcan like hold meta and arrow to kind of move things around.It uses TreeSitter to let you both move around in the context as wellas actually alter the shape.And to me, this is the first step towards this tool that I want,which is where I can write a keyboard macro and have it edit anabstract syntax tree and then spit the results back into the buffer.Yeah.Sacha: All right.
32:46What else are you using your 126 gigabytes of RAM for?
Sacha: What else are you using your 126 gigabytes of RAM for?Shae: Let's see.Honestly, I'm going to tell you that Rust Analyzer can take a lot ofmemory.And a Rust compilation can take a lot of cores.And I'm okay with that because I actually, I do like, and I will saythat this laptop is actually from this year.So it's a brand new, like, top of the line.But then like, how would I, because I've got like, which I think is abunch of matrix multiplication hardware.How do I use that from Emacs?I don't know. I'm sure I can find something, you know.
33:25TalonVoice
Sacha: Maybe voice computing?Shae: Oh, that's an idea. Yeah, one of my friends, she's using Talon.Have you heard of Talon?Sacha: Yeah, I've heard of Talon.There are a couple of videos about people using Talon to code byvoice, usually involving memorizing kind of a different alphabet forvery quickly accessing different shortcuts.But it sounds really cool, and you sound like you've got the hardwareto do something amazing with it.Shae: That's true.Well, you know, Talon actually lets you do something very similar toCombobulate, where you can navigate the AST of your source code.You can kind of move around very quickly.I don't know, like, are we like at the end of our?No, no, we're halfway through, right?Sacha: We're halfway through.I have about 28 minutes before the kiddo runs out and startsdemanding lunch.Shae: Okay, well, I feel like I've been driving the structure ofour just kind of like dumping random things.Did you have any questions or anything you wanted to cover?Sacha: This is all amazing.I come in with no preconceived notions.I'm just like, okay, shapr does cool things with Emacs.Let's hear about it.Let's go, let's go.Shae: That works for me.Yeah.I mean, a lot of it's been focused on Rust development lately.Rust and Jujutsu.
34:45NixOS, following Steve Purcell about 5 years behind
Shae: I've been doing a lot of Nix.I'm running NixOS.I don't know if you're familiar, but that's been great fun.It's funny, I feel like I've been following Steve Purcell around froma technical perspective.I'm always about five years behind Steve.
35:03envrc
Shae: I was like, oh, you know, NixOS is kind of a pain with Emacs.And just like this, what was it, NixOS?I forget.Anyway, Steve was like, oh, well, have you tried my library, envrc?And I was like, what's that?And he was like, well, now each buffer can have its own envrc.And I was like, it's perfect.That's exactly what I need.Because previously, every time I switched buffers, it would then goload all of the localeverything in Nix.And sometimes that could take a long time, especially if I'm doingHaskell, that could take 10 seconds, and I really don't want thatsort of lag.And so Steve Purcell's brilliant library, envrc, says, you know what?Every single buffer can just keep such a thing, and then you can onlyrelit it when you need to.And that's pretty awesome.Sacha: That sounds cool, and I should check that out too.
35:52time-tracking
Sacha: @JacksonScholberg has a question.He says, "I was curious about what you were tracking your time workingon, how you track it."Is it just Org Clock?So this is how you keep track of the things you're working on andwhat got interrupted by the new thing that you just added to thestack and so forth?Shae: Right.In fact, I have this thing.Honestly, when I sit down on my computer,Just clock in.You'll notice in the bottom right here, we have chat with Sacha,right?And so like, I just kind of clock in stuff.And like, I'm not always, I really kind of need to reorganize my Orgmode files because I've been naming them per host because Ipreviously had like a work Org mode and I had a home Org mode.now that my home hardware is also my work hardware I guess and solike I still have my previous laptops things where I'm keeping myevents I really need to reorganize things but I mean yeah I schedulethings I oh you know I've got a weird thing to show you
37:01taxes with Org Mode, remote lookup
Shae: I decided that it would be great fun to do my taxes.Sacha: You are showing me your taxes, do I need to like black outthis whole thing?Shae: Well, this is actually just an example from the docs.So I could actually share my taxes on it because I mostly don't care.But I think in fact you can figure out exactly how much money I'mmaking by looking at the open whatever.So the thing about this is that I decided to file all of my tax formsdirectly into Org Mode spreadsheets and then do remote lookups.So basically each spreadsheet was one particular form.And then once I'd gotten to the bottom, like I need this result, likewhat's my estimated income?And then I would use the lookup, kind of this cross spreadsheetlookup.And that's how I did my taxes for last year.And then my de facto mother-in-law, she's an accountant, and shedidn't exactly do this thing, but it was pretty close.She was like, you've got all your taxes in the spreadsheet.I was like, yeah.And then she looked at it and she was like, what is that?And I was like, anyway.So I got to kind of file everything back out into TurboTax, but thatwas a fun thing to build.Sacha: Yeah, I have something like that too.So for example, whenever I do my tax paperwork, I just have to havelike, you know, the step by step checklist.Okay, this is where I need to go to get this number.This is where I can put it in.And then eventually it spits out a table that says, okay, put this inbox 11, put this in box 13, so that I don't have to do the steps byhand.Because even before the, you know, for me, I use like simple stacksor whatever, it's web based.But before you get to the point where you can put the numbers in theform, you gotta go to this website, calculate this thing, and Orgjust makes all of that so much easier.Shae: I agree.Yeah.Sacha: And this remote lookup thing is something I'm always lookingup because Org tables are so powerful, but also I need more examplesin my life to remember how to use them.Shae: Well, I think it took me four hours the first time to get itall figured out.But I can send you an example without showing it here.I can send you an example because I figured out, I think I'vehammered the remote lookup down very thoroughly.Sacha: And once you've got it right, you can just keep filling thatin or copy and paste it.You have an example of the syntax and that's already all you need.Shae: Right.I did run across some limitations of theevaluation method of Org mode spreadsheets.But maybe I've been using them a little too hard,if that makes any sense.Sacha: Oh, what kind of limitation?Shae: Honestly, I think I finally found a way to say everysingle... Because it was...So really the way that spreadsheets work is they're much more likeDataflow.And that is just that you end up with, like, either you work from theendpoint, which is like much more Haskell style evaluation, which iswhere you're like, I need to start here.What depends on this?But in the case where you have a whole bunch of different Org Modespreadsheets, I think I ended up with this little text style hackwhere I just ran it a bunch of times.So it's like evaluate, evaluate, evaluate.Because remote lookupsI ran, you know, I don't remember.And I think I took notes, but I don't remember.That's one of the great things about Org Mode is that I swear it'smy, like, half of my brain is in my Org Mode notes.And whenever I had, I'm like, oh, what was that thing?I'm like, well, fortunately, with my terrible short-term memory, Itook copious notes because otherwise I would never be able to getback to it.
40:55finding notes with C-s
Sacha: What is your favorite way of finding those notes?Shae: I actually use a lot of C-s just because I kind of havesome idea of where they are in my tree structure and I'll also say Iuse a lot of my Org capture templates and they're not supercomplicated.I have like a to-do, I have a journal, I have ideas and like randomideas will float into my head like you saw Markov keyboard right itis like the weirdest art piece you've seen all day right andMarkup keyboard shows up on the front page of Hacker News once a yearor so.And people are like, programmers have gone too far.This cannot possibly be usable by humans or something.And I'm like, well, I don't know.I think it was art.And so a lot of times those things will drop into my head, somethinglike that, where I'm trying to do something else.And so I will quickly write down the idea and then just gotten it outof my head enough that I can continue with what I was doing.And so I have a long list of strange ideas.A recent one was like, you've probably had your teeth worked on onceor twice.And you know that the dentist always had to move the light around.And I'm like, but we have really good eye tracking.Wouldn't it make sense to figure out where the dentist or the carmechanic is what they're looking at?And then have the light move around behind them to figure out how toactually light up the place they're looking at, right?We've got vision tracking.Why don't we do this?But I don't really, yeah.I decided maybe I don't want to work on that one right now.Sacha: It sounds like an involved project.Yeah.Yeah, yeah, yeah.Okay, so you're capturing, you're stuffing a lot of these ideas intoan inbox.
42:35Org Mode, managing inbox
Sacha: A lot of people are probably in the same boat where they've got theseinboxes full of ideas.How do you deal?Shae: I archive stuff when I'm done with it.Sacha: Oh yeah?Shae: Yeah, so a lot of times, and I find this very valuable, islike if I look at... Do I have it?Oops, that was not what I meant to do.Sacha: Alright, so you basically just do aggressive speed commands,archive, archive, archive, or look at the agenda and just mark awhole bunch of things and say, that's it, that's gone.It was written down and then it can go.Shae: Yeah, well, when I'm really done with something, when thething is finished, then I will just archive it.I mean, do you use Archive much?Sacha: I do.I have a function that goes through my inbox file and just archivesanything that was marked as done.Shae: Oh, nice!Sacha: Because that way it clears it up, right?So I'll refile things where I'm like, okay, it's done, but it hasimportant information.I want to put it somewhere else.But if it's just a transitory task that I'm using to remind myself,tomorrow I have to do this, go find the water bottle when it's done,I don't need to know about it in the future.So it's left in my inbox because I checked it off, and thenperiodically I'll say, clean up inbox.Not only will it remove all of the done things, but if I leave a tagIn the title of the task or if the task matches certain regularexpressions, it will refile it to the appropriate place in my kind ofmore permanent thing.So I can say, okay, all of my Emacs related tasks will getautomatically refiled to my Emacs category without my having to dothat manually.Shae: So you're using tagging because I kept trying to do taggingand never quite did it.Sacha: I use tagging sometimes when I remember it, but this is alsowhy I use theThe regular expression match against the title.I'm using Orgzly on Android to capture the thing on my phone.I might want to say this is a consulting task.File it in the right place so it doesn't get lost in my inbox.Shae: Wow.When is your interview so I can learn from your tricks?Sacha: This is now. Here we go! You can ask questions.The nice thing about conversations is that we jostle different ideas,and we are like, oh yeah, maybe I should write a blog post about that,because I take it for granted.So now apparently I have to write a blog post about mycleaning up process.My inbox is very long.The other thing, speaking of dealing with really long lists that Ipicked up from John Wiegley was I also sometimes remember to checkthis list of random items.So in my agenda, there's also like this, you know, random selectionof things that I have not gotten around to thinking about further,but it's there just in case serendipity or boredom make me dosomething.Shae: you know that's... I've thought about having...because you know, I've got the pop-up this little timer that pops upmy agenda, but I've thought about maybe adding a section I don't knowif I could add a section here but it would be something that sayslike at the bottom here's two or three random to-do's that have beenopen for a while just likefor garbage collection.Because I know that in Jujutsu, I've got a cool little query thatsays, if you have any change sets that are more than two weeks oldand are not in a permanent branch state, maybe you should dosomething about them.It's just called to do.It'd be kind of nice to have that for Org Mode as well.Sacha: Yeah, it's just, you know, and our brains do these strangethings with randomness, right?They're like, oh, I want to see what's new now.Shae: Right, right, yeah.Oh, I have a question.You have this thing where you had...
46:28Timestamps
Shae: I saw you taking notes with Prot,and you had this timestamp.Sacha: Oh, yeah, yeah, yeah.I'm using it now.Okay, okay.So I have it bound two ways now.I have it as a dabbrev, so dynamic abbreviation, and I also have itas a yasnippet because sometimes I'm using it with either SPC ortab to complete it.And I don't really want to think, I just want to get the timestamp inand then move on.And so abbrevs can run functions to evaluate it.You can insert the timestamp that way.Or yesnippet, of course, can evaluate the thing.And now I have those.It's basically just a wall-clock time so that I can go back and plopin the chapters as time offsets, which are automatically calculatedfrom the YouTube data on when the stream started.So I don't have to manually calculate my chapters.But it's super useful to have these times everywhere.And in this case, during a conversation, I want to be able to say,hey, we talked about something interesting.And then be able to go back to that point in the video later on.Shae: So you're matching?Oh, oh, wow.Sacha: So my shortcut for yasnippet is "ot" becauseI never type "ot" elsewhere, and it's close enough.I use Dvorak, so my O is on home row, and T is close by.Also, on the other hand... There you go.Shae: Did I already show you that this is actually Dvorak?Sacha: Oh, there you go.Now I can see the keycaps.Yeah, earlier it was kind of blurry, but now, yes, yes.So yes, that is my shortcut for inserting the timestamp.I previously added seconds as well, but then I realized that my kindmight be false precision.So I just, you know, just use a minute at the moment and then I goback and adjust the timestamps a little bit later.But yeah, you can use abbreviations for all sorts of things,including times and dates and stuff.Shae: Have you ever tried Org timestamp?Sacha: Yeah, Org timer.So Org timer gives you a relative timestamp, right?You can say Org timer.Oh, okay.So, sorry.Are you talking about the C-u C-c ! or somethingof that sort?So that's actually what I initially was doing, but then it was toomany keystroke word modifiers to remember.And then I had to press RET to select the, you know, thing.So now I just have an abbreviation insert the Org mode formattedtimestamp for me.And then I have this code that searches for Org timestamp regularexpression and then does the calculation and conversion and stuff.
49:12Org timers
Sacha: So Org timer is a separate thing.It's useful for meetings and things like that.You would say, okay, your Org timer starts at the beginning of themeeting and then you can have a list and it automatically, like ifyou alt shift enter or something like that in the list, it'llautomatically like insert the right timer, relative timer to it.There you go.So there's an org-timer-start.But the reason I didn't go that approach was because then you A. haveto remember to actually start the timer and B. then you have tosynchronize your time with video time.Which might not have started at the same time.So now I'm just like, okay, wall clock for everything.And then I can do the transformation with whatever I like.And since I'm editing my subtitles in Emacs, I can say, hey, thisfile started at this time, according to YouTube.And then just, you know, map all of the wall clocks to theappropriate subtitle times.Shae: Wow. That's really cool.Sacha: Anyway, so timers, relative, absolute, and usingabbreviations is great.Which I think actually is a thing that I picked up from Karl.Karl Voit because he also likes to use... He has an abbreviation,not at the Emacs level, but he has an abbreviation on his system level,like with his window manager, so he can use this timestamp trickanywhere, including in Etherpad or wherever else where youwant to insert the date and time. That's V-o-i-t, by the way.But yeah, so times are a great way to justleave yourself a pointer to that momentso you can go back to it later.Shae: Now I'm curious, how well does that integrate with this sortof thing?Because I really like looking back at my history agenda.Sacha: If you have it insert an inactive timestamp, I think itshould still show up there.I think it will be a little like those.Shae: Yeah, it looks like the...Well, it looks like these two are showing up.Sacha: Yeah, yeah, yeah.Yeah, so that's a basic thing that I would have inserted by my eitherabbrev or... So it's not even dabbrev.It's just regular abbrev in Emacs.Shae: What's the difference?Sacha: dabbrev is like hippie...Okay, let me just double check here.I feel like dabbrev is sort of hippie expand-ish.It looks in your buffer or possibly other buffers.And I think hippie-expand and dabbrev, they kind of work together.It's an option to have them work together.Okay, so hippie-expand is...Oh, so I see.Hippie-expand is the more advanced version of dabbrev.dabbrev was Dynamic Expand, and Hippie Expand says, yes, that, buttry a whole bunch of other things first.But my timestamp thing is actually just done by a regular abbrev,and I will find the thing in my config for "ot".Oh, yeah. I will put it in my chat.Shae: My spelling, most people say my emails are spelled really well,but it's only because I have ispell set up.Sacha: Yeah, ispell is great. I am learning French and therefore...Shae: Oh, c'est très bien.Je parle un peu de français aussi.Sacha: Oh, oui.I'm keeping a journal in French on my blogand I have the Tatoeba Project with all the example sentencesand I have a consult interface to look up stuff in themso I can just borrow other people's wordsand try to make it sound more natural.Plus of course the usualsearching for words in dictionaries and stuff.Anyway, in the chat, I put in my global abbrev table definition forinsert format time string.In case you want to steal that, it's right there.Shae: I will definitely save that into my notes here.
53:53Org Mode snippets
Shae: Another thing I use a lot is I useOrg Mode snippets.I will tell you that the first time, I guess if I look back at...This is another thing that I have done a lot of in the past, which iswhere...I love the fact that Org Mode snippets are just executable.I can just run them.I guess two jobs, three jobs ago, there was a case where, because Iwould keep the results around and look at them, there was a casewhere, I guess a couple of months before, something got shipped to acustomer, and I noticed our database schema had changed and Iprevented a tremendous amount of upset and emergency by being likethis doesn't look great. I got one from two weeks ago, and it doesnot match. Something's wrong here. Everybody's like, I don't thinkso, Shae. And I'm, like, no no no, we do have a problem, we've got tofix this. And they were, like, oh crap! And then I was like, yeah,solved a problem!Sacha: Yeah, I basically try to do as much in a snippet instead ofin, you know, in a scratch buffer or whatever, just because havingthat record, the fact that I did it, and also any notes that I hadleading up to it and the output of it, it's just so helpful.Shae: Oh, I've got a cool thing that I'm doing for work.And that is that our readme file is not only a word file, but we alsohave the demonstration of our actual thing is done by using likedependent snippets.And so that means that like if you want that, perhaps this issomething everyone already knows, I don't know, but we basically areusing the results of earlier commands in later places.And the other nice thing about that is that then when we want tocheck, we have to effectively dock tests, right?When we want to check and see if our software works the way it doesin the readme, we evaluate the final Org Mode snippet, which thencalls it forward, calls it forward,and then if something goes up or not.Well, I guess I need to fix something.And so it was pretty exciting to put Org Mode niftyness into our,into my Word reading file, you know?Sacha: Nice, nice.And you did mention your other coworker is on board with the wholeEmacs thing.So that's one of the things that people are often like, I want to useOrg Mode and I want to use it for like the documentation or thetesting or whatever, but they got to get everyone else on board withthe thing.Otherwise it's Jupyter Notebooks or whatever else, right?Shae: Right.Okay, so I have a joke for you that I came up with a long time ago,and that is, do you know the only way, there's only one way thatSauron could have organized the invasion of Middle-earth, and do youknow what he used?Sacha: What?Shae: Orc Mode.It's a terrible joke, isn't it?Sacha: That's okay.I'm sure someone in the comments will come up with an even worse pun.Shae: I'm excited!It's going to be great!Sacha: Never underestimate the punniness of the Emacscommunity.Shae: I completely agree.I don't know.Do I have anything else exciting in here?
57:15Compilation finish function: handle success
Shae: I actually really like this one.I used to run all of my tests in compile.F12, I have F12 bound to compile.And one of the things I wanted was, I wanted something where it was,if the compile is successful, don't show me the results, becauseeverything's good.And so since I'm doing stuff in Rust, when I run all the tests, itleaves the buffer up, and I need to get around to actually doingstuff like this for Rustic mode as well, where when the tests pass,just go away, because it's all good.And when the tests don't pass, show me where to...I need to look at the problem.And I got this from Enberg and Emacs, I don't know, 20 years ago.Maybe it was less than 20 years ago, but it probably wasn't.So yeah, there's so much good stuff.Yeah, there's just so much good stuff.And I also like to, oh, look, here we go.You can see that this is long gone, by the way.It's not there anymore.Sacha: I have a proper, you know, it's sachachua.com/dotemacs.A lot easier to remember.But yeah, and I think that's, yeah, yeah, I remember that now.defadvice is also obsolete.The new hotness is advice-add or something like that.Shae: Oh, really? I'm going to make another TODO item for there.Sacha: I was digging through my notes trying to find, do you shareyour config anywhere?Shae: No, but you know, at this point if I share it on YouTube, Imight as well just throw it up somewhere.Why not?It's not very exciting.Like if you look at someone like Ross Baker who has magic, like wow,is there some magic coming in from Ross Baker?I'm so excited to see more stuff from him.There's just like, I guess I feel like compared to almost everybodyelse I know, I feel like a power user.Because I'm like, you know, I wish I could do this thing.A lot of times someone I know is like, well, I did that thing andhere's a library.And I'm like, yeah, I'll have to do it.And I just, I guess I feel like I'm a power user.And on the good side, I guess I kind of,I really haven't written that much Elisp ever, like I was saying inthe comments during your interview with Prot.And I kind of like to, it's just I guess it's never quite gotten tothe top of my stack.And I did decide it was time for me to send money to Parade for atleast for themes, if not for like, please teach me some Elisp so Ican actually, because you know, it's not that Elisp is hard.It's more like, how do I kind of, what are the things I interact with?What are the words?What's the vocabulary of working with Emacs?I don't actually really know.As a user, sure, I can do cool stuff.I can do Lisp macros.I've done Scheme and Lisp some of the past, but not inside Emacs.Sacha: Alright, so let me clarify.After more than 20 years of using Emacs, did you say you feel like apower user or do not feel like a power user?Shae: I definitely feel like a power user, but I don't feel likesomeone who does much of anything with Elisp.I don't really feel like someone who has much of a clue in theinternals.And that's not entirely true.I have some of the ideas.But for the most part, I haven't actually needed to know that muchabout the internals.And sure, I've dug into things like how do you efficiently work withlarge buffers in your ??, like the ropes data structure andstuff like that.That was more for fun.Although it is something that Emacs does and does extremely well.But I'd kind of like to...There's a lot of things I'd kind of like to change and I don't reallyhave enough of the understanding of the kind of how I would write theElisp to do it.Here's a good example.When I hit F3, it takes me to the one I'm currently clocked into.Unless I haven't clocked in to something since I started Emacs.And honestly, I would like to use something like org-ql,the Org query language, to go findif I've just started Emacs,and Org does not know about something, you know,I just want you to go search for it.I have so many cores and so much memory,just go find it.Sacha: That sounds like an excellent reason to go learn Emacsso that you can have it...If you're not currently clocked in, go find the most recentclocked in task and go there, or maybe present you with a list ofthings and then go from there.I would love to hear about your Emacs Lisp learning journey becausethat's one of the big things that moves people from, you know, powerusers, yes, but users, to using Emacs as a lightweight editor toolkitfor something that's custom fit to exactly what their workflow is.And on that note, I'm going to try to wrap up gracefully before thekiddo, you know, just like drags me out here.Thank you so much for doing this.I look forward to more conversations.I'm going to post the transcript and other things like that prettyquickly, I think, because I have this nice workflow now that lets metake screenshots and everything, but there's so much here that I wantto unpack. But I hear the kiddo, bye!
0:00Introduction: Amin Bandali, software developer and free software activist
Sacha: Let me do the thing. Go live.Let's check in.Alright, hello.This is Emacs Chat 21 coming back after a decade of notdoing it, so…And today I've got Amin Bandali who's a…Is it seven years now that we've been doingEmacsConf together?Amin: I think so.Since fall 2019.Yeah.Sacha: Yeah, yeah, yeah, yeah.But of course you also do a whole lot of other things.I was looking through your Emacs configuration andthere's like translation and other stuff in there.So would you like to start off with a briefintroduction of who you areand how and why you use Emacs?Amin: Yeah, sure.Yeah, first of all, hello, everyone.Sorry if I'm looking to the side.This is a new setup.My laptop, which has my webcam, is there, but my maindisplay is here.So I might be looking to the side from time to time.But yeah, that aside, hello.
1:05Aspects of life: notetaking, editing, multiple
Amin: Yeah, I'm Amin Bandali.I've been, I think, using Emacs since 2014 or 15, so Iguess more than a decade now.I'm a software engineer by day, or software developer,slash programmer, slash computing scientist.I'm also a free software activist.I volunteer on a lot of free software projects aswell, which Sacha mentioned.I do things around GNU.I volunteer with FSF.I'm a Debian Developer, so I try to maintain somepackages in Debian.I try to help run EmacsConf from time to time.Hopefully this year I will be much more present.But yeah, that's that.So I first got into using Emacs, I guess, as aprogrammer tool, like as a text editor.But I've since then kind of integrated it into a lotof other aspects of my life.And I do much more with it, as I'm sure a lot of us do.Yeah, so I use it for kind of note-taking, just anywriting, editing purposesin multiple natural and programming languages.Reading and sending email for chatting via IRC.All of that good stuff.Sacha: This is the sort of thing that isn'timmediately obvious from your configuration.I know you've got your Gnus setup in there and you'vegot your ERC setup in there, but sometimes whennewcomers are trying to figure out, okay, there areall these packages, but how do I use themto get stuff done?That's one of the reasons why we want to do this Emacschat, so that maybe you can show ussome of the cool stuff.We are live, but if you accidentally show somethingpersonal, let me know and I can kill the stream within10 seconds and I think then we can be like, okay,we'll just flush that out and then come back oncewe've hidden the top secret plans for taking over theworld, that sort of thing.Sounds good.Where do we want to start?
3:00Configuration: keeping things simple
Amin: I'm happy to do it however you like.I can either share my screen, pull up my configuration.Yeah, okay, so let's do that.Sacha: Yeah.If you share your screen sometimes, I think what wedid ages ago was we just started walking through theconfiguration and then sometimes people say, oh yeah,that's really interesting.Let's go and demonstrate that so that people can get asense of how this actually works.And there were some things in your configuration thatI had no idea, like what is FFS?There's like no package.I couldn't find any information about it.But yeah, so your config, if you want to go ahead andshare your screen while IFill the air with hand-waving.Amin's config tends to be more on the minimalist side.I think you mostly rely on built-in things with acouple of external packages.You don't even use use-package at all.It's all run-at-idle-time to delay the startup ofvarious things, and then it's all vanilla Emacs as youcan get for loading and configuring things.Amin: Yeah, pretty much, yeah.Yeah, so before I continue, quick note, Sacha, if youcan make me presenter because I don't have access toshare my screen.Sacha: Oh, that would be important, yes.Hang on a second.Let me see.Okay, here we go.Make presenter.I might as well promote you to moderator while we'reat it.There you go.You should now have magic powers.Amin: Thanks.Let's see.Sacha: It's a good thing we're practicing thisbefore EmacsConf so I remember how all this stuff works.Amin: Yep, for sure.Okay, let's see.I think I got it now.Can you see my screen?Sacha: Yes, I can see your screen.Amin: Okay, excellent.Let's see.Okay.
4:58user-lisp-directory, site-lisp if you're using an older Emacs
Amin: Yeah, so as Sacha mentioned at the moment, my configis kind of very minimalist and kind of conservative bydesign, in part because I tend to work on a lot ofdifferent machines, whether it's for work orvolunteering or whatever, and I prefer to use Emacsif I can.So I want my config to be fairly self-contained so Ican easily either git clone or rsync it over.Yeah.To keep it simple, I was using package.el for a whilefor installing and managing my packages, which I don'tkeep in my configs repository.But then I decided to switch over to very manualpackage management with the awesome new featureuser-lisp-directory of the next upcoming Emacs release,which basically you can give it a subdirectory in your~/.emacs.d or ~/.config/emacs.And then it'll go through all the Emacs Lisp filesrecursively, byte compile them, native compile them,all that good stuff, and add them to the load-path.And for people who are using existing or olderreleases of Emacs, there's also site-lisp by PhilipKaludercic, which is kind of the…I guess first implementation of what later becameUser Lisp and built into Emacs.So you can make it conditional and fall back tosite-lisp if you want to be able to use User Lisp onolder Emacs but still have your configuration beusable.Yeah, anyway.
6:32Organizing configuration into modules
Amin: So I've experimented with like a couple different waysof managing my configurations like single giant initfile of like four or five thousand lines which I knowis actually not very large by comparison to I thinklike someone like Sacha's configuration and also likeYou know, split into multiple different files, whichhas its own benefits.And I've kind of actually converged to the approachthat Prot uses.If you actually take a look at my configuration file,you see I've drawn a lot of inspiration from Protswitches.Having a literate single file configuration, whichthen all of the Emacs Lisp source blocks get tangledto individual files.So I can maintain a single source of truth and edit itall in one place, but then also easily be able toshare individual pieces to people if they want.So yeah, that's kind of the general approach.And I can dive right in.Sacha: Yeah, that's definitely the structure thatI've also stolen from Prot.And I like the way that you'reYour heading names are all long and descriptive, andyou've got everything broken down in detail.So yeah, go ahead and walk us through it, please.Amin: Yeah, sure.Let's see.
7:45early-init
Amin: So that's a brief introduction, and then I have anearly init section for doing the early init file.There's a couple of subheadings here.Actually, let me enlarge the font size a little bit tomake it more legible.OK, great.I do a couple of things here like disabling package atstartup because I don't use package as I mentioned.I manually install and update my packages as gitsubmodules in my configurations repository.Amin: I set load-prefer-newer to t to make sure that Inever load any stale code.For example, I might edit some Emacs Lisp file by handand forget to byte compile or native compile it.And this tells Emacs to basically just use the versionof these three variants that's the most recent.Yeah.Nothing super fancy here.Amin: I turn off a couple of things that I find a little bitdistracting, like the menu bar or toolbar.Although I do say here that for people who are new toEmacs, they're actually super helpful.Sure, it's a little bit of visual clutter, but in thebeginning, it's really, really helpful to help youorient yourself of what mode you're in, what tools doyou have available in your disposal.And even someone who's been using Emacs for more than10 years, I also use it sometimes when I'm like…just starting to use a new mode.So yeah, good stuff.
9:06ring-bell-function
Sacha: I was very amused by the comment on the…"I don't like getting jumpscared out of my chair."You turned off the bell.Amin: Yeah, because that actually used to happenwhen I first started using Emacs.Like when I would, I don't know, I don't even rememberwhen it bells or rings, butMaybe if you like quit like with C-g or like try tobackspace into like delete where there's no morecharacters to delete so it rings a bell and it's verylike can be jarring so yeah I turn that off.
9:40performance optimizations
Sacha: Yeah, and then you've got a whole bunch ofthings where you set some variables to nil temporarilyto make it faster, so that's in your startup in garbagecollection.Amin: Exactly.Empirically, there is no hard and fast sciencebehind this.I experimented over the years.I'm pretty sure I believe the default, for example,the garbage collection cons threshold is about eightmegabytes.I tried increasing that a little bit to see how muchIf I increase it to what pointwill it make my startup faster?And I found this 30 megabytes or mibibytes to bekind of a sweet spot.So I bump that up.And then after Emacs has finished initializing, in theafter-init-hook, I just restore the defaults.
10:25user-lisp
Amin: And then, yeah, this is the bit withthe user-lisp-directory that I was talking about.Awesome stuff.So you can basically designate a directory.For example, in my configuration,it's just a lisp directory.And then on startup, Emacs will go through andbyte-compile, native-compile if necessary, and then add allof that stuff to the load-path automatically.So you get that.Yeah, and then this is the bit about site-lisp that Iwas talking about.So if you want to use user-lisp, but you're stillusing older Emacs versions that you maintain, you needto maintain backward compatibility in your config.This is how you do it, for example.So you just yeah, add it to load-path, require it andthen call prepare-user-lisp.That's about it.
11:14ignoring byte compilation warnings
Sacha: I'm picking up that tip about using theignore directories.I'm getting by with just ignoring all of the bytecompilation output, but it would be nice to just say,you know, that stuff is test.I don't need to worry about it.Amin: Right, right. Thanks. Yeah, I was also doingthat.I actually have it as a comment to suppresswarning types, like byte compilation, but I was…I plan on working on some packages,whether my own or others,and it would still be helpful to get those warnings,so I keep them enabled. It's still a bit annoying.I still get some of them when I launch emacsbut I don't restart or launch emacs as frequentlyso it's pretty bearable.
11:55init-file-debug = --debug-init
Amin: Yeah, and then I have the main init file.And there's not much in it.It's just the debug-on-error and debug-on-quit.So the debug-on-error thing, I set it to the value ofinit-file-debug.And if you look at that, the help for this variable,basically if you pass or launch Emacs with--debug-init, this variable will be true.So yeah.Sacha: I did not know that.Cool.Amin: Yeah, it's pretty helpful.I think, if I'm not mistaken, I took this fromJohn Wiegley's dotemacs, but I can't remember for sure.It's been years.Yeah, it's pretty nice.And then here, I just set my name and email address.And very early I set a custom-file to keep all of thatstuff separate from my .emacs.I don't want it mixing in.
12:53Core
Amin: And then pretty much the only other thing that's in mymain init file is just to require and load thesedifferent modules or packages of my configuration.I have these as actual packages or as actual features.They provide themselves.And that's just something that I've foundstraightforward enough to do.I know, for example, Prot uses a dual approach.He has some of his configuration that's more readilyusable, available as actual packages.And then the other ones, it's just Emacs Lisp code.It's not actual packages.But for me, I just keep it simple.Everything as packages and that's about that.Sacha: Fantastic.Let's dive into some of those configuration modules.Amin: Sure, let's see.Yeah, so this there's this like core thing which iskind of included gets included in all of my otherfiles.
13:53no longer using bandali-configure; scoping errors, timing execution
Amin: I wrote a bandali-configure macroshamelessly based on prot-emacs-configure whichis what Prot uses and it basically is a way of kind ofsimilar to use-package for like wrapping a bunch ofrelevant like Emacs Lisp code all together.It has the benefit, if you use it, if there is anerror in that block or in the body basically, then itwon't crash everything.That body will just get ignored and we display anerror.And that's also the main reason that Prot uses it.The one thing that I added extra to mine, which I tookwith inspiration from Eshel Yaron's esy/init-step,is to wrap it up in basically time the executionof each of these blocks, which can be pretty helpfulto help you see, okay, which part of my configurationis particularly slow.Usage examples.I just have it here.You can either basically pass it like a symbol likething or you can also pass in a string as the firstargument.And this is what will be displayed when you display alist of the evaluation times for all of theseblocks in your configuration.Amin: Yeah, and then I have a neat little functionhere like bandali-configure-report-timesthat will report these times,whether in the order that it'sencountered them, or you can have itsort by fastest to slowest,slowest to fastest, blah blah blah.Sacha: You mentioned you're no longer using this.Is it because you wanted it to be easier tocopy and paste your code?What got you to shift back to the regular vanilla typeof configuration?Amin: Right, as neat as it is, I didn't find itsuper useful. For one thing, because I don't add orremove a ton of stuff to my Emacs configurationregularly, so if there is an error, it wouldn't causean issue for the rest of my configuration. I didn'treally find that very useful.And then my other potential concern is that the way Iwas structuring things, I would put all of theconfiguration, let's say for Gnus, in one of theseblocks.But I wanted to be able to break that down into, forexample, Org Mode sections more easily.So far, I just decided to not use it.I know I could technically break those down intosmaller blocks, but I haven't done that yet.Sacha: Ihor says, this configure macro looks a lotlike good old use-package, which you're not even usingin the rest of your config.And I hear you about wanting to be able to splitthings into smaller blocks with more explanations inbetween them.So in my config, yeah, sure, I've got the use-packagethere to do the ensure and all that stuff.But I also have with-eval-after-load because I stillwant, you know, the links and the screenshots inbetween.
17:02Why not use use-package
Amin: Right. Yeah, exactly. use-package is awesome.I have used that in the past,especially when I was using the straight.elpackage manager. It pairs nicely with it. But yeah,since then, I found it a little bit like too magicalfor my tastes, kind of along the lines ofdeclaring an init file bankruptcy at some point Ireally wanted tounderstand every single line that I have in my Emacsconfiguration.And at the time, I didn't know a whole lot aboutmacros or wasn't very well-versed with them.So I just ditched it in favor of simply using, as youmentioned, with-eval-after-load.And then that causes all that code to be basicallydelayed, not evaluated immediately, but when thatpackage is loaded.And then as to when to pull that package in, dependingon if I want it right from the get-go of my Emacsstart, then I would require it.Otherwise, I add this, as you also mentioned earlier,this kind of timer thing where if Emacs is idle for, Idon't know, 0.2 seconds or 0.4 seconds, then go aheadand require this package.Sacha: Ihor has a tip in the chat.Of course, Ihor has an Org way to do this.He uses use-package whatever config and then he has anoweb reference to the Babel blocks.Then he just says :tangle no on the source blocks sothat they don't actually get repeated.Anyway, you can look at it later when you go through.I'll send you the comments or whatever.But show us how you're actually configuring thingssince you're not using this.
18:37Defining multiple keybindings
Amin: Then I just have anotherquick macro thingy here, bandali-define-keys, whichwraps around Emacs's define-key. It affords me theconvenience of defining multiple key bindings, andProt's version of this (I think it'sprot-emacs-keybind, or something like that) heimposes the limitation that the keys should be validstrings that can be passed to the kbd function,which is very fair and valid, but I wanted to notimpose that, to keep the flexibility of usingdefine-key directly.The consequences of that, as we can see, is we canpass in the old representation of key bindings, likethe vector or whatever syntax, which Prot's doesn'tsupport by choice, whereas mine does.Let's see.For example, let's look at the bandali-theme.el, which isall about…The appearance, I guess, of Emacs.
19:45doric-oak uses emphasis instead of colours
Amin: Yeah, so I just have a conditional block where, youknow, if you're in a graphical environment, I'll justgo ahead and load Prot's doric-themes, specificallydoric-oak, which is what we're seeing right now.I'm using, it's very beautiful, it's very subtle, andit uses emphasis, bolding and stuff to drawyour eye to something instead of using a milliondifferent colours, which I find pretty nice.Yeah, and then for example here I set up some fonts.I use this Sahel font for Persian and Arabictext.I set a colour emoji font here and this is like we geta kind of preview of what I do.It's like with-eval-after-load 'faces and then blahblah blah.Sacha: Ihor would like to point out thatwith-eval-after-load is also a macrothat calls another macro.So I'm just going to mention it because it's there.These are your fonts.This is your theme.This is great because everyone always asks, what themeis this?What font is this?All right.
20:49global font scaling instead of the local ones
Sacha: I like your text scaling tweaks that you're just aboutto go into. You've changed the global mappings.Amin: Yeah, yeah, yeah.And I actually took this from Prot as well.And it makes a lot more sense.So by default, this, C-x C-+, -,blah, blah, blah, it only scales the textfor the current buffer only.But in newer versions of Emacs, in Emacs 29, they alsoadded commands to adjust this globally, includingthe mode line and all that stuff,which is usually what I want,for example, in this presentation or when I'm sharingmy screen right now.It scales everything up globally.So yeah, I just swapped these to be the default, andthen I add keybinds for the just local variants incase I need to use that.Yep.
21:37display-fill-column-indicator
Amin: And then here I have display-fill-column-indicator.I don't know, maybe this is just me, but sometimes I'mkind of OCD about keeping my text lined up at exactly,for example, the 70 characters column.I care a lot about that, especially if I'm writingcode or text that I want to also visually look nice.And I enable this.And let's see, I enable it for prog-mode.So yeah, I guess if I, for example, do this…This little thin line that we see here, that's thedisplay filler column indicator.I used to have it globally enabled, but then I foundthat a bit too much, so I just enable it with a hookin the modes that I want.Sacha: Yeah, and the theme makes it very subtle.It's just there as a reminder,don't go beyond this line.You can if you really want to, but just try not to.Amin: Yeah, exactly. And then my essentials…This is where I configure a lot of keybehaviours of Emacs, all built-in stuff for the mostpart, or things that are key to my workflows.For example, I always want to start with a *scratch*buffer.
22:53emacsclient for EDITOR and VISUAL
Amin: Start the Emacs server if it's not running.And this is very useful, very helpful so that then youcan call into an existing Emacs process withemacsclient and have it edit a file.I don't use it for anything fancy just yet.I believe Prot also mentioned in his video with you,Sacha, that he uses it for things like org-capture tospawn a new buffer in his existing Emacs sessionand things like that.You can do pretty cool things with it.But yeah, I just use it for being able to easily usemy Emacs as EDITOR and VISUAL text editors.So yeah, this sets that up.
23:37fundamental-mode-hook
Amin: Adding a fundamental mode hook.Again, I took this from Prot.Sacha: I was surprised by that because I was like,oh, there isn't a fundamental-mode-hook?Okay, that makes sense now.Amin: Right, right.Yeah, there isn't a fundamental-mode-hook by design.But I still, in the past, have found that I wantedthat.For example, for this display-fill-column-indicator,when I had it enabled everywhere, I was like, it wouldbe nice if I could at least disable it for Fundamentalmode.And at the time, I didn't have this.I added this just recently.So if I decide to go back to using something globally,but I don't want it in fundamental-mode, then I candisable it using this.Yeah, and then some standard stuff like I preferspaces and a tab width of four characters.
24:23indicate-buffer-boundaries
Amin: Visually indicate buffer boundaries.This is a little bit hard to see right now,but here at the bottom leftAmin: you see a little down arrowAmin: and then the little top arrow.And… Let's see if I can.Sacha: Oh!Amin: And also here, for example, when it all fitsin the view.Sacha: Huh, that is cool.I was looking at that.What does it do?And so that tells you, you can still scroll up or youcan still scroll down, and you don't have to look atthe scroll bar to see where you are.It just says there's more there.Amin: Yeah, exactly.Yeah.And it also helps distinguish when there's a newlinecharacter at the end of the file or not.So here in this buffer, there is.Amin: But if I delete that, you see this indicator herechanged shape.But if I go back and add the new line again.So yeah, that's also been very helpful for me becauseI added configuration files and some of these piecesof software are sensitive to having a new line at theend of the file.So yeah, it's very helpful and useful for that.Sacha: I would not have guessed that from the veryshort line in your config that turns that on.It's one line, (setq-defaultindicate-buffer-boundaries 'left), and yet it adds this nice littlenuance to the way that fringe looks.Amin: Right.Yeah, absolutely.Perhaps I should expand more on it at some point laterto explain these things.But yeah, just this one line.Sacha: May I recommend screenshots?Amin: Yes, you may, for sure. Yeah, I willdefinitely do that as well,because I'm also a bit of a visual person.I like seeing screenshots and videos,so yeah I'll take that to heartand do that for my own configuration as well.Sacha: When I post this, I'll probably… I figuredout how to have the transcripts and then screenshotsembedded into my transcript.I'll generate it automatically from the subtitle file.Our EmacsConf transcripts are going to get so fancynext year. But you can pull those screenshotsand drop them into your config. It'll be great.Amin: Nice. Yeah, for sure. Sounds good.
26:36enabling and disabling commands
Amin: And then here, I just enable some of thesecommands that are disabled by default.So yeah, it's useful, especially narrow-to-page,for example, or narrow-to-region.These are commands where Emacs disables themby default so that newcomersdon't accidentally hit them and get veryconfused by what just happened.It doesn't disable them for good.It just basically prompts you for confirmation.Are you sure you want to run this command?I'm sure, at least about these commands.So I just enable them.And then something like, for example, overwrite-mode,which I never useand I don't want to accidentally enable.I just put it disabled so that if I do accidentallyhit the keys, which might be, I don't know, somethinginsert or whatever, then it will prompt meto make sure that I meant to do that.Sacha: That reminds me, I should probably turn thatoff for myself and then you get a whole new keyboardshortcut you can use too.Amin: Right, yeah.Let's see.
27:37package-review-policy
Amin: Yeah, I have just one line setting for package.el.In Emacs 31, we will be getting a package-review-policywhich is very helpful.So if you do use package.el for installing packagesfrom GNU ELPA, NonGNU ELPA, MELPA or whatever else,you can enable this, and then whenever you update yourpackages, you'll get a diff of what changed in thisnew revision of the package that you're downloadingand you're about to enable.And you can presumably say yes orat least see what's going on, which I'd find helpful.Sacha: But you're not using packages, you mentioned,so you're just checking everything out and then you'rejust git pulling whenever you feel like it.Amin: Yeah, so right now I'm using git pulls and gitsubmodules, very manual.I put this here because I think it's generally a verywelcome change and awesome new feature that I want tospread the word about.So maybe someone who's looking at my config, they usepackage and that's perfectly fine.So this is just here to spread the word about itmainly, I guess.And if I start using package at some point myself inthe future, then I will have this enabled.Let's see.
28:52getting the Info files from the Emacs source directory
Amin: Very quickly, here I extend Info-directory-list.I like to, at least on some of my machines,use Emacs that I built from source directly in thesource repository of Emacs.Just after doing make, I don't run make install,even though it's very easy to do that.You can install to a custom location by providing--prefix when you're ./configure-ing Emacs.Sometimes I just find it more convenient for me to notdo that and just run make and then exit and reopenEmacs.And for that kind of a setup, I just extend theInfo-directory-list to include the info subdirectory of theEmacs source repository so that the built-in Emacsinfo manuals will be available to me.
29:45recentf, adding directories
Amin: And then I use recentffor tracking recent revisited files.I bind it to C-c f r efor me to get a pop-up completion for visiting arecent file, it has completion.So if I hit TAB here, for example, we can see some ofthese files or directories that I visited recently.Sacha: I see.And then you're adding the directory to it.So what does that let you do?Because I'm assuming you're already in there in thedirectory.But how does that change your recentf?Amin: Right. So I need to think to remember this,but I think the point of this was that if Iopen a project in VC or in Dired, then Iwould like that directory to also get added to myrecentf files list, because I think by default,recentf only includes files, not directories.Sacha: You're in it, you start up Magit or whatever,and then you move on to something else, but you wantto be able to easily go back to it.Amin: Yeah, for example, I like to keep my recentlyvisited directories in recentf as well.Because that's one of the main ways I jump betweenprojects and stuff, even though there is literally abuilt-in Emacs project mode, which I still use.The only thing that I have here is…I don't want to add my home directory to the recentlyvisited list, so the only thing that this functiondoes is to skip that if I'm opening the home directory.That's about it.
31:38Scrolling
Amin: And then here I configure mouse and scrolling behaviour.So I want Emacs to scroll very gently, one line at atime.I think the default is that when you reach the end ofthe page, it'll jump half a page down and thenrecenter.I don't remember default behaviour because I don't useit very much, but yeah, this basically makes itvery predictable. For example, when I reachthe edge of the page here and I press C-n,it'll only scroll one line at a time, instead ofjumping and then doing something likethis.Sacha: Oh yeah, mine does! Mine doesn't do that, soit does that jumping thing. I see what you meanhere. Interesting.Amin: Yeah, so you can tweak that with scroll-conservativelyand then scroll-preserve-screen-position, I believe.
32:28auto revert
Amin: Yeah, and then I use autorevert, which is prettyhelpful.So this will have Emacs watch, for example, files thatare open in your buffers.And if they change on disk, Emacs will automaticallyrefresh the buffer so that you get the latest version.The cool thing is you can press undo in one of thesefiles that's been autoreverted so that you get therevision that was there right before the change.So I've used that sometimes as well.Sacha: Yeah, and sometimes autofollow also is nicefor log files and things like that.But yeah, autoreverting is great.Amin: Yeah, for sure.
33:14Repeat mode
Amin: repeat-mode is something that I've only recentlystarted using, especially with my Emacs EXWM setup,using Emacs as my window manager.For example, if I hit C-x o, we see here in theecho area where it says repeat with o or capital O. SoI can now only press o instead of saying C-x o,C-x o to do that multiple times.Keymaps that have support for this basically indicatethat they want to be repeatable can declare that.And then once you invoke one of the keys in thosekeymaps, then you can repeat it with just that singlecharacter.And for example, for my setup, I have that with myEXWM workspace switching keys.So I can easily go to the next and previousworkspaces, many of them at a time by just pressing pand n instead of doing the shortcut multiple times.Sacha: And actually, if you don't mind jumpingahead, the EXWM part of your config is fairly complex,and I think not a lot of people have a lot ofexperience seeing EXWM in action.And I don't know whether you're comfortable sharingyou switching around to different workspaces, but ifthat is something that you can do, how are you doingall this awesomeness?I'm still too scared to use EXWM myself.Stability.But that's a me problem, not an EXWM problem.
34:51EXWM
Amin: Yeah, EXWM was pretty awesome.I used it back in 2018, '19 for a while, and then Ikind of moved on to Sway and Wayland.But I don't know.It's something that I feel like once you try it, youwant to keep going back to it.So recently, this past month or so, I decided to giveit an earnest try and try to actually address any painpoints that I've noticed.So it's much more usable for me now, and I'm stickingwith it for now.I'm not a Wayland hater, but I'm just saying, at leastfor now, I'm using EXWM.And I'm happy to talk about it.Sacha: OK, what do you love about your setup forthat one?Amin: EXWM?Sacha: Yeah, yeah.Like, you're doing a lot of rename buffers.Yeah, yeah, yeah.Amin: Right.Yeah, let me think.There's a couple of things.So, for the longest time, my Emacs EXWM configurationused super key as a prefix,which is the Windows [key] or the one with thelogo, basically, to switch workspaces, launchapplications and such.And at least the way that EXWM is right now, itdoesn't…Like the way you have to add those global key bindingskind of slows down the EXWM startup.And I had many such key bindings.Amin: So one thing that I did kind of recently is todefine a prefix map here, like bandali-prefix-exwm-map.So I bind all of the keys and commands that I wanthere, and then this helps me really minimize what I'mtelling EXWM, which is here.For example, this is how you set global keys withEXWM, and I just point it to my prefix map.C-c x and then any of those letters andfunctions that we saw.That's kind of annoying.I still use the super key here, but I have it s-xand s-,.On the left-hand side of my keyboard, x is right nextto super, so I can hit it in one go with one motionalmost as a single key with these two fingers.On the right side of my keyboard,I don't have a super key,but I have a control key that I remapped to super.On the right side, I do s-, with these twofingers.It's still very convenient for me to invoke thosecommands.And pairing this up with repeat-mode, as we can seejust here, actually, then I can hit s-, andthen p, n, or h, j, k, l many times to switchworkspaces or shift focus to different windows andstuff without having to hit that kind of annoyings-x or s-, repeatedly.Yeah.Sacha: That sounds really cool.I should look into that.Sorry, quick aside.
38:03Audio setup
Sacha: @blaiseutube would like to compliment you on your awesomeaudio setup.It sounds like you're in the room with him.Apparently, I sound like I'm on speakerphone, but youraudio setup is top-notch, apparently.But that looks like a Blue Yeti, so I have to find outwhat's going on.What microphone are you using?Amin: It is indeed a Blue Yeti.Sacha: Yeah, yeah.So I just have to ask him forokay, what kind of boom mic?Anyway, we'll do that all offline because it's notEmacs related.Amin: Yeah, it's just the Blue Yeti.Yeah, I turned down the gain.I used to have gain higher, but then it picks upmore noise from around the room or aroundthe house.So I turned down the gain a lot and then I getclose to the mic so that it only captures my voice.Okay.Sacha: I'm gonna need the boom.Otherwise, I'm squished into that corner.All right.So you were doing repeat-map before I said oh,let's talk about EXWM because you've got cool stuffthere.Amin: Yeah, and I can continue talking about the EXWM.There's a lot here.
39:10keymaps for launching different applications
Amin: I have, let's see, s-, SPC.I bind it to async-shell-command to use as mysimple, little, dmenu-thing forlaunching applications.Amin: Some of these things, like browsers, I stilldo them frequently enough, and I use differentbrowser profiles.So I just define a new keymap so I can basically one-shotlaunch Chromium or Firefox in a specific browser [profile] or anincognito window and such.So yeah, I just do s-x b and then, for example, cto launch Chromium and all that stuff.So I found this pretty convenient.
39:49bandali-call-interactively-insert
Amin: Speaking of key bindings, before I get down this,let's see if I can find… C-c h.I think this is just before my EXWM setup.I'm pretty proud of this.I love this.It really goes to show how awesome Emacs is andextensible it is.Let's see.So as we know, these various help commands anddescribe commands are under C-h prefix.But some of them are not bound,for example, find-library or describe-face.Some of these I use pretty frequently.I was really having trouble coming up withdescriptive-enough keybindingsor short-enough keybindings for all of them.I put some of them here, for example, likeC-c f l for find-library.But I can't do that for all of them.What I did was just do C-c h a or C-c h d.What this will do is basically, if I show that,It basically opens up M-x, fills in describe-,and then I can just type, for example, face,and that's it.So it basically opens up the minibuffer for me,pre-fills it with the string that I want, and I cantype what is it that I'm looking for.And I found this to bebetter than trying to bind a million differentkeyboard things for describe this and that,apropos this and that, find this and that.So yeah and the way that we do that is to just usea minibuffer-with-setup-hook, and you just have alittle lambda to insert the string that you giveit, and then you invoke it.Sacha: Yeah, this is pretty cool.When I saw that in your config, I was like,I'm going to steal that.Pre-filling the minibufferbut still letting you do stuff with it,it's such a powerful thing, not just forcompleting the command itself, but even for whenyou're using the command,but you want to do something with the input before.You don't want to do it all the way,send it in and submit right away.You want to actually do something with it after youinsert it.So great tip.Amin: Yeah.Thanks.Yeah, it's pretty useful.It's pretty nice.Yeah.And then back to the Emacs or EXWM stuff.So before I had, I used to yeah, sorry, go ahead.Sacha: Sorry.I forgot whether I was muted or unmuted.Amin: Okay, no worries.
42:26workspaces
Amin: For the longest time, I had 10 defaultEXWM workspaces on startup, and that can slowthings down a little bit.So I found that okay, I don't really useall 10 workspaces always.So I set it to 5.So I get five workspaces initially.But I still bind keys here.Like if we go down.Let's see.Here.So here, I define those keys for all the way from,let's say, from 0 to 9 for all 10.And then if I try to switch to a workspace thatdoesn't exist, then EXWM will just go ahead andcreate it for me.Yeah, so I found that pretty cool.You can create workspaces on the fly.Yeah.Sacha: Yeah, and I saw that it moves your currentwindow there, too.So that's just like, OK.Let's move it to workspace number two or whatever.Very cool.Amin: Yeah, yeah, yeah.I have keys or convenience keys for movingsome window to some workspace.Yeah, it's nice.Let's see.Let's see.Yeah.So these are just made key bindings.I use hjkl here for switching windows.
43:46ZSA Voyager split keyboard, super x as a single key
Amin: I also have a ZSA Voyager splitergonomic keyboard.I can basically customize it infinitely.For example, I don't really have a super key on thefirst layer.What I have is a key that will do the s-x thingy,basically, my prefix.So that's the last missing piece is that if I'mat home and if I have this keyboard with me, then Ijust hit one key and then that's it.I'm in my prefix.But even if not, on the laptop, the s-x or thesuper comma are still easy enough for me to hitit with one hand.Sacha: Now I'm jealous and I definitely wantto assign my prefixes to their own keys.Very tempting.I've started using the numpad because my laptop hasone.I only use the numpad rarely, but we all need morekeys.Amin: Yeah, ergonomic keyboards are pretty nice,especially these ones. For example, the ZSA ones whereyou can put QMK on it, the QMK firmware. You candefine keys in a C file. I can actually show that.Let's see… QMK Firmware, Keyboards, ZSA,Voyager, Bandali, and then keymap.c.Sacha: Is this in your repository somewhere?Amin: Right. It's in a different repository, but it'sstill on https://git.kelar.org next to my configsrepository. You can find this as well, but if I gosmaller…Yeah, you can define keys here and have differentlayers, like the base layer.And then you can define a key to switch betweendifferent layers and put some of the keys there anyway.So yeah, it's a whole rabbit hole in and of itself.Prot also uses a split ergonomic keyboard.It really does help if you're typing for longperiods of time.I actually had these for a while, and I wasn't usingthem too much, but I started slowly getting some painin my wrists and here.So I was like, okay, I have the keyboard,might as well put it to good use, and I've startedusing it.
46:26Keybindings
Sacha: Okay, so most of your keyboard shortcuts comeoff that kind of s-x or C-c something, andthen you have a long prefix sequence, and you justremember everything or you use your…pre-fill some of it and then fill in the rest of thecommand.Amin: Pretty much all my window management relatedkeys are on this s-x prefix that I'm showing here.And then I have a few other ones which I think Ishowed earlier.Is it this one?Anyway, I bind a few general keys outside of thes-x thing, like C-c e i.For example, I have C-c e e for eval-last-sexp.I do that a lot, so it's easy to hit that.Making frames or deleting frames.Sacha: I love how Emacs uptime is something you usefrequently enough that you have a keyboard shortcut for it.Amin: Yeah, of course.I mean, I'm sometimes curious to see how long has myEmacs session been running.To continue with the EXWM stuff, let's see.This is just some keybindings I define here.It's all Emacs Lisp, right?It's amazing.You can mapc over whatever sequence and createkeybindings like that.Only with Emacs we can do things like that.I just love it.Let's see.
48:05Media buttons
Amin: I still keep these three other keys for raising andlowering the volume and toggling mute off of thatprefix and just directly on my keyboard, hitting itdirectly in the exwm-input-global-keys because I dothat very, very frequently.But I also have scripts that I can invoke.I should do keycast.So yeah, I caninvoke the prefix with semicolon.I can set my volume here, adjust it here, type in whatvolume I want, or with the single quote, I can enter avalue for the screen brightness.I like these things to be exact depending on thelighting in the room.I have preferred brightness values of 50 or 12 or 10that I manually adjust.I guess it's a poor man's version of having somethingwith a light sensor that can pick up and adjustautomatically.I do it manually.Yeah.Sorry, you just muted yourself again.Sacha: You're just probably this close to writingthe Emacs Lisp that takes your webcam image and thenadjusts your light.But I think Prot was also saying he likes to do thelighting changes manually as well because warmercolors versus cooler colors and all of that stuff.Anyway, so you have all these buttons that EXWMlistens to and it can launch various things for.That's a lot of things.Amin: Yeah, those are pretty cool.
49:43exwm-input-simulation-keys!
Amin: EXWM has this lovely feature called inputsimulation keys whereYou can basically use it to bring Emacs key bindingsto other applications like Firefox or whatever.And yeah, it's mind blowing when you try it for thefirst time.for example, I bind C-b to just hitthe left arrow on the keyboard.And it does that.So I can define all of these commands that I'm usingor used to using in Emacs.So I can get them in Firefox or other applications aswell.Realistically, it's mostly Firefox.It's the only other program that I spend anyreasonable amount of time outside of Emacs.Sacha: Let me point out this very important one thatyou have there.Under selection/cut/copy/paste, I see a C-winput simulation key.So this is for all the people who have accidentallyclosed their browser tab while trying to copy text.This is how you solve that problem.Use EXWM and use EXWM input simulation keys and youdon't have to accidentally close your browser tabsagain.@blaiseutube asks, hey, what about time since last save?Or do you have some kind of autosave magic?you know, in reference to the uptime thing,right?You have this thing that shows you…Amin: I don't think I have anything for autosave,but I have this habit of… I save everything prettyregularly.Yeah, so I've never really needed that feature, butI'm sure Emacs has something where you can, at thevery least, just very dumb, simple implementation ofhas it been idle for one minute, then just do a savebuffer.You can roll your own.But I don't have anything.Sacha: All right.I'm getting really tempted now to try out EXWM, evenif it's just for those global keyboard remappingthings.
51:39exwm: managing floating windows
Sacha: How is it for windows that you've got to have floating?I feel like it's very good at handling tiling things,but how is it for sometimes the apps kind of reallywant the floating window?Amin: Right, yeah, so you can toggle any window tobe floating or not, and you can also - actually, we'rejust looking at it here. EXWM manage configurations,to match on the instance name or the class name of awindow that you can get from xprop, to automaticallymake that tiling. For example, if I do my prefix andthen capital T, it launches a floating terminal for mehere.And if I go back to where I set it up, I just launchXterm with the -name argument.This is where it can set the instance.And I just put any string you can want, like floating,for example.And then here in my configuration, I just check thatif the instance name is floating, then I'll go aheadand float the window.Simple as that.Sacha: All right.This is starting to look exceedingly tempting.Lol, I save everything regularly, so he's one of thosepeople who compulsively hit C-x C-s.Amin: Yeah, I do that a lot.I don't know.It's just me.But, yeah.Yeah.And then, I don't know.EXWM is awesome.
53:11exwm: application-specific local simulation keys
Amin: You can also put local simulation keys,application-specific simulation keys, dependingon, the application, terminals, forexample, or, Zathura.This is a PDF viewer.To have application-specific custom key bindings,how cool is that?For example, if I'm in Xterm or something like theMate terminal, hitting C-c C-c twice basically,it'll just send the C-c key to the terminal.Because one thing with EXWM is that you can set it tocapture a couple of Emacs prefixes, like C-x orC-c.So the application by default doesn't see it becauseEmacs captures it.But this is one of thosemechanisms by which you can send a key through.Let's see.
54:04binding C-q to exwm-input-send-next-key
Amin: The other thing is, you can set it like EXWM inputssend next key.So the default is C-c C-q, but I justbind it to C-q, and I, for example, can doC-q C-t to send C-t to theunderlying application.So that's the other thing.Yeah, and then let's see.
54:28Renaming buffers
Amin: So this thingy here, I enable EXWM and I add thisrename hook and all it does is basically to add thewindow titles to the buffer that I can see on themode line.But as long as it's within a certainreasonable length, like for example, I have 25characters.If it's longer than that, it will just put dot dot dot (...).So yeah, that's all the purpose of that.Let's see, for example, if I launch Xterm, it appearsthere.The perfect example is actually here on the right-handside.On the mode line, we see Firefox ESR Emacs Chat.It's a bit long, so it just puts the dot dot dot there.So that's all that does.Sacha: Yeah, now being able to use Emacs to managethe tiling of these things instead of my having tofiddle with alt-dragging things to snap nicely intobuffers.Yes, very cool stuff.EXWM.Gotta try it.Amin: Yeah, for sure.Yeah, let's see.
55:36dunst for notifications
Amin: Here I launch Dunst if the executable isinstalled for getting notifications in EXWM.I think there's at least one or two Emacs specificpackages that implement a simple notificationdaemon or backend so that Emacs itself can handlethat.But I found Dunst good enough for my use cases comingfrom i3, Sway, like tiling window managerbackground.I just reuse that.So yeah, I just start a process, keep a handle of itin this bandali--dunst-process variable here.And this thing I discovered recently, it's cool.using set-process-query-on-exit-flag, youcan basically have Emacs not ask you if you want toexit Emacs if that process is still running.It'll just kill it without confirming with you.So just a little convenience.Sacha: That is also cool.Just a heads up, I have about 15 minutes before thekiddo runs out because she'll be done with school then.Even just the EXWM part and other things that you'veshown us in the config have been super awesome.But are there other things in the next 15 minutes thatyou would love to show people so that they can see howit works in practice?
56:54exwm xsettings and responding to screen configuration changes
Amin: One thing I'll just mention, EXWM,one more thing, and then I'll go check.I think this is kind of recent: EXWM xsettings, andthis allows you to dynamically at runtime change someof these things that you would normally set in an Xresources file, like fonts. These kinds of settingswere especially commonplace back when Wayland wasn't athing or wasn't very popular. You would set some ofthese font settings there.With EXWM xsettings, you can do this dynamically,and what's awesome about that is it also lets you hookinto, for example, if your screen configurationchanges, if you plug in a monitor or unplug it, thenyou can run whatever xrandr command to set it up andalso adjust those settings.The main thing I use it for is to change the DPIsetting. The thing with X11 or Xorg is, unfortunately,there's no per-monitor DPI. There's one global DPI.But I found that on my high-DPI laptop screen, if Iset the resolution to 1920x1080 instead of the fullresolution, then the default DPI of 96 works just finewith my external monitor as well. All this little hookdoes, by calling into this function, is: if I'mplugging in my external monitor, lower the resolutionand lower the DPI, and if I unplug it, go back to thehigh thing. I just love this.Sacha: That's great.We're definitely not going to demonstrate that becauseplugging in and unplugging monitors is not a goodthing for screen sharing, but that sounds really cool.When things change, you can actually get your systemto adapt to the changes for you.Amin: Yeah, it's lovely.Let's see.There's so much more to talk about.
58:59Slowly getting back into Org mode
Amin: I'm slowly getting back into Org Mode again.For the longest time, I didn't use it and I just usedMarkdown for my website as well.But I found that it's kind of limited.For example, I was using a Markdown implementationthat was written in C and I can't easily customize it.Whereas with Org, I can hook into or createmy custom HTML backend that's aderivative of ox-html, even if I don't necessarily likethe defaults or the settings for ox-html.I just recently started writing a new backend calledbhtml for Bandali HTML.It's just a boilerplate.I don't have much there yet, but that's the idea.Sacha: I love how you can hook into all of these differentaspects of Emacs and get it to do exactly what youwant.Amin: Yeah, so that's cool.Let's see.
59:58chat notes
Amin: I have written some things about the prompt for thismeeting.Yeah, so I talked about that stuff briefly.Minibuffer setup.Things that I love about my setup is that it's kind ofportable, simple.People can easily copy things from it if they want.It's kind of self-contained.And that was kind of a big thing a while back when Iwanted to use my configurations on a couple of workmachines.And these don't have direct outbound internet access.So I couldn't do things like installing packages withELPA because that's done over HTTP.So yeah, I use submodules now.I recently began documenting my setup, very muchinspired by Prot and Sacha and others.
1:00:52Mode line
Amin: The things that I'm looking forward to tweaking nextis the mode line.This is basically the default mode line of Emacs.A couple versions ago, they added a setting forcompacting the mode line, whichimproves a lot of the extraneous whitespace in it,which is great.It's still… There's too much information.If you use multiple windowsor even especially if you use EXWMall of those things like the dateor like the battery get repeatedin all of the windows,so I'm looking forward todoing my mode line in such a way thatfor example, it shows most of those things.And Prot actually hasan excellent video about thatwhere he shows how you can createyour own custom mode line.Sacha: I've also been temptedto start using the header line toobecause that's another thingthat you can put information in.Amin: Right, yep, header-line is awesome.
1:01:49display-buffer-alist
Sacha: Yeah, the display-buffer-alistis particularly powerfulbecause you're combining it with EXWM, so it'd beinteresting to see how you can manage windows andapplications and stuff.Amin: Especially, just like how we sawin today's video calland also a call that I had with Prot recently.For example, if I open a describe-variable orsomething, it'll by default use the right area of thescreen right now where our video is.So it reuses that.So I'm also looking forward to reading more about andconfiguring display-buffer-alist.
Amin: I'd like to figure out some TRAMP slowness.I recently tried using it again.It's awesome.You can seamlessly open files, SSH into othermachines and edit files there.But I don't know.It's kind of slow.So I want to see aside from the latency, you know, thephysical limit of the latency because of the distance.Is there anything slowing it down?I think I read in the Tramp FAQ that maybe trying todisable VC mode or VC detection for remote connectionsmight help speed it up, or at least having it do onlyGit, for example, because by default, Emacs's VC hassupport for Mercurial, CVS, SVN, Git, RCS even.Sacha: Anything anyone has ever wanted to use in thelast 40 years.Here we go.I saw in your chat config actually that you were doingsomething with the SSH configs and I'd never comeacross that.So I was like, oh, that's something I should look intolater.Amin: I don't remember the specifics, but it's allout there.Feel free to look into it.
1:03:39eat
Amin: Especially with this EXWM setup, I still use Xtermsometimes and I have the Emacs EAT terminal, which isa terminal emulator written in Emacs Lisp.If I launch it right now, it's awesome.It actually is very powerful and it's a properlycapable terminal emulator.It just can be a little bit slow.It is slower than xterm, but it's still a lot fasterthan whatever Emacs has built in.So this is pretty cool.But yeah, I don't want to use it a lot.And I kind of started testing, delegating morethings or using more async-shell-command to justbasically open this prompt and then do whatever Iwant.anyway.Sacha: I've also heard things about Ghost TTY.Anyway, so that's another thing to look into.Yes, so @Paniash47 says, "With Emacs 31, there's a newvariable where you can hide the minor modes in themode line."@pkal says it's mode-line-collapse-minor-modes.And @Paniash47 also says, "I personally use the Minionspackage by Tarsius, and it has some nice features inaddition to the built-in features."So other people are tinkering aroundwith their mode lines as well.Amin: Yeah, it's pretty cool.And then I don't know, I think maybe you touched onsomething a couple of minutes ago that I was going togo back to, but I forget.
1:05:07TRAMP completion
Sacha: Tramp SSH completion out of your configs.I was like, there's a Tramp sconfig in here that I'venever used.And that sounded interesting.Yeah, tramp-parse-sconfig.Amin: Ah, right, right, right. Yeah.Sacha: Which, of course, we're not going to let gobecause it's private stuff, but yeah.Amin: Right.Yeah, you're welcome to try this.I'm pretty sure, actually, I took this from the Trampmanual itself.And it's one of those things where it's set andforget, I don't remember.But yeah, it's here.There was something else that I also wanted to show,but I forget.Let me see if looking at the outlines will remind meor if I will see it.Sacha: And that's one of the things I love aboutliterate configuration is, you know, just kind of lookat the structure and skim it and try to find somethingwith keywords and ordered lists and all that stuff.Amin: Right. Yup. Exactly.Sacha: Oh, and you know, people will have access toyour full configuration because it is in yourrepository and you have that lovely HTML export for itas well.So if you, uh, if, if people want to follow up, theycan go through thatat length. At some point, you're going to add some morescreenshots and possibly even video clips to it.so that's there you at https://git.kelar.orgAmin: This is my configurations repository.If you go here to treeview .emacs.d, this is the orgfile.I also export all of those individual components intothis lisp subdirectory.All that stuff is here.The QMK thingy that was mentioned.
1:06:54ffs: form feed slides, ^L
Amin: Oh, I wanted to mention FFS.Okay, I'll do that as well.Yeah, what's up with that?Sacha: I was trying to find information.It was like, there's no package.It's not what is this thing?Amin: It's FormFeed Slides and it's going to soon bea package.I was actually talking to Prot about it and I'm hopingto submit it for inclusion in GNU ELPA within, I don'tknow, the next couple of weeks.It's basically very similar to Prot's Logos package.Turns out we both had the same kind of idea at theexact same time in 2022, and we both used it for ourLibrePlanet 2022 presentations.Of course, Prot being the diligent person that he is,he polished his work, documented it,put it on GNU ELPA.I still haven't gotten around to doing it yet,but better late than never.Yeah, let's see.I can maybe show a quick demonstration of that.So let's see.Let's see.Anyway, so if I go to my website sources andnet-beyond-web.So I had the LibrePlanet talk a couple years ago.So what FFS is basically, it looks for aparticular character in this case,or the default case,it's the page-delimiter, ^L,which you can insert by hitting C-q C-l.It basically then designates each of these areasas one slide. So, very, very simple slideshowthat you don't even have to use Org or outline or anyother major or minor mode. If I launch ffs,by default, it's in a mode where it binds a couple ofconvenience keys, like p and n, to go into the nextand previous slide.You can hit e to edit a slide, similar to Org source, andthen make your changes and all of that.And then you can start a presentation by hitting s.Amin: It has hooks for, for example, bumping up the font sizeor whatever, hiding the mode line.I can toggle the mode line by hitting m here.Let's see.I can also toggle the cursor with c, to make the cursorvisible or not.So, yeah.And then I'm just hitting p and n.Sacha: Very simple, very minimalist.You have a file, you've got page markers, and that'sall you got.Amin: Yeah, pretty much.And then…
1:09:34Speaker notes
Amin: The neat thing that it has that I also likedimplementing at the time is it has a speaker notesfeature.Amin: So you can designate a file as being the speakernotes where it has the same structure separators with^L. But you can type your notes over here,whatever.And you can basically open these in two differentwindows or two different frames on separate displays.And then in whichever one of those you advance theslides, like p n n, it also does the other one.Sacha: That's brilliant.I was looking for a way to do that so I can pretend toknow what I'm talking about when I have something onscreen, but I can just read my notes or even justremember what points I wanted to make.So this is great.You have speaker notes.You've got the main screen.They can be in two different frames.You can have your frame that you're sharing and yourframe that you're not sharing that has all of yourcheat sheets.Excellent.And on that note, in about one minute, the kid isgoing to come running out and want to have snack andall that stuff.Thank you so much for walking through parts of yourconfig.There is more.And so everyone who wants to find out more can gocheck out your setup.I have a great many things that I want to try out,starting from EXWM to little things like figuring outa boom mic setup because apparently your audio setupis making me very jealous.Yes, thank you for doing this.I'm going to post the transcript and the chapters.I have a chapter every minute.It's going to be a long time.But it was good.Lots of cool stuff.Thank you again.Amin: Sounds great.And yeah, you're very welcome.And thank you so much for having me as well, Sacha.I'm very delighted to be here, especially, I think,just by chance.I think I'm the first person who you're doing thiswith after the long hiatus.So that's an extra honor for me.But yeah, it's been fun.I could go on for hours.I'm sure we both could.This has been fun.Sacha: If we wanted to go on for hours,Prot has more flexible scheduling,so he can chat with people fortwo hours and stuff, and you already haveconversations going on with him.But I unfortunately have a small mammal who's 10years old and loves me very much, and likes to not letme concentrate for very long.But thank you everyone for joining.Thank you for the chat.And thank you also, stream,for all the interesting questions.I will send you all the informationand update the post.And we'll see you all on Thursday.I've got another chat.All of a sudden, all these Emacs chatsare going to happen.Thanks.Oh, and you said you're happy to be on the hook fordoing another EmacsConf this year, right?Amin: Yes. You can hold me to that.There will be another EmacsConf this yearand I will be active in it.Sacha: Alright then, I'm going to end that broadcast.Thanks everyone, bye!Amin: Thank you, bye bye!
IhorRadchenkoyantar92: … and the list can continue until the end of the stream? :)
IhorRadchenkoyantar92: do you compile those packages?
sachactube: Automatically compiled by prepare-user-lisp because of user-lisp-directory, I think
IhorRadchenkoyantar92: makes sense
IhorRadchenkoyantar92: this configure macro looks a lot like good old use-package
IhorRadchenkoyantar92: I just do (use-package foo :config ) and then :tangle no in actual src block
IhorRadchenkoyantar92: what is funny, with-eval-after-load is itself a macro
sachactube: hahaha, it's much smaller though
IhorRadchenkoyantar92: not smaller at all! Because there is recursion with-eval-after-load (macro) -> eval-after-load (also macro!)
IhorRadchenkoyantar92: hmm. wrong
IhorRadchenkoyantar92: ok. let me not do two things at the same time
blaiseutube: yay, I made it!
blaiseutube: screenshots and also asciicinema
blaiseutube: asciinema ?
blaiseutube: whatever
sachactube: and gif-screencast
blaiseutube: nice
blaiseutube: Sacha, your mic volume is just a bit lower than his so it's a bit harder (for me) to hear you.
sachactube: Hmm, let me try turning my dial, let's see if this next one is better
blaiseutube: better, I think
blaiseutube: it's also that Amin has an awesome microphone. The result sounds like Amin is in the room with me and we are both listening to you on speakerphone. it's not terrible
blaiseutube: we're all friends her
blaiseutube: here
sachactube: I think we have the same mic, but he has an awesome setup, so I'm going to bug him for tips =D
paniash47: Hello there! Nice to see this chat. :)
blaiseutube: yes, low gain and close mic is good. Sacha if prefer to avoid a boom, you can use a microphone with a tight pattern and increase gain. LMK if you want to unleash my inner audio engineer.
sachactube: oooh. my mic is right next to my laptop though, so I'm not sure I can get away from the typing noises
sachactube: I'll just have to get cozy with y'all
blaiseutube: mini buffet is an underrated superpower. I think Kakoune adopted that also
blaiseutube: helpful for a11y and users with sequential processing/ ADHD issues
blaiseutube: (I noticed that the comments are recorded so I'm trying to add value 🥴)
paniash47: Split keyboards make sense with vanilla keybindings. I'd like to switch but moving from evil is difficult :(
sachactube: much appreciated!
blaiseutube: what about "time since last save" or do you have some auto save magic?
blaiseutube: 🤯
blaiseutube: emacs all the things
blaiseutube: LOL, "I save everything regularly" …so he's one of those people.
paniash47: I think with emacs 31, there's a new variable where you can hide the minor modes in the modeline
pkal_: mode-line-collapse-minor-modes
paniash47: I personally use the minions package by tarsius (Magit author) and it has some nice features in addition to the built-in feature.
These are the bugs that have the “easy” keyword. Note that some of them are because of the package or mode name. =)
John Wiegley shared how he uses Gnus and Org to help him with the volume of Emacs-related information, and how people can get started with Emacs development.
View the full blog post for the transcript. Thanks to Phil Hudson for volunteering to transcribe this!
s: Hello, everyone! Hi, I’m Sacha Chua, and this is another Emacs Chat. It is December 10, 2015. I’m here with John Wiegley who has, since the last time we talked to him, become the Emacs maintainer, among other things. So we’re here today to chat about how he’s dealing with the increased workload and other cool things! John, over to you.
j: Thank you, Sacha. I’m glad to have this opportunity for us to talk again. It’s been a few months.
s: By the way, if you have questions, you can submit questions by commenting on the Event page where you found this, ????? etc etc, or using the Q&A app that shows up, or you can pop into IRC on the Freenode network and look in the #emacs channel and pose questions there. I’ll try to remember to sneak questions in at the appropriate moment. But I want to kick things off with some questions about your new workflow now that you’re dealing with the increased workload of a high-volume mailing list/newsgroup, called emacs-devel, and other things you deal with as Emacs maintainer. So, what do you do?
j: Well, certainly the emacs-devel mailing list is quite high-volume. My technique for approaching that has been to customize gnus until it makes it a more manageable source of information. I’ve had to tweak the scoring setup that I use. Gnus has a feature called “adaptive scoring” where it will observe what you read and what you don’t read and it will try to change the ordering and the presentation of the things you see in the *Summary* buffer when you go in to the newsgroup, based on your reading preferences, by observing your reading habits. That has been extremely helpful. That way, if a conversation has gotten very, very long and I realize that there’s nothing more for me to contribute on there, I can hit a key and never see that conversation ever again, unless somebody uses some sort of keyword that I have a flag for that will pop that thread back up for me. Meanwhile the threads that I’m most interested in, or the ones I’ve been replying to, they will go to the top of the buffers, so they’ll be the ones that I read first upon re-entering the group.
s: So you have something that automatically prioritizes the threads for you, based on whether you’ve replied to something or whether you’ve decided this is going way off tangent until it goes back on-topic. Not that I should be asking you which keywords should bring things back to your attention…
j: Right now, it’s “John?” (with a question mark): that’s the one that will pop any thread back up.
s: Alright, you heard it here, folks, if you need to get his attention, just say “John?” and John Wiegley will appear–himself–to deal with whatever’s going on. Actually, since you can share your screen through this videocast, is that something that you want to quickly demonstrate? Like, how this works. Not sure if that works live, because you may have to read things [out].
j: As I click on the screen-sharing button, it’s not having the [?????]
s: Hah! Technology. OK, well, you keep trying that. I’ll try to fill in this space…
j: Why would it not be there…
s: Hmm. OK, we’ll demonstrate with some hand-waving… OK, actually, one thing you can try–this may not break the system: if you refresh your browser, you might get dropped back into this conversation and that thing might work again. Let’s give that a shot. … OK, so while he’s coming back, and I hope this works, because otherwise: awkward! Gnus is a mail- and news-reader for Emacs…
j: Yes, that did work!
s: Perfect! All right. I was just telling people what Gnus is. If you would like to go ahead and demonstrate how this helps you with the prioritization… fantastic!
j: Are you seeing my Emacs screen?
s: I see your screen.
j: OK, so, with the key that I have bound, I will jump into Gnus. One thing you see here is that Gnus has the ability to create topics and to place groups under those topics. Though I actually have quite a number of topics, as you can see.
s: Wow. I did not expect that.
j: Yes. Normally a topic that has no unread groups in it is displayed, and there’s a key-binding that toggles these things. So we see that emacs-devel has gotten two emails since this livecast began. So if I hit return on those… I have the display customized right now so the number on the farthest left is the score that has been assigned to that article, just because I have been trying to fine-tune my adaptive scoring rules, so I want to be aware what effect my actions are having on the scores. I have another key to reveal all the threads. If I go back out and I grab the last 100 messages for example, then I can see that there are some very lengthy threads. I have a number here in this column [highlights fifth column – how do you do that?] that shows me how many messages are hidden underneath the thread. Normally I start and I just see this view, where the thread with the aggregate highest score goes to the top.
s: Wow. So this is a thread with a 90 score and 42 messages under it?
j: Well, 90 was the score of the top message in the thread, or it might have been the aggregate score. I can hit a key to see what the score of the thread itself was. So 90 was the aggregate score, and the score of the article itself was 30. It would have gotten the score of 30 because it would have noticed me reading a message from this thread in the past. Every time I read a message in the thread, the subject of that thread gets a bump of 1. I must have read 30 messages within this thread already, to have a score of 30.
s: So folks, write good subject-line headers so John takes a look at your message.
j: Subject lines are important. Gnus is very handy for example when we have a really long thread like this and someone wants to bring up a side point. We instituted a policy of changing the subject line when you do that. When you change the subject line, Gnus has a way of making that appear as if it’s a new thread. You see this “Casting as wide a net as possible” thread? This actually was a part of the “First draft of the Emacs website” thread, but because the poster, John [Yates] here, chose a different subject line, Gnus presents that to me as if it were an independent thread.
s: And that also allows you to track your interest through adaptive scoring, for that particular subtopic.
j: Right, right. It all plugs into adaptive scoring quite nicely. As a result, even though there are days when the number of unread messages in the emacs-devel group will easily reach 200 by the end of the day, it’s not that difficult to get through them because Gnus presents them to me in roughly the order I ought to read them. If I start seeing that a thread does not really need my involvement, I can start scanning quickly, or just tell gnus I don’t want to participate in this thread from this point onward – unless, of course, someone asks for me.
s: You’re getting quite a few people more interested in Gnus, according to the #emacs channel.
j: Gnus is incredibly wonderful. Let me tell you, Gnus and Org both, they’re my mainstays in Emacs. They’re the two applications that I always have running. Gnus is somewhat like Emacs itself. There is a learning investment to be made, but I do believe it pays itself off, many times over. Further, Lars has done a brilliant job with the gnus manual. It is not only highly informative, it is very funny. It’s worth reading from front to end, more so than any other technical manual I have read. I get quite a kick out of many of the paragraphs in the Gnus manual as I go to read about different things.
s: Was it you who also pointed out that the Calc manual was also very interesting reading? So it turns out that the Info manuals for Emacs packages tend to be quite interesting reading and very useful reading too.
j: Oh yeah. I would recommend to anyone who wants to get started with Gnus to first acquire a brave heart. It’s not going to be an easy task, but… Go through the setup instructions. Get it connected to your mail source by either reading the mail from a directory or using it over IMAP. You will find that using Gnus over IMAP is very slow. This puts a lot of people off. What I do is, I have all of my emails get to delivered to GMail, because they have excellent spam-filtering services. I use fetchmail to pull the mail from GMail down to my local machine, where it gets queued into a Dovecot server that I run locally. Then Gnus talks to the Dovecot server over IMAP, and that is a very fast connection. And it lets me do local searches of emails, so that even if I don’t have Internet connectivity, I can always search all of the email I have. That’s quite a lot of email. In my dovecot, there’s probably close to a million email messages in there.
s: A million! One of the things that I want to mention is that a large part of that million is the entire emacs-devel archive, right?
j: Well, it’s the emacs-devel archive, the emacs-bugs archive, the emacs-help archive, the sources archive… Usually, if I actively participate in a mailing list, I like to go download all of its past email, so that if people make reference to previous discussions, I can see those discussions without having necessarily to be online.
s: And that takes advantage of Gnus’ ability to show you all of the messages within a given thread. It knows about them.
j: Right. Let’s say I’m on this message here, which is a response to this thread called “New update of the Emacs website”, and I want to see the context. I can hit a key, and now all of the members of this part of that thread come into my buffer. So you’ll see the lines of blue here, the ones that are now inserted… I’ll do that again, so you can see what happened. Let’s go in here [emacs-devel summary buffer] So we see that there are three lines in the summary buffer. I hit A T, and now there are 25 lines in that buffer. So I get to see the message I’m reading now in the full context of the thread in which it appeared.
s: Right. So Eric has a question, which he submitted through the Q&A thing. This seems like a lot of reading. How many hours a week do you spend on Emacs maintainer stuff?
j: I would say that in reading the emacs-devel mailing list, it’s between one to two hours a day, probably (and responding to them).
I do not spend as much time fixing bugs or writing code as other contributors to this project do. So for example, Eli Zaretskii spends a very large amount of time addressing bugs and taking care of the stability of Emacs. I rely upon him a lot for his technical expertise.
I spend more time reading the messages, trying to see which people issues there are, what things need to be changed in our organization, in our structure, so that all of these resources that we have in the community can be effective and can smoothly head us toward the next release. We have a lot of excellent people, excellent developers and volunteers and contributors. It doesn’t necessarily need me to do all this work. We have excellent people to do that. I just want to make sure they have what they need to get their jobs done.
s: That’s an interesting approach to take in terms of maintaining an open-source project. It’s less about making all the technical contributions yourself and more about unlocking the awesomeness in the community, coordinating people’s efforts, reaching out to people and pulling them in.
j: Right. And specifically I want to emphasize or focus on that at this point in time, because I feel like we do have a much better community than we’re taking advantage of for core Emacs development. There are the Emacs developers, who at the moment are fewer in number and maybe even a little bit overworked. Then outside of that core community, we have a much larger community of people doing excellent work on external projects that are not part of core Emacs or are not in ELPA. They might be, for example, in the MELPA repository. If I can bring some of those people and attract some of those outside people into the core development, then our job gets a lot easier. That’s going to be much more effective than just me becoming another programmer within the Emacs project. If I can get five other of those people to come in, that’s going to be five times what I could have contributed, for example.
s: That’s awesome. So I guess some of these people might be hiding out in emacs-devel, but where are you keeping an eye out for these people you can recruit basically and bring into core?
j: In IRC, in Twitter, there are people that I know personally who are for whatever reason on the outskirts of emacs-devel. Apparently–they’ve told me–there have been past issues with things not staying on-topic, or things getting a little out of hand, or patches dying as they get submitted and then ignored. I want to make sure that their concerns are met and we resolve those problems, which are really more human-scale problems than technical problems. If we can do that, then these people I think will come back. That will just make it easier for all of us to do our jobs.
s: I can see how like the mailing-list interface with threads and things like that… if you think about it, there’s the mailing list, and then there’s the bug tracker, where you’ve got like “This is broken”, “Maybe there’s a patch needed for this”, but there isn’t really that trackable middle ground that says “Here’s an idea that I’ve been thinking about,” and maybe that’s why some of these ideas are getting dropped. Can you share a little bit about how you’re starting to keep track of the different balls that are in the air, the different things that you have on the go, to make sure that those things aren’t falling through the cracks?
j: That’s an excellent question. I guess you might say that one of my tasks as maintainer is to keep an eye on these more inchoate or intangible things that people request or ask for that aren’t necessarily bugs, so they don’t necessarily belong in the bug database. They are ideas that get discussed on the mailing list, but as you say, when the thread gets cold, the idea might get lost.
So what I do is: when these come up, I have an Org-mode file that I try to track all of the ideas or the things people have suggested or expressed concerns about to make sure that something gets done. Either they get addressed or they get knowledgeably closed–to say “No, leave it. We considered it but we’re not going to do it.”
You’ll see that in my Org file here I have many top-level categories. There are things here, issues pertaining to the community; initiatives – things that I might want to begin but are not being done now; analysis is a little sub-project within Emacs to become more aware about potential bugs or performance problems that we might have, things that aren’t in the bug tracker.
And under each of these, I have several keywords that are labeled as “Project”. I have a project here for making improvements within our community. One of the things I did, for example, was ask you to be our ambassador and keep us all aware of things outside of core development. Making sure responsibility for more aspects of Emacs development is distributed more evenly among the contributors so we don’t get burn-out. ELPA and changing the way we use ELPA… I’d like us to rely more on ELPA, have it be an easier and more facile way for people to get code into Emacs. And of course also the release schedule.
Under these projects, then, I have various TODOs. Often–especially if they have a name here in parentheses–it means it links directly to a mailing-list article. If I hit a key to visit the link, it will pop me over to the emacs-devel mailing list and then show me that message in the context of its discussion. Or I could also then again press A T and then see it. (Although that didn’t work because I only have A T configured to work in the current group. Anyway.) But that gets me back to the original discussion about why I created that task.
s: So I can see how this gives you an overview of the different initiatives that are going on, and lets you review this to follow up with the things that might be falling between the cracks.
j: Right. The first line of activity I do is to follow the mailing list and anything that needs to be responded to there. I also like to read through the diffs log and see what changes have been made to Emacs, to see if there’s anything that needs more attention. I subscribe to the bug tracker so I see every bug that comes in, and I try to make sure that at least some response is made to every bug although I don’t always have the time for that. Then the last thing, of course, is these other things, these other non-bug-type tasks and tracking those. I’ve not been as good lately at keeping on top of this list as I have at keeping on top of the mailing list, mainly because these holidays that we’ve had with Thanksgiving in the United States and some work trips have put me a bit behind. But I do want to get back to this Org file and close these things out because people deserve to be responded to. Everything in this file represents something I felt was a legitimate concern. When people feel that they are being responded to, I think then they will be more encouraged to take part in the core Emacs development process.
s: Is this a file that you’re publicly sharing, or can you be convinced to share this to give people the same overview that you have?
j: No, but of course I would like to maybe do something semi-regularly to capture the state of Emacs development. Have not yet, but that’s something I’ve considered doing.
s: That’s cool. So you’ve got this Org file that you create as you read through emacs-devel messages, bugs and things like that, and you can jump from this Org file back to the original messages. You mentioned on IRC before you also use Gnus to read the bug reports. I think you mentioned that Gnus can show the bug reports for a specific bug or the conversation for a specific bug easily. Is that something you can quickly demonstrate?
j: Sure. So here we have for example bug #19547. I want to see the context of that bug. So there is a command called gnus-read-ephemeral-emacs-bug-group. So now I can put in here [entering text in the minibuffer] 19547. That will contact the debbugs server for the Emacs project and show me the whole conversation history of that bug as an ephemeral group, which means a group that gnus has created on the fly. That will disappear once I have left that group. This way, I can then read through the exact conversation history that has occurred in that bug.
s: I see. So it lets you see the entire context of it, and then you can add links to more information in your Org file as well.
j: Right. So if I’m in here and I hit a key, what it will do is create a capture buffer that links back to that email instantly. And then I just have to hit C-c C-c and then this will be added. Or I hit C-c C-w and then I am prompted for where in the Emacs [Org] file I want to put this issue.
s: org-refile is so powerful that way. So Gnus and Org help you deal with the volume that’s coming in and keep track of what’s going on. Are there things that you think either future maintainers of Emacs or maintainers of packages that are within Emacs, any tips that they would find useful?
j: You mean in the use of Gnus and Org?
s: Or other little scripts or tools that you’ve found helpful.
j: Nothing in particular. I think every maintainer has his own way of doing things and his own areas of interest, so everybody should pick whatever tool works for them.
s: Let’s see, just a quick check for people’s questions… You’ve let people know about Emacs-tangents, which is a fairly new mailing list. Some people didn’t know about that yet, so that’s cool.
One of the things we wanted to talk about was your workflow for dealing with Emacs, and also some of the ideas you had for improving the community and taking it forward. You’ve shared some of it in terms of making emacs-devel friendlier, bringing in people who are not core maintainers… Are there particular areas you want to encourage people to try contributing to or any resources you think might help them get started?
j: Sure. I think there are three areas in particular where I would really appreciate help.
The first would be: writing more tests. We’ve started creating headless tests that run as part of the Emacs build when you do make check using the ERT framework, which is an Elisp framework for writing tests. I know that you use it for lots of things, so you understand its value. We do not have coverage of many parts of Emacs, so people coming in who want to write new tests to address areas we’re not currently testing would be incredibly valuable.
Improving our documentation, especially with an eye to how it reads to someone who’s not familiar with a certain subject area would be very helpful.
And then going through our bug history and finding bugs that have just never been responded to, or that are no longer an issue, checking which ones are still reproducible and which aren’t, and if they are, making comments in the bug to say what you discovered in trying to reproduce the bug.
s: And maybe adding a test for that too.
j: Well that would be ideal! The ideal would be to find a bug, add a test, add something to the manual that’s appropriate for that bug. So these three areas: bugs, tests, and documentation, are the ones I would like to see addressed the most.
Emacs core is really a foundation upon which a lot of things are built that are not part of Emacs core. The thing I want most for Emacs core is not necessarily to add in more features and functionality, I would like it to be a more stable foundation, so the more complex applications like Org and Gnus that are built upon Emacs, there’s less of a moving target. It’s very efficient, it’s very well-performing, there are no crash bugs, those types of things. That’s why I’m placing an emphasis for volunteers to contribute on bugs, tests and documentation, because it will help give us that stable foundation to build other applications on.
s: I don’t suppose there’s any pretty coverage report for Emacs that people can just look at and say, OK, this file was not covered yet, so people can easily see what needs testing.
j: Phillip Lord recently rearranged our tests so that they mirror the files that they’re testing against in the various source directories. You can see from that which files in the source directory have no corresponding tests at all. If you pick a file that relates to a feature you care about, see that no test file for it exists, then you can be the first person to make that file and create the first test. Every test is valuable. I’m not asking people to commit only if they’re willing to write hundreds of tests. If you want to come into the Emacs project, get familiar with development, building the current version of the sources on your own machine, and just write one or two tests, I’d be happy with anything.
s: Maybe one way to make this process a little less intimidating would be, can you walk us through what a super-simple Emacs core test looks like, how to run it and see how that all works?
j: [????] just getting the community stuff up and running. This is not something I’ve been doing myself.
s: We’ll find somebody else to corner into doing a quick demo.
j: This is my checkout of the Emacs source tree.
s: Do you want to share your screen?
j: Oh, sorry, I forgot. OK, do you see this? So I have a clone here of the Emacs development tree, which I tend to build from day to day, just to make sure everything is going sanely. We have a ‘test’ directory in this [????], and there you’ll see we have an ‘automated’ directory, which is where Phil Lord put all of our automated testing. Inside it here, we have all kinds of automated tests. For example, here are some eshell tests. They require in ert and eshell. And then ert-deftest is the command to execute [well, define] a test. So I say that the result of evaluating this [highlighted] form should be equal to 3. And that way, when I do ‘make check’, it will run this code and ensure that [????] is 3.
s: So as we can see, the tests are really easy. They can be pretty short. They can be really simple. You don’t have to get in deep with lots of C or whatever else to write them. You can just use this to get started. And it’s all in Emacs Lisp!
j: I haven’t pulled in a little while. Let’s see…
s: Probably not a good idea to mess up your git checkout…
j: Oh, I can’t pull because my smartcard authenticates my SSH logins and I don’t have that card plugged into this machine.
s: That’s cool. So there’s a lot of code in Emacs. Much of it is not yet tested. It’s great for people to contribute tests. But Eric has another question: “Are you considering moving stuff out of core to have that smaller, simpler, better-tested core, and more things in packages?”
j: Yes. Yes, we are. So right now we have a few areas. We have core Emacs. What we would like to have is a concept within ELPA of “core ELPA”. Core ELPA are packages within ELPA that core Emacs code is able to rely upon. That will happen by a process where core ELPA packages will be copied into the Emacs source tree from time to time, so that core Emacs can directly depend upon them.
Then on top of core ELPA, there will be “tarball ELPA”. These will be packages that are within ELPA that are not copied to core Emacs, but which are made part of the release tarball before it goes out.
Then finally we will have regular ELPA, which will be packages that are installable through the M-x list-packages interface but that will not be in the tarball distribution.
Right now, core Emacs has a lot of very large things in it and a lot of packages in it that don’t really necessarily belong there, because they’re not part of the foundational API that I really think core Emacs represents. We want to take a lot of these packages and split them out into one of these ELPA categories. Very likely, everything that is currently in core Emacs will be either in core ELPA or tarball ELPA. We won’t be moving it out of the distribution entirely, but doing this will make the core be smaller. When you look at git, and see what’s been changing lately, that surface area will be smaller, but it also gives contributors from the outside ways to get things into the tarball distribution without it having to go into core Emacs.
s: I can see how that would also simplify the update process for those packages.
j: And it gives people a way to receive, to subscribe to a channel where that package will be updated frequently, even though Emacs releases might be [????]
s: Right. Cool. Simpler core, better tested, stabler core, and then this kind of split between important things that are in ELPA that core relies on, and things that are optional–used to be there, so you don’t want to break anyone’s expectations, and so they’ll be within the tarball–and of course your regular ELPA and MELPA and the other package archives as well, this universe of packages to choose from.
j: Right. I think ultimately the destination we’d like to end up at is that there’s a core set of functionality without which Emacs cannot even be Emacs, can’t even edit files, and that defines a sort of fundamental minimum. Then anything that that fundamental minimum depends on is by definition a package that has to be in the core. That network of dependencies among this minimum will be what has to be in core, and then as much as possible that does not fit that description will go into tarball ELPA.
For example, tetris. tetris is a neat module that is great to have on any machine just to demo how cool Emacs is, but the core foundational API that Emacs core represents doesn’t really need tetris to be there. So that can be moved to tarball ELPA very easily.
s: Well, I’ll come up with an objection about how essential tetris is to Emacs’ programming, but that is a very good example, yes.
j: I think it’s a good thing to always have be present in an Emacs installation. It’s just… we want the core developers to focus on the set that really matters in terms of defining the foundational API. Also, what’s in core should always be documented, should always be tested, as part of the automated tests. Not every package that we have in core Emacs today really needs that level of rigor. Tetris does not need automated tests, does not need a lot of documentation. So it’s a perfect candidate for being in tarball ELPA.
s: There is some outrage in the #emacs channel over your dissing of tetris.
j: I love the tetris module! Didn’t people hear me? I just said it always should be present in any machine that has Emacs on it.
s: I’m not sure if auto-tetris counts as automated testing for tetris, but there is a thing that automates it.
j: Cool.
s: So people can contribute by writing tests. Tests will help all that stuff happen better. Maybe at some point we can have this nice graphic that shows which files are getting how much percentage coverage. All these lovely motivating graphs, things like that. Then, of course, as you mentioned, there’s documentation to write and bugs to see if you can reproduce.
j: Then there’s one more category that I’m personally quite interested in, which is someone to focus on and sort of take ownership of efficiency and speed of Emacs. That would require writing another… not test suite, but benchmarking suite, that if I run it will give me a table of numbers to say how fast certain Lisp operations are, how fast buffer manipulation operations are, how fast starting up a graphical Emacs and creating a whole ton of frames and closing them all, how fast that is, and then to have a way of, against two builds of the benchmarking suite, [????] the delta, and then designate a build machine that somebody will volunteer time on, where they are willing to run the benchmarking suite against the current development branch every single day, and maintain the running delta as some sort of graph that shows us are we getting slower or are we getting faster in certain areas, and where are the areas that are currently the worst. Today, a thread came up on emacs-devel saying that playing back keyboard macros that involve very, very long lines–like lines that are 11000 characters long–is a very slow thing. And you think, well, that’s not entirely terrible, because how often do people do this? But it would be nice to know where these current limitations of Emacs are, and which are the ones we want to address.
s: Right. And if someone has just committed something that makes something drastically slower, or drastically faster…
j: Yes. I’ve noticed that 25.1, the release candidate, even when I build it with full optimization on, takes exactly twice as long to start up my Emacs as 24.5 does. So it’s a difference of 4.3 seconds versus 8.6 seconds. And I would like to know why is that, and when did that happen? I don’t have right now a benchmarking suite that I could just use git bisect to just take me back to the day when it got slower, so I’ll have to do a specific profiling analysis to find out what made it slower. But if we had a benchmarking suite in place, I think we’d have a lot more consciousness of the ways Emacs is evolving in terms of performance and efficiency.
s: I’m hearing that as part of a general improvement of the build tools that Emacs is using is the idea of having these continuous integration and efficiency metrics and things like that happen, so that people don’t have to keep building these little tools themselves to mess with that.
j: There are plenty of great tools out there for making this happen. I think what we need right now is we need a volunteer willing to devote themselves to seeing this happen and keeping it going.
s: It is a fair bit of heavy lifting to get started, but once it’s in place and keeps running, we hope…
j: Right. Anybody out there who loves both Emacs and performance, get in touch with me and let’s start that going.
s: Yeah. In terms of talking about Emacs startup times, I remember in our conversation about use-package, that was one of your key motivations for being able to find your own autoloads and load only the packages that you were actually using. A faster Emacs… Schools of thought are divided on this: some people do start Emacs all the time, and some people just leave it running. But everyone benefits from having things work faster.
j: Right. When I’m not working on Emacs modules, I tend to just start Emacs once in the day. But if I am working on a module, I want to make sure that I’m always testing my changes against a clean environment, I will exit and restart many, many times during the day. That’s what led to my desire for faster startup.
s: Then in terms of other build tools or development-related initiatives, there’s definitely the good news it’s already happening. I think you mentioned–you vaguely mentioned looking into Github and pull requests, something along the lines of making it easier for people to contribute?
j: This would not be something that is officially endorsed by the FSF. I have a mirror of the Emacs development tree on Github. If people want to make pull requests against it, I will copy those over into the proper channels by hand. But that is not an official portal for either receiving bug requests or pull requests.
s: OK. It’s good to play around with different ways, different channels of bringing things in, so thank you for doing that work by hand, if anyone wants to take advantage of this completely unofficial, not at all sanctioned way of submitting changes.
In terms of people getting started with Emacs development and Emacs contribution, documentation is probably the easiest for people to get started with, testing with a little bit of Emacs Lisp, digging in to bugs and making that better, and of course if you’re interested in performance and efficiency, actually building the infrastructure to make all that testing easier, some of the ways people can contribute.
What are some of the other things you would like to encourage people to look at and contribute to in terms of the community or reaching out? It’s interesting because there are a lot of people coming into Emacs but there’s also a continued perception that this is hard, this is difficult to learn, and there’s 20 weeks of configuring before you can get somewhere. Do you have any particular thoughts on making it easier at that end as well?
j: Not necessarily. I think some people out there have been doing good work towards making some starter kits and tutorials and your own videocasts, Sacha, have been helpful to a lot of people, “Emacs Rocks”… There’s different venues for creating information to attract people or interest people in Emacs. The Spacemacs project has been making Emacs a more comfortable environment for Vim users, for example. So there are things going on in the larger community. That’s something I want to see happen, but it’s not something I can have as an area of focus, since it’s really getting the core foundation stable that is the responsibility, I think. But part of me wanting you to act as our community ambassador was to help keep an eye on those needs in the greater outside community, and if there’s anything core developers can do to help support that.
s: I should remember whenever I come across interesting stories, to fold them into the EmacsWiki, which seems to be on its way back up again. People are adding to it and referring to it, which is good.
j: It’s a fantastic resource. I really recommend it to anybody. I continue to discover nuggets within it from time to time.
s: Just randomly browsing?
j: I often randomly browse, yes. After I’ve worked for an hour, I’ll sometimes just wander and stumble through the page links.
s: Cool. So, let’s see what other things people want to pick your brain on in terms of Emacs and development. Last time we talked, we were sharing Emacs development tips. You shared quite a few with redshank and elrefactor and all of that. Are there other tools you’ve found to be particularly helpful now that you’re reading a lot more code, I guess?
j: Well, I rely very very heavily on Magit. Anybody that uses git should definitely look into that. It’s also an application that I’m almost constantly in as my dashboard while working on a project. Projectile is another thing I’ve also greatly enjoyed, as a means for jumping to files in a project or grep’ing across files in an entire project. Flycheck is another excellent project, helping me keep an eye on errors I’m making in the buffer as I’m typing them.
s: Cool. Yeah, they’re all very well-reviewed, and people are very happy with those packages for sure.
j: Are there any more questions coming in to you from your various sources?
s: Hang on a second… oh, OK, so there’s a question from [????] on whether bootstrapping Emacs Lisp in Emacs Lisp is a long-term goal so that you get rid of the divide, making the C core as small as possible and doing as much as possible in Emacs Lisp, so that people can contribute more, even if they only know Emacs Lisp?
j: The answer to that is yes. When it will happen, how it will happen, I don’t have the answer to that today, but we would love to have the Emacs Lisp part of the whole Emacs equation be as large as feasibly possible.
s: And then of course every so often people are curious about having other extension languages and other capabilities.
j: Of course.
s: I haven’t been keeping track of Emacs-devel conversations about that though. Do you have any idea of where things are in terms of the big questions that people have like Guile Emacs or multithreading or this lexical-binding that’s starting to show up in the cookies in Emacs Lisp files?
j: Well, so those are several different questions. Guile Emacs is of course always progressing and I’m curious to see what will become of it. It’s not quite at the position right now where it’s something we seriously need to consider integrating but I am very curious to see where it goes and how it evolves, so I keep an eye on that.
Lexical binding is something that I hope will become more and more used and prevalent because it promises to resolve certain performance issues we have right now with dynamic binding and the need to look up a symbol within the most global possible scope every time there’s a variable reference. So you will see that being used more and more.
Otherwise, what we have today, the C core works pretty well for us as a base foundation language. Emacs Lisp is working pretty well for us. I mean, nothing that we’re doing now is preventing anyone from writing great stuff on top of Emacs. So, yes, little advantages could be made here and there by making certain changes, but we have to assess those and what value they offer as they come up. If people have particular ideas, of course, emacs-devel is the place to bring them up.
s: OK. Things are happening, and go ask on emacs-devel if you have further questions.
j: Yes. And I encourage anybody who has a deep concern about the future of Emacs to join emacs-devel and be part of the conversation.
s: You’ve started summarizing some of the longer and more involved conversations in emacs-devel proposals on EmacsWiki, right?
j: Yes, we created a Proposals page so we can distill the final result of very very long and large threads in a way that other people can review them and see what the final proposal being made is.
s: One of those long discussions happened around the time that you were also discussing your maintainership, was Emacs vs IDEs, the features that were missing, the integration of all of that together. What’s happening with this modernization of Emacs’ feature set? Additional more IDE-like features? Is that a thing?
j: Yes. We would like at the core level to have a better API and certain more general APIs for features that have become common to people in other editing environments. So the notion of what is a project, what is the membership of a project, how do you navigate within a project. We’re at the point where there are a lot of disparate features we’ve got out there in the Emacs ecosystem for getting completion lists, for auto-filling or providing automatic documentation for the thing that’s around point. Everybody is solving it in different ways because there aren’t always necessarily good APIs existing currently within core. We’d like to have those APIs in core so that people don’t have to reinvent and recreate the same back-ends for looking up symbols within projects over and over again for the various languages.
s: That makes sense. Once it’s moved into core, then it becomes something all these packages can rely on, instead of having them depend on something, but then somebody else wants to depend on a different package for very similar functionality.
j: Right. What it will look like in the end to use such an IDE-empowered Emacs, I don’t know yet. But I think right now the first question to ask is, what are those APIs? And what should they be? To enable package authors to take the best advantage of the information that’s available within the environment.
s: So I guess part of that is taking a look at the common packages that people are using for this and then trying to abstract what they’re doing in a way that then allows them build on top of that common ground.
j: Exactly. And the ultimate hope for that is that if we have, for example, an underlying API that company-mode as a completion API could rely upon, then the back-ends that you write to provide the information to company-mode could be used by all the other modes that want to glean that information about the symbols that are relevant to point within a project. So then auto-complete could use that, and helm could use it, yasnippet or dynamic-abbrev or hippie-expand or whatever, they could all use it. Now I have myself re-coded the same back-end with very subtle little changes many times just because I wanted to have that functionality available to several packages. Similar but not exactly the same.
s: Refactoring is hard. There’s always little subtleties about how you want to do something that other packages don’t quite do.
j: Right. And I think that core Emacs can better support those package authors in that way by creating a standard, a standard framework within which to capture and ask for this information.
s: That makes sense. Alright, we’ll get the core stable, and then we’ll start moving more things into core, and by that, it’s like you know, out of the C core and into Emacs Lisp, and out of packages into Emacs Lisp where it makes sense, but some things will be moved out of core and into ELPA core and ELPA tarball so that it’s easier to have this well-tested, stable core.
j: With the end goal being: make it an easier job for the core developers who are currently there, and make it easier for new people to join, because it won’t be such a huge body of code for them to approach.
s: I wonder, are there other open-source projects that are also working on expanding their core developer community, and they do that by things like hackathons or [????] this pre-reviewed list of bugs that are super-easy and simple to fix and maybe even have mentors attached to them. I can’t remember if Emacs has one of these things already. I vaguely remember browsing through debbugs and seeing some of them were tagged with “newbie” or “documentation” or whatever, but… do we have anything like that? To guide people into specific small non-intimidating areas where they can start making those contributions?
j: I seem to recall hearing about a keyword we had that was similar to this, but as far as having a hackathon with a bug bounty list, I haven’t seen that yet, and I would love to see that. That would be an excellent way for people to know right where to jump in.
s: Maybe that’s yet another way for people to contribute: where you can just triage the bugs and say, you know, this is a super-easy bug to fix, go ahead and try it out, if you get stuck, talk to me, I promise not to bite. We’ll see where it goes with hackathons and the IRC channel and all these other ways that people can coordinate.
Awesome! We’ve covered a lot of ground today.We’ve talked about the tools you are using to keep up with all the volume and keeping that overview. So, Gnus is awesome, and Org is awesome, all those things together are even awesomer; in terms of the community, how people can contribute; really, Emacs-devel… I remember dropping into it every now and then before, massive threads, hard to keep track of, and now that things are getting split up into different subject lines, that’s so much easier. So emacs-devel and various other places are becoming friendlier places, easier to keep track of. And then of course this overall movement of Emacs source code to be smaller core, more stable, more tests and all that stuff, and then all these packages to go. I’m going to wrap up here, because my throat is starting to give out. Thank you so much for sharing your thoughts and your tips for using all these tools you use to keep track of what’s going on. And thanks again for doing such a wonderful job as maintainer. I look forward to seeing what Emacs will turn into!
j: I also lastly wanted to say that if anyone out there is having difficulties contributing to Emacs, or they have found a stumbling block or a reason for them to have become disaffected or leave the community, to approach me directly about those things, because solving those problems is to me right now more important than solving specific technical issues. So my email address is johnw@gnu.org and it’s always open to people who have concerns about Emacs and where it’s going.
s: And I can vouch for you being an awesome person who definitely helped me get into Emacs development stuff when I got started in 2000-whatever so I can’t wait to see who else you bring into the community from there. As mentioned you can find John at johnw@gnu.org; are there other places people should go and find you, just in case you’re interested in finding out more?
j: On Freenode, I’m usually in the #emacs channel there.
s: And on Twitter?
j: I’m on Twitter as well, as @jwiegley. And of course the Emacs-devel mailing list. Love to see you there!
s: Alright then. I’m going to wrap up here. The recording will be available from the same place on Google+ and I’ll post it in all the usual places as well. Thanks again for joining us for the broadcast here and thanks everyon for listening.
j: Thank you, Sacha.
Thanks again to Phil Hudson for the transcript! =D
Emacs as a Lisp environment. (Also, Helm is what’s responsible for the display.) Evaluating a function makes it available in the global scope, which has all these functions and commands you can do. This makes it easy to iteratively develop your functions, because you can just execute things directly.
Edebug with C-u C-M-x. Interactive debugging. SPC moves you forward, one Lisp form at a time. It shows you results in the minibuffer. You can descend into Lisp forms or go into functions. ? shows keybindings. Check out the Emacs Lisp chapter on EDebug, highly recommendeg.
eldoc: Seeing arguments in the minibuffer as you type, because no one remembers all the arguments anyway. eldoc-mode, or add (turn-on-eldoc-mode) to your config.
What functions should you call in the first place? What concepts? Emacs predates many standard terms, so that’s why things are a little confusing. Ex: “frames” and “windows” are not what you might think they are. OS window = frame. Area within Emacs = window. Opposite of HTML. Use the Emacs tutorial C-h t.
C-h f (describe-function) shows the help for the function. Nearly all functions you’ll probably call are documented well. Lots of options. Check out C-h f for interactive, for example.
Paredit editing capabilities. Ex: C-k kills the current sexp. paredit-raise-sexp replaces the parent sexp with the following sexp. slurping and barfing. Barfing – spitting out an element from the list form. C-{ or C-} (with suggested keybindings). C-( and C-) are slurping, which pulls forms in. Works for strings, too.
redshank (companion to paredit) for refactoring. Ex: redshank-condify-form converts an if to a cond for when you realize you’ve got more than two conditions.
Profiler M-x elp-instrument-function, then call the function, then elp-results will show you the time it took to execute. Results aggregate, and are reset when you call elp-results.
Measuring memory consumption. Also, internal representation of lists. reverse vs. nreverse. Like nconc, nreverse, setcar, setcdr. This can greatly speed up your code, if you can avoid using the garbage collector. EmacsWiki – memory-use-counts, but not particularly helpful? Another package that extends the Emacs Lisp profiler? Avoid premature optimization.
elint and flycheck? flycheck’s designed for external processes, so that might be a challenge. Possibility: use async to spawn another Emacs? Doesn’t seem to be available yet.