This month’s Emacs Asia-Pacific (APAC)
virtual meetup is scheduled for Saturday, November
28, 2026 with BigBlueButton and #emacs
on Libera Chat IRC. The timing will be 1400 to 1500 IST.
The meetup might get extended by 30 minutes if there is any talk, this
page will be updated accordingly.
If you would like to give a demo or talk (maximum 20 minutes) on GNU
Emacs or any variant, please contact bhavin192 on Libera Chat with
your talk details:
0:32 Human-Computer Interaction (HCI) research into dictation challenges, voice repair
3:42 The window manager
4:28 Earwig
5:49 An overview of related research papers
8:04 Composability
8:20 Discoverability
9:37 Using large language models for voice repair
14:11 A hybrid model combining dictation and typing
15:43 Independent changes, and sharing ideas
17:08 Hammerspoon
22:00 Learning how to communicate with the computer via voice is like learning to type
22:40 More attempts
23:10 We need a which-key
23:22 More attempts
24:52 Emacs, Hammerspoon, and the browser
25:56 More dictation challenges
27:38 Command mode and dictation mode
28:40 Mispronunciations and dictionaries
31:35 Complex commands
47:50 Muscle memory
49:13 Personalization and collaboration
52:33 Composing sequences of commands
53:48 Transcription in the background
54:50 Talking when there are other people around
56:02 Emacslisten and Emacspeak
57:02 Recording on the go
59:25 Predicting the next token in phony
1:00:32 Interactive completion interface for phony commands
1:01:39 Working with other applications
1:02:19 Voice repair with LLMs
1:03:23 String distance
1:04:11 Prioritizing more literal matches
1:05:09 Approximate match on invisible text
1:06:13 Constrained grammars and Talon Voice
1:08:02 Multilingual
1:10:46 Editing text
1:14:44 Large language models and context
1:17:26 Using Emacs to talk to websites
1:18:16 Communicating with terminals from Emacs
1:19:18 OBS and other programs with sockets
1:19:59 Youtube and org mode
1:21:35 Customizing emacs for your needs
1:23:13 Little microphones
1:26:23 Maybe a monthly meetup
1:27:14 Back to talking about inexpensive little microphones
1:28:58 What's next
1:30:58 Figuring out a smoother on ramp
1:33:50 Monitoring multiple audio devices
1:36:10 Directing speech recognition results into etherpad
1:37:33 Questions and answers from irc
1:38:35 Transcription in the background
1:40:36 Mostly constrained by imagination
1:41:30 Putting it to work
1:42:43 Sharing common components
1:46:40 Modifying how phony parses things
1:49:18 Regular expressions
1:59:32 Figuring out words in context
2:01:33 More about voice repair in large language models
2:02:17 Regular expressions, and grammar portability
2:03:47 Talon voice
Transcript (unedited)
0:00Introduction
other: You can see my screen now, right?Yes, we can.You're welcome.okay.me: Oh, I had to click on the go live button.Thank you for letting me know. I had not set itup to to go live, so I'm so glad you told me. Onetime I had a I had a stream and I forgot to hitthe go live button like until twenty minutes intothe thing.other: YouTube is really weird anyway, soI know.me: So this is good. We're making progress.other: I know.me: All right, yes.other: So, um
0:32Human-Computer Interaction (HCI) research into dictation challenges, voice repair
other: I read some papers, and there's a lot abouttranscription, but I think that the kind of workthat we're trying to integrate everything.It's not really heavily uh explored in literature.One of the things I was reflecting isthat we really are trying to solve four pro uhfour problems at the same time.So we have the problem of transcription, and as Isaid, I think that that's relatively um uh solved.And then we have the problem of editing.Whether it's text that we already have.or is text that we are uh transcribing.And uhThe technical term I just discovered is calledvoice repair.And uh, so I think that is actually valuable interms of searching for uh those concepts. And Ithink that, um,Editing is is is quite interesting because theproblems of editing transcription are differentthan the problems ofJustPerhaps.Editing text that we already have.um input via the keyboard or anything like thatthat is relatively correct.And then we have the problem of the commands. Andthis is actually where I'm the most interested onthese days. How do we execute commands?In a way that it is kind of universal.And uh, but managing risk, because I think that'sthe fundamental problem with with voice, that wehave ambiguity. We don't, we uh, we are neversure whether the computer is going to interpretwhat we want to say in the way that we want.So I don't want it to destroy my computer becauseit understood a different command than the oneI wanted.And I think that um commands are relativelysolved with the infrastructure that you have umuh developed, Sacha, becauseUmAs long as we don't have parameters.As long as we don't have parameters. So if we cancreate a command that doesn't take parameters, wecan get.The computer to execute it.And so, but one of the things that fascinates meis thatEmacs has the ability to run any command by name.And not only that, but it has it is very, verysmart in a way that it separates any function.From an interactive function.And how it creates a language of description ofthe interactivity with the user.Whether it's a string, a file, a function, anumber, et cetera.So I started to wonder.Why is that we don't take advantage of that? Whyis that we are basically just trying to call thecommands and then deal with whatever comes next?In a different way. Why is that we don't createinfrastructure that we can just say?Just call this command and it has whateverparameters that is defined with interactive,we're going to deal with them with voice.>> Yeah, that would be really cool.>> I think that that's kind of bringing ita little bit to our near next next layer.And um, and of course, there's also the issue ofonce you are outside Emacs.Then what do you do?Because as long as you're inside Emacs.Then everything is fine, but the moment that youwant to actually interact with otherapplications, and and we have talked about thisin the past, uh, you use Firefox, Spook uh,Spookfox. Um,I develop an extension to be able to actuallytalk to the browser within Emacs because you wantto be able to control everything from just onesingle place, right?
3:42The window manager
other: And but I think the window manager is kind of theother stage. So if you have a window manager thatis extensible.Then you can essentially try to do the same.Whether with the same infrastructure as Emacs orthrough Emacs calling the window manager.And uh, but I think that umThe window manager is another one of thosenatural places.where voice uh needs to live, no voice controlneeds to live. Mac OS has been doing it for avery, very long time, but it's a very simplisticway of essentially executing a command that youhave predefined.And uh, so you have the same problem as we havewith uh with funny that you have to definecommands before you can call them.And they cannot take parameters and thingslike that.And...
4:28Earwig
other: So then I started to experiment with earwig.And umI don't know if you have tried.And uh so uhLet me actually move this.>> I>> SoWhoever this T H and>> I only just came across E rig last week, soyeah, I haven't tried it yet.>> Yeah, whoever this is T H N D R Burr.IsHe essentially has implementedthe basic infrastructure that you have created ina way that people can just download as a moduleand then use it.Uh, before I discover it, umI was trying to reproduce, like many others,your environment.And then you get into the issues that you havealready dealt with, like timing, uh, utterances,uh, the spacing between them. So there areproblems that everybody who starts to go intothat into this immediately understands, right?And uh, so then I I I developed an extension ontop of um IRI called Onivaben.And I'll I'll actually demonstrate that. And uh,and then the last thing I actually did was.Let's try voice repair.As just a a something thatThe LLMs can actually do.I think the little lips are are excellent todo that.And tap. So so that's kind of.The different things I was actually uh exploring.Um
5:49An overview of related research papers
other: The four papers I think that they're interesting,but the one I really want you to think about isthe following.This is the paper.Uhsoother: These people, what they did was extremely simple.This is a guy paper.What they did is to have two people transcribing.One person transcribing the other.And it's such a simple idea, and it reallyhighlights the challenges of transcription.And they handled in two different uhenvironments. And one of them wasA person is able to see the screen.Think of it like pair programming, where theother person is transcribing, but it's not ableto touch the keyboard.Yeah.And the other personAnd the other uh environment is whereUp uh, the person is not able to see the screen.It's only transcribing. It's like in the otherside of the computer.And you realize that there are a lot of veryinteresting umcommands that a person actually utters.That they're not really what we are trying to dosome when we are thinking about Emacs, becausethe way that we think about Emacs.So, so think about this. Think about actuallyasking asking, for example, your daughter todictate you something.And then see what happens and then how sheactually edits that text as she's trying to tellyou what it is.And for example, next paragraph, or go back totwo words or two lines, or things like that,which some of those we have already solved withsome of some of the some of the commands theyhave created.But it actually brings another way in which wetend to interact.with dictation as we are correcting it on the fly.okay, so that this is actually, um, I canactually um I'll I'll share with you thecitations. They're already here. Uh, so this isuh sorry, uh.UhAlpist.Excuse me.>> I'm looking forward to reading that. Imean, amusingly, my daughter actually doesdictate her homework to me. SoFamiliar with the scenario.>> okay, so you understand, you understandthese problems then already. And uh, but anyway,so this was actually a very, very interestingexperiment, in my opinion.And uh, and then there are other papers thatbasically do a little bit of of the umOf the the theBasically, break down the different challenges.
8:04Composability
other: One thing that I found very interesting is thisidea of composability.So combine dictation, editing, and applicationcontrol at the same time, which is essentiallywhat we're trying to do.That's what the the voice people call uhessentially what we're trying to create in Emacs.
8:20Discoverability
other: And there's also very interesting aspects that Ithink that we tend to forget, which is one ofthem is discover discoverability.Because once you start speaking, it's likeOh, what were the commands that I can say?How do I remember what are the different things?So I think that there's actually a lot of issuesthat the people in HCI have actually dealt with.And um, so I think that there is a lot for us tolearn um in that sense.okay, so>> I love this. I love the the researchbackground you're bringing to it.>> Yeah, of course. So you know, you know,uh, that's my job. So I bring that. So here's anexample of voice repair, okay?And tab. SoThis is essentially something that I dictated.And I'm actually just reformatting it.>> I'm going to tell you right, like right. Doyou know about M-q and you can use that tofill the paragraph?>> Yes, but I I actually I didn't want tospecify the width because if I do it, it willactually do it like.>> okay.>> Way beyond. Oh, I I should use visualmode. Visual mode, that's the one.>> All right. okay. okay.>> AndYeah.>> Here we are.>> And that has been one of the things thatI learned in the last six months to use visualmode more frequently.Especially because a lot of applications areexpecting markdown in just one single line.And thatSo
9:37Using large language models for voice repair
other: So this is imagine, so this is actually um.One of those dictations.ThatI have completed and now I need to repair.So the way that that we tend to do it is by goingback and doing one thing at a time.This is the area where DLMs are actually great athelping us. okay. So I create a small function andUh, voice uh repair.Region.So if you read this, umOh.For example, the number one, number two,number three.UhThen there is delay the last two sentences.Replace globally Sacha for great Sacha.And so I'm going to send that to the lem.And we'll see what it returns.>> Yeah, formatting.>> And then it does it does the formatting.>> Yeah.>> Now.I ask it to.To rub between brackets.Anything that DLM was not totally sure about.Um.Uh, visual.Line mode. And so the idea essentially is that Iget a little bit of information about where tolook for potential errors.Now, one of the aspects ofLM editing text.Is thatIt's very hard to see diffs. You need to readeverything again.>> I have something for that.>> It's it's like reading papers. Once thestudent finishes, you have to actually go andread everything from the beginning.So that creates a little bit of a challenge. Sois it worth to actually ask for a full repair ordo you prefer to repair it? I think it depends onthe balance of how much you have to do.versus umum how quick you can you uh uh sorry how much youhave to do versus how quickly you can actuallydo it.And that's essentially what the user defines. ButI really like actually the fact that with arelatively simple prompt, 20 lines, I canactually get.to this level.Where it fixes a lot of the problems. Youprobably have noticed they would once once youstart speaking, if you stop for a little bit,then itThinks that they are two sentences, that shouldbe together.>> That w that's yeah.Yeah.>> And those are the kind of jobs where theLLM is actually very good at doing that, right?UmWithMm-hmm.Yeah.>> I I would be very interested in seeing yourprompt. Um, and the second thing that I want tosay is for the purposes of comparing, uh, if youuse gptel rewrite, then you can get a diff. Uh,but you can also modify it so that like you canwrite some code or have your LM generate somecode to use a W diff instead, which is aword-based diff. So one of the interfaces thatI've been playing around with, uh, the idea is toshow the word-based diff so that the the theadditions uh or changes jump out at you becauseit's fontified differently and then be able touse voice or mouse or keyboard to accept or ormodify certain changes. And I haven't nailed downthe interface yet, but the Dul D diff might be aninteresting approach.>> So we we think alike, uh, because Ialready implemented it with GPT write uh rewrite.And uh, but it is very difficult to actually seedepths of of text that you're editing.Because in this case, we're actually alsobreaking the lines.>> Yeah, yeah.Yeah.>> And so it becomes a little bitcomplicated. So I'm not totally sure whetherthat's actually the best way to do it or not.>> For like for me, I like the the breaking ofthe lines doesn't matter so much because that'svery easy to visually verify if it's all right.What I'm annoyed about right now is I can't, Ican't quite get a prompt that will leave mywording alone. And so using W div ignores all thewhite space changes. It just focuses on thechanges in words. So that's what, you know,that's that's what I'm trying.>> I think the great thing of trying todivide the problems is that different people willprobably concentrate on different aspects anddifferent people will experiment with differentaspects. So once we know that we have to do umsentence repair and voice repair, then you canhave all of these different uh styles using defor using just basically replacement. I wasthinking that maybe the way to do it is to haveUm, overlays.>> Yeah.>> actually highlight the areas where wherethings have been changed or where where the uh DL L M has uhYeah.problems actually trying to do it, right?>> Yes.>> And um, so, but anyway, so that's kindof my very simple just a one hour.Not even an hour, just a few minutes try to.deal with the problem of voice uh repair.And uh, so I think that there's a lotof potential.Uh, on that. I really think that that will allowus to forget about having to do the edit everysingle item at a time, which is very tedious.And I think that perhaps for all for many of us,the ideal and I
14:11A hybrid model combining dictation and typing
other: We can see it when in your videos is do ahybrid mode.Well, you have voice for.Quick.Typing.And then you go and then manually edit witha keyboard.Because it's much faster than using the uh voiceto do the umThe the uh finding text, locating, and et cetera.And uh, yeah, so so I don't know if you have anyquestions, you can interrupt me so or um.IfYeah.>> I just want to steal the prompt from yourconfig. Is is that?That's already online as well.>> Uh, yes, I can show you, and um so um.>> Yeah, the um the>> Also ah, where's uh be ahLet's roll the file.Ooh.>> Application of LLMs to simple edits uh wasalso explored by Abinot Tushar in his uh ESIdictate. So I think it's it's definitely a a veryflexible approach. I'm also really curious aboutpicking up the editing commands that uh both Ericand um and th Thunderburr have explored, the kindof the editing grammar for moredeterministic edits.>> Yes, exactly. Uh, this is this is theprompt, so um, it'sJust two pages and uh>> It's a>> And then it has actually actuallysome examples.Uh, but again, soThere's no evaluation of this. This is actuallyjust like trying it and it kind of worked.>> Yeah, okay.>> And um, and I'm going to actually pushthis into my repository.Uh, the main start.I'm customizing a slightly earweek at this point.To be able to do what I want.
15:43Independent changes, and sharing ideas
other: So we're going to have a lot of uhUm.independent changes because uhIs is we're moving too fast in this to actuallybe able to build on top of each so of each other.I think that's going to be a little bit ofa challenge.I agree.Yeah.Yeah.>> And that's okay, because we're we'resharing ideas at the highest level also of whatkind of what interface patterns make sense, youknow, like and as soon as someone comes up withan idea, then it's very easy to re-implement thatwith the power of Lisp or even, you know, withLLM assistance to to fit into your particularsystem. So, like, for example, I've been reallyliking this idea of an independent voice cursor,which I borrowed from Abino, where you can youcan leave the dictation moving. While your c youryour typing cursor is off somewhere else, maybeeven a completely different buffer.>> That's a great idea. And I alreadyadopted it in other things I've been doing. Like,um, I basically just let Emacs do its jobinteracting with a website, and then wheneverthat website finishes, insert there, and then Idon't have to be babysitting that buffer anymore.It can actually be hidden below, right?So I think that there's another advan a lot ofadvantage being able to do async operations wherethe pointer, uh, the point is already fixed.In a given location.And uh, so so that's that's about repair. Um, letme give you a little bit of a demo of of uh thetwo systems that I have.Um
17:08Hammerspoon
other: I used to run Linux as my laptop, and uh, butsince COVID, I moved to macOS. And one of thereasons is that um I'm using a toolcalled Hammerspoon.That allows me to essentiallyIt's essentially a window manager.And uh, and uh, the window manager is moving fromLua, where it was programmed, and it's nowJavaScript. Uh, we're moving to version two.UhProbably in the next couple of weeks, we're goingto have a major release. So I've been actuallyporting my code into that.So, um, when you were experimenting with uh withEmacs, I started experimenting with umWith hammerspoon andSoThere's a the most simple one isjust transcription.Uh, this is an example of transcription that isvery similar to the one that Sacha has beencreating for a long time.And so nothing special. And learning a lot fromyou in terms of being able to use um.spacing to be able to actually start uhThe transcription at the same time that recordinggoes, because otherwise at the beginning, I haveto wait a lot before anything will betranscribed. And the the longer that you speak,the longer that delay is going to be.So, butI'm really uhI'm really affected.By and I think.All of us are, by the way, that Emacs affectsour brain.UmThink of it like the story of the arrival movie.The language affects the the way that we think.And our language is the language of Emacs. So itaffects the way that we think about problems.other: And uh, so what I wanted was to have a M-x.For the window manager.So I created a layer to be able to haveinteractive commands.So essentially, not every command is interact uhis interactive because otherwise they you gettoo many.And then the challenge is.If the command requires parameters, I had tocreate infrastructure to be able toGrab the parameter.So what does that mean in this context? So let'sassume that you want to maximize a window.If there's a window already.Um.Um active.It maximizes that one.Otherwise, it will ask you, which window do youwant me to maximize?Which is kind of similar to what Emacs does foroptional parameters. So that's kind of the idea.So that means that I can actually call umLet me, for example, use window right. UmHalf, and then it will actually uh do that. SoThis was important because if I wanted to be ableto haveThe ability to call any command via voice, Ineeded to have this feature.okay.So, um.This is my whisper menu.Uh, this is my Whisper menu. I'm using Whisper asthe back end for this.Uh, so the one that we've shown is dictate.And I can also dictate to the clipboard.Uh, for example, if I move the the the window toanother window.It automatically.Dictates to the clipboard.Because who knows where it's going to end.That's one of the things you start to discoverthat you just don't want any window to actuallyaccept whatever you type.>> Mm.>> Some problems that don't existwith typing.>> That's an interesting approach. I've justI've been having it dictate straight in.>> Exist with both.And uh, I also define something called umUh, filter, which is essentially, and I have seenthis in many applications for Mac OS and Windows,that they allow you to filter the transcriptionthrough an LLM.And then I can define the the uh the prompt to beable to do that. I call that filter. So I canactually determine the filter. I can also definethe language that I'm going to do thetransmission. So essentially kind of kind oftrying to bring the same power that we have inEmacs to the window manager.Uh, the one I want to show is the one I call toprocessor, okay?Window.Left.Right. Sorry.UhWindow half left.WindowLeft half.>> Yeah, it works.>> Let me show let me let me check thecommand. Oh, here it is. So it actually did it.Sorry, it's the problem that oh, I always forgetactually the name of the commands. Um>> Define them both.>> Yep.Yeah, so uh that's essentially the problem I wasuh talking about the discovery discoverability.And actually, that brings a very interestingproblem, which is.Learning to type.Let me let me let me.We need a a different word because this is nottyping by voice.Um.
22:00Learning how to communicate with the computer via voice is like learning to type
other: Learning to communicate with the computer withvia voice is probably similar to learning to type.It's going to be slow. It's going to bechallenging at the beginning, but the better, themore that you do it, the better and the fasterthat you become. And you, you are a very goodexample of that, because you can actually now dothings significantly fast because you have beentrying it over and over and over again.And I think that's essentially what we all needto be able to become. So I think that people, oneof the lessons that I think we should all have isthat everybody.It's going to be slow and frustrated atthe beginning.And as we as we move forward, then we're going toimprove and just become more effective.
22:40More attempts
other: Uh, with these tools.Uh, let me give you another example. Um, let'stry another one.Uh.Apple music.Ah, let me let me first check check the commandson that because that would probably be easierthan trying to.Apple music.Apple music focus, Apple Music Focus, so and uh
23:10We need a which-key
other: >> So it's it's kinda like we need a witchkey, right?>> Yeah.>> A which key equivalent for voice, where ifyou say something that's a partial, like just aprefix of other commands, it will display justthat subset.
23:22More attempts
other: >> Exactly. I have some Emacs. So let's sayEmacs agenda. Let's try Emacs agenda. And becausethat's an interesting problem.>> Will you have any private information inyour Emacs agenda that you mightaccidentally show?>> Up.Mm.>> okay.>> It will not pass, um.Emacs agenda.E MaxAgenda.>> Ha ha, it's it's a dictionary problem.>> It's a dictionary problem. So I have notbeen able to actually so I have not dealt withthe problem of having some synonyms.So, because Emacs is one of those that it justdoesn't match.Änte.>> Oh yeah, the way that I do it is, um, is II run my I re I run my like commonedits replacements.As as part of my filter for all of the thecommands, right? So if you're usingI don't know if you're using Emacs to drive thethe rest of it, but if you can use if you can useyour speech uh output your speech input resultsfrom Emacs.Into whatever else you're using, then then that'swhere you can do the replacements also.Yeah, yeah.>> So this is done independently. So here Ihave a whisper server.AndHammerspoon is talking to that whisper server.>> okay.>> So this this was the beginning before Iwent, and then um Hammerspoon is able to executeEmacs commands.And um so thatThere's a lot of interaction between both of them.And uh, so let me let me.Yeah, go ahead.
24:52Emacs, Hammerspoon, and the browser
other: >> Yeah, see, I wonder if it if it makes senseto do it the other way around, where Emacs istelling Hammerspoon, here's a string, here's theplain text, and then can you just execute it?>> And I will be able to do that because umI have the ability to code either one fromeach other.So I have the ability to call.From the browser Emacs, I have the ability tocall from Emacs the browser and the same twodirection. So the three main tools that I use arethose. And I really believe that.Our Emacs way of thinking is like we need thetools that we use to be extensible.And I think the browser is very extensible by theability of being able to inject JavaScript or tobe able to have extensions that do whateverwe want.So I totally agree.And thatFor example, one of the things that I'm veryhelpful thankful is Emacs everywhere.I had to create an ex an extension to be able toconnect it to Hammerspoon, but I can useEmacs everywhere.Um, in macOS.So I can always edit fields with that, right?
25:56More dictation challenges
other: Let me show you now only weapon and umSoFirst, let me show you um.E week d dictate.This is an example of dictation.okay, help.I thought they will give me help, but they didn't.Oh, this is what another one of the problems,right, that we have.The moment that we get into dictate, it justkeeps going. It just keeps going. It just keepsgoing. That's actually one of those things that Ihave to learn still to be able to do.And uh, because otherwise then I just get garbageor things that uh modify uh buffers that Ishouldn't be modifying.Because of this, right?And uh, let me actually let me get the the thehelp, uh, earlier. UmUh, help.And uh, these are the commands that it has.So, um.Scratch that, comment that, select, uh, format,replace, etc., etc., etc. Um, the ability to goto certain line.And I extend it with this.Front command.okay.>> Yeah.>> And um, soLet me actually try again and umRun.Bookmarks.Oh.>> Does it have to be run command bookmarks?>> okay.Run bookmarks.He caught the O.That's part of the utterance.And uh, let me stop it and try again. And uh,
27:38Command mode and dictation mode
other: so the the the way to actually do it, I have tosay, okay.>> okay.>> before it goes into command mode. Sothat's actually an interesting aspect. And theliterature talks a lot about this. Areyou dictating?>> Yeah, yeah.>> Or are you in command mode?>> Yeah, yeah.>> And the switch between them is expensive.So that's another challenge, right, that we have.okay.Ron.Bookmarks.So um, it gives me completion. So this actually,um, let me let me run the OB OB one, uh, sorry,the only.Uh, help and task so these are the commandsI have.Umother: Let me open for E. So this mu4e is a command thatdoesn't have parameters.UmOh, so I have doctors.okay.Run.Male.
28:40Mispronunciations and dictionaries
other: >> Oh, because it became Ron.>> Run.Or it became wrong. So that's actually a problemthat I have with my pronunciation. So that'sanother interesting aspect.Is it because I mispronounced the words?Or is because I shouldn't really create adictionary? Because the problem of a dictionaryis the moment that you commit to that word.You cannot say the other word.So>> Ah, uh, what I do sometimes is I define thethe the substitution in terms of the phrase.But it might also be interesting to have a seconddictionary that you can run only in the contextof a command temporarily.>> Yeah.>> So I wonder, so like, since Erica'shere, the>> I mean, I>> Good.>> Yeah, though, I think like the the coreof the issue is that, uh, like, do I sound good?>> Yeah.>> Does it sound fine?>> Yeah.>> Yeah. I think the core of the issue islike because this approach takes like a ummodel like transcription model where you firstdictate and it translates it into text and thenyou try to parse that.Uh, but Tallinn, for example, like, umYou communicate with Talon and tell it what theactual grammar is. And then when it decodes, itcan only decode into a legal utterance.So that increases theLike precision a lot.So for example, Sacha, you have talked about yourstart screaming problem.So if you told Talon that you were to startscreaming, it would like understand that it isstart screaming because it cannot decode intostart screaming.>> Yeah. Uh, but on the I guess it it's greatfor for the controlled vocabulary so voicecontrol, but if you also want to do a lot of freedictation, it would be amazing to be able toswitch switch the modes or like, you know, biasthe the recognition one way or the other.>> Well, I I think that's where.I personally end up finding myself when I'mmessing with the voice command stuff right nowand the dictation is.I am going into commands mode.Um, and just mostly having that in thebackground. And then if I need my actualtranscription, I have your transcription buffbuffer that you have set up, and I'm kind ofdoing it that way.Uh, so far, that's been most of my thing, thoughI think I will, you know, obviously use moredictation mode when I'm doing something like ablog post or whatever.Yeah.That's something that I've been.uh noticing as I've messed with this uh you knowthe past week or two.>> That's my default now too. Um, when itstarts up, it's just in commands mode, and then Ican switch it to dictation either vocally or withmy with my uh uh my my keyboard shortcut. And nowI'm tempted to make my space bar a push to talkthat just switches into dictation mode for that.So kind of different things to play around with.>> Yeah, that's actually so that's that uhso with uh that's one of the reasons that I liketo be here uh with external keyboard, becausethen I can actually use the numerical pad.to be able to issue commands. UhBecause that the the problem also withkeys, right?And uh>> Yes.
31:35Complex commands
other: >> So let me show you the complex commands.Let's hope that it actually works. So umokay, run DMG bus.Seven.okay, next.>> Oh yeah, so that you got interactive.>> And it opened in the other in the otherin the in the other um.UhUh, in the other so it was in another uhBrowser.Sorry, in another screen.So that's essentially how it works. SoRun that command.Let me stop.Yeah.Boss, actually, let's look at the description,describe function, uh, DMG, uh, uh, sorry,describe function.Uh, DMG bus.Um, essentially an interactive function thatdetects a route.So what this is doing is so all I all I do, letme show you the definition. So umUhUhVoice transcription. So the way that I define itis the following.I don't want to defineAnother function just to be able to call it viavoice. So what I do is that I usecommands that I already have. And sorry, that'snot where where is it?Here's the list. So these are the commands.All of these are regular commands.Interactive.And then this is aA potential synonym.that I have to be able to call it. So I can callit Org agenda or I can call it my agenda.And then I have an optional confirmation.Uh, let's try that now.So notice kill buffer here. Kill buffer doesn'thave confirmations.As Neil. So that means by default it's true. So Ineed to confirm that.Oh, sorry. Umokay, Ron.Keel buffer.Uh.>> Uh, pronunciation challenge.>> My kill is not very good.And thatMm-hmm.okay.>> Maybe you can add an alias right now.>> Keel buffer.okay.Keel Buffer.It has to reset the mode before I can actually dothe command. Uh, let me use the otheralternative, which is actually directly into thecommand. So uh, earwick has two modes, dictateand command.Uh, let's hope that uh the ear wig actu umactually uh I already uh did it uh so only uhExecute command. Will this work?Uh oh no, this is actually uh.UhAirwig command.Ron Keel Buffer.Yeah, it doesn't work with that. Let me actuallytry again with the other one.Ron.Kill buffer.Yeah, so again, so that's actually mypronunciation. Um, let's do another one. Umokay.>> Command modes, right?di>> Yeah. Uh>> Do you also have it running for all likeall the interactive commands in general, or areyou manually defining them? Because I have somecode in my config.>> So I'm manified adding them becauseotherwise then it will become unmanageable.>> okay.Uh>> And um, sookay.>> I I will let you turn off your dictationthing first.>> Split window right.okay, split window right.>> It's not doing the uh like beginning ofutterance thing.>> Ah, this is the problem with the withthe timing.okay.>> Yeah, the way that I I have mine is it itsplits my my silence.>> Split window right.>> Huh.>> okay, split window.>> Chris is a live demo.>> So it's struggling with that. And umUhokay.Wiener und duSo nothing is working now.Yeah.>> It's okay. It it it's one of those things.It's only when you're demonstrating it.>> Let me just try one last one.okay.Run mail.>> Oh yeah.>> okay.So that worked. So I think that what happens isI'm still uh struggling with the utterances.okay, run split window.It caught it caught the A.okay.>> I I was>> Run split window.Yeah.>> Yeah.>> So it's a little bit of of trying toactually get.Um, the word incorrect and but I want to run onethat requires parameters.UmUh, let's do the bookmark. UmActually, where I should be doing this is earwig.uh help because then I can actually show you whatthe commands are.So, umUh, no, this is a weak help. Uh, only uh help.okay, this these are the commands. So these arethe commands, but this is actually the help. Soin the probe, you can say okay next, and it willsend you to the next field. It's the equivalentof doing a return in a parameter.okay cancel cancels the command. okay previousgoes back to the previous question.So essentially, I have a function that sits ontop of um.Um, call interactive.That gathers the parameters.And then once they're actually completed, it willcall the function.So that way I can take advantage of theinteractive description, but I'm not usinginteractive directly.Yeah.In things like consult, you can take advantageof um.trying to pick the specific number of ofthe selection.>> Huh.I should try that.>> okay, run bookmark.okay.Pick four.okay, next.That worked. okay.So what they did is actually call Org wrongnode find.That requires a string, but it's alsousing consult.So it's aware of consult and allows me to use theconsult um infrastructure to be able to actuallyjump to a given line.And so that's essentially, and the advantage isthat I don't have to program any of that. All ofthat is done via this by simply defining thatthe function.It's callable.Via voice.>> That's wonderful.>> So that's essentially the experiment theexperimentation I've been doing, to be able tosimply add.The function.The ali uh an optional alias.And thenWhether it's pre approved. If it's not preapproved, it will ask me, do you really want torun this?>> That's a great idea. Uh>> okay, kill current buffer.Yeah, it has problems with my kill.Let me stop it and turn again.okay.Kill buffer.Oh, I forget to say run. That's actuallythe problem.okay.Ron Keel Buffer.>> Mm, yeah.>> And here's what it asked me. Isaid, cancel.>> Yeah, yeah.>> So notice actually that it asked me andthen I cancel it.So that's the idea behind their pre-approval.Obviously, there's a lot of experimentation forthis becauseIt's obvious that I'm actually saying too manywords to run the commands. What I need isactually a way to.Uh, reduce that.And or basically, um, the different the problemof being in the interactive mode is that.I'm dictating at the same time that I'm actually.Um.doing uh commands on the co on on the mini buffer.Because the pr the the command might require text.And there are two ways to do that. One of them isIf I say the command plus some text, it assumesthat the first string is the first parameter.The the rest of the string is the first parameter.And then it might run it.Otherwise, then if it requires more, then it willactually put that into the mini buffer and waitfor me to actually say something, go to the nextfield, et cetera.And uh, but anyway, so that's kind of the demo. SoHopefully that gives you an idea ofThis.vision that I have.of being able to use interactive.as a way to create commands. So we don't have tocreate one command for every umUm.So one non parameter command. And the mainproblem with that is the lack of being ableto input.Parameters.It reduces a lot the flexibility of the language.And with this and with this some practice, thenthe ability to be able to say the parametersopens way more possibilities.I think.It's a matter of actually seeing whether thatworks or not.>> Eric, you've been working with this for farlonger. Do you have a workaround for interactivefunctions with parameters, multipleparameters even?>> No, no, this is actually Eric.Yeah, so I mean, usually I just uh make thecommand in such a way that there are parts of itthat are optional.And uhSo whenever one of the arguments to my like thenphony d fun.Uh, is nil, then I like ask for it interactively.>> But the idea of like reading theinteractive spec from the functionAnd then figuring out, okay, how do you promptfrom that? I think that's that's veryinteresting, and I want to steal it.Hmm.That sounds cool.Uh>> Yeah, that's the that's the advantagethat um we basically just take the description ofthe function.And the function already says what how manyparameters it takes and what is the type. So itcan, it can, it can narrow it to. So I have uhthree methods now. One of them is numbers,another one is strings, and the third one is.uh files.So you can remove, for example, the lastuh directory.From a path.Uh, quickly in the editing uh commands.And uh, but that requires experimentation, so.It's really more like we have no idea where weare going.With this.>> There's a lot of possibilities.>> Yeah.Yeah, I I think like possibly one of thepotential risks with the using the interactivespec is that it is moreOptimized for a keyboard interaction.Um.So you will probably get like an inferiorexperience compared to if you just defined likehow this interactivity should work.>> And doesn't, um, like, doesn't dictationwork for you in the mini buffer? 'Cause likeFruit. IFor things.That rec that prompt for read string and andthings like that, it might be possible to justdictate straight into it. It's mostly justthings like>> Mm-hmm.>> Like uh, like read key that I'm like, hmm,do I need to use unread unread command events tostuff the keystroke back into this?I haven't looked into it in depth yet.But it's it's actually something I want tolook into.>> I think if we're working.The advantages to be able to pass thefirst parameter.>> Oh yeah.>> To the function.>> Yeah.>> Because you can actually say all of thatin the execution.And then that gets pre-filled.>> Um, and Bart does that.So when when you use Embark become, the it itprovides the previous value as the argument, thefirst interactive argument.So I can steal code from that if you haven'tlooked at it yet.>> That that's right. So what I mean isthat you can actually when you when you call thefunction via voice.>> Yeah, yeah.>> You already passed that parameterbecause you keep going.>> Yeah.Select f>> And then it calls the function with thatfirst parameter. So for most functions withone parameter.Is sufficient.Uh, if there's completion.It matchily stopped there.And then wait for you to type return. Or in mycase, I have okay return.But the reality, but the way I think is that umusing the keyboard in this case is just faster.So you get this started with the function.And then you do everything else with thekeyboard, like just moving arrows or return orcontrol G.>> Yeah.>> It's probably faster. Now.>> Andokay.>> One of the advantages I see with voiceis that.In many cases, I might be doing something else.In the on the desk.And I just want to control the computer, right?Like move to the next page.Or go and check my email, read the uh, open theemail, open this mailbox, et cetera, etcetera, right?And uh, and this essentiallyMakes it a little bit simpler in the sense that Idon't have to program every single function.>> Yeah.>> Independently.>> I do have a like a a kind of a commandfunction or aUh, I I I think my my long phrase for it, whichwas just just for fun to demonstrate it, was uh,I command you two, and then the name of thefunction. And what it would do is it uses on redcommand events to stuff it directly into M-x, andit runs the first matching command. So all of thecommands are available, even the ones I haven'tprogrammed in.>> Yeah.Yeah, that's actually a good way to do it. And umAnd I think that the challenge is.UhThe selection, right? How do you still select?And uh via voice.>> Oh, oh yeah, yeah. Well, for this one,because I I just wanted it to run the firstmatching command sorted by length so that moreexact matches come first and with orderless inplace. I don't have to remember the words of it.Uh, then it does that. Um, but I was curious,since you have picking on on your your thing,what do you do to getthe, you know, the list of candidates, uh, in thesame way that the the completion is handling it.>> Well, so I'm not doing anything. I'mjust calling the completion, right? I'm just,it's just calling consult.>> okay, so consult is is still takinganswered. okay.>> And then>> All right.>> What I think that the the the the onlything I have done differently is that Ihave commands.Voice comments specifically for the mini buffer.>> Yeah, okay.>> That's the only difference. Everythingelse is just.Uh voice.>> Yeah.>> An interpretation of that. It's justthat in the mini buffer, you have differentproblems that you have on a buffer.>> Yeah.All right. I>> Especially with consult. So consultallows you to select by by line, right?And uh, or if you actuallyType some text, then you start to have.Let's say that you have two candidates.Um, and you want to select the current one. Sothen I have a select.um candidate um command.Because otherwise then, umYeah.
47:50Muscle memory
other: There's some things that our our fingers knowbetter than us how to do in Emacs.>> Yes.>> I have to think sometimes about actuallyhow this works before I can try to think abouthow to do it in voice. That's anotherproblem, right?>> I think this hybrid workflow of using voiceand typing together.Uh, is it's very promising 'cause he can usevoice for the things that it's good at and thentyping for the things that it's good at.>> Yeah, exactly.I have found with like a lot of tasks because Iuse my voice more than I use my keyboard forinteraction. So for many things, I don't reallyeven know how to do it with my hands. So I uhLike um, type in what I would say.To execute the different commands, and then I letthe phony parse it.Yeah.So I have like the inverse issue.Where>> It's wonderful.>> Where like myYeah, we're where uh yeah.I know better how to use my voice than to use myhands with Emacs.Because I mean, initially I also like the reasonI switched to Emacs was because I needed anenvironment to be able to shape according to myworkflow, right? So I never had like experiencewith Emacs before using it with voice.Basically.Well.All right.Yeah.okay.>> No, go ahead.>> Uh
49:13Personalization and collaboration
other: Well, what I was going to say, to me, like that,I think is going to be the big question for like.Everybody that's exploring this area is.How do you, especially if they're doing it withEmacs, because you know, you can do your ownthing, it's like, how do you set it up in a waythat's going to work for you?Um, and make sense for you because with other,you know, a lot of programs, you're kind oflimited on what you can do, but with Emacs andwith defining your own commands and.You know.All that other options we have now, it's justIt's going to be very much a filtering down oflike what actually works for you and whatdoesn't. And I mean, I think the hybrid modeSacha was talking about the other day is kindof thethe mode I see myself in the most where I'm kindof, you know.I'm occasionally using voice commands, I'moccasionally using some dictation, and then I'mI'm also still using keyboard and stuff likethat, and just finding that most efficient.you know, best way to work for you, maybe noteven most efficient, this the best way to workfor you.And I think that's going to be a little bitdifferent for everybody. And I think that'sthat's going to be one of the challenges we see.As people start exploring this, you know, otherpeople start exploring this.Yeah, I think that on one side, then we have theissue of the ideas and how they get implemented,and the other one is how to build on top of whatothers have been building.I totally agree. And umBut I think that everybody has a differentexperience. I'm thinking, for example, from thepoint of view of somebody who might have motor uhproblems and typing, that actually could help.Even if it's not the most efficient way to do it.>> I think there's a there's a bit of a rampthere too. You could start off by defining thingsin more natural language, but then as you findyourself wanting shorter ways to say the m yourmost frequent commands, you gradually movetowards a like a tighter vocabulary like whatEric uses in Christopher Free.>> Yeah.I don't mean we do that. Sorry, sorry, go ahead.I was going to say we do that with keybinds too,because like for me, when I'm reaching to kill abuffer, I'm almost always wanting to kill thecurrent buffer.SoI just assign that to a keyboard shortcut and Ihave it there, but yeah, absolutely.I think it's the same thing with voice commands.Yeah, and I think that, umSorry, I forgot what I was going to say and umJust got distracted.I can say. SoBut I but I think also like if we go like when wego like closer towards like obviously constructedlanguages that don'tSound anything like natural language in terms oflike a grammar and the different terms thatare used.Uh, I think it will also become even moredifficult to use this. Umthese recognizers that are were made fordictation because theyKind of try to fit what you're saying intonatural English.And when I interact with my computer, it soundsnothing at all like natural Engl English.It's likeSounds like random made up words in arandom order.Uh, so I think that's uhModels like Whisper will uh struggle more withthat type of interaction as well.
52:33Composing sequences of commands
other: I was going to say that one thing that we haven'teven thought about is also how to compose comvoice commands.Because we are issuing one command at a time.We haven't even thought about what does it meanto actually have like a sequence ofvoice commands.And um>> I was very amused by the examples inearwig, right? The uh uh very uh verynested descriptors.Ha ha.>> Yes.Yes.>> Oh, uh, which reminds me, Eric reminded mealso, uh>> And that's actually that's that'sa rescat.>> Dan, we've been chatting in a matrix in theEmacslisten matrix room.So IIf you aren't on that yet, uh, if if you'd liketo join us, we'd we'd be uh well, we'd be happyto discuss things there too throughout the week.Um, matrix. I'll I'll get the link while you alltalk about stuff.>> But yeah, I think the risk is also animportant factor. And umWhat is the risk of running on different buffersand um different commands, et cetera, right? Andthe risk, um.Um, is personal risk, the the the willingnessto risk.It's different for every person.
53:48Transcription in the background
other: But I I really like the demo uh from yesterdaybecause umThe trans the automatic transcription, thatwas great.having a buffer that just does the transcriptionwhile you're doing something else.Uh, looks magical.>> Oh, was at Michael's demo? At fromLinux Saloon?>> Yeah.Yeah, so some of those things really feellike magic.>> I had I was very amused by the part wherewe were trying to stump it with with uh languagesand accents.>> Yeah, I noticed that. So I I startedusing via voice in the nineties.SoSo that's what so the>> I was I was using dragon naturallyspeaking. So around yeah, that kind of thing.>> Exactly, at a similar time.And things have progressed a lot. The mainchallenge at that time was that.It was very difficult to train it to your voice,especially if you were not a native uh speaker.And uh, but I think that now, uhWhat I'm doing, uh, writing, um, umI tend to doUh.Voice recognition.For anything thatTakes more than one line.
54:50Talking when there are other people around
other: And uh, but also depends of the people around.Uh, so here in the university where I amthis month.So when there's other people around, then I don'twant to actually uh bother them. So I don't usevoice. So that's another challenge that we have.The difficulty of of notalways been able to do it. Think in terms ofdoing it in a cafe.For example.That might look a little bit odd talking toyour computer.Although the cafe is still okay, but let's say alibrary. A library is probably a better example.How do you do this in a library?Yeah.>> I think uh the court scenographers, uhwell, the court voice voice, uh, voice reporters,they have a small like thing that they use to.He>> To be quiet, yeah.>> Talking to like this.Ha ha.>> Ah.>> But uh, but yeah.>> The other thing that I have alsoexplored is the idea of recording thoughts.>> Yes.>> Uh, that's not Emacs related, but justgoing for a walk, record for half an hour,one hour.>> Yes.>> Uh, sometimes uh to do, sometimes ideas,and then come back and then just having thattranscribed. That has been alsoextremely valuable.>> Yes.I I find that with aGo ahead.
56:02Emacslisten and Emacspeak
other: >> I mean, one one thing that's good.That that I think would like be really cool. LikeI have aThis like a dream of being able to do it would beto like be able to combine Emacspeak andEmacslisten in a way that you don't even need ascreen and a keyboard.So then you could just be out on a walk and hackon Emacs without.Like having to interact with what looks like acomputer at all.No, that would be.Knife.>> Yeah, uh, I was>> Well, um, I do not know if you have youhave tried uh ChatGPT in voice mode.>> Yes.>> And uh, but it really feels magical.And uh, to be able to have a voice talking to youin your in your head while you're walking, whenyou're shopping.And uh, in that case, it's not really aboutediting a document.And uh, but just being able to actually havea conversation.With the computer in that way.I think that we're we're close to be able to doit with almost any computer.Whether it's commercial or not.Mm-hmm.
57:02Recording on the go
other: >> I've experimented using a lapel mic, whichis great because then the audio quality is stillpretty good as I'm, you know, as I'm recording mymy brain dumb or whatever. And then I was ex Iwas playing around with using simple voicekeywords to structure things, like start section,whatever, end section, um, sorry, stop section,because end is hard to recognize. stop sectionwas work better. So using that to delineate Orgmode headings, for example. And so it was veryeasy to process it afterwards. But my dream isalso, like, like Eric, having this directly inEmacs on my Android phone so that I can actuallylook at the structure as I'm, as I'm developingit. Because my problem with just the phonerecording brain dump is it would be hard to likekeep, it would, it's, it was hard to keep thestructure in mind as I was talking. I would, Iwould tend to drift. If I use Google Recorder,then it will do the transcription as I as I talk,which is nice. Uh, and I still have the recordingafterwards, which is great for misrecognizedwords and and things like that. Uh, but thedownside was that the Google recorder onerequired more clicks, more taps in orderto export.to uh to a file whereas uh easy I I I think itwas like like uh one of the the Easy Voicerecorder one of those other recorder apps wouldjust automatically save the recording to a folderand that I could synchronize to my computer forlater processing. So if I can find something thatdoes the auto transcription and does the uh, youknow, the display as you're talking and does thethe automatic synchronization with my laptop, Ithink that would be amazing.>> I would recommend you that you don'tworry about that. I recommend you just recordyour audio.>> It could be Emacs.Hey.>> Without worrying about anything.And then ask the LLM to organize it.It's>> Yeah, probably. I've and I've done that inthe past. Like I've I've either recorded asnippet and then uploaded it to Claude or Geminiand said, okay, here, um, you know, can you justUh, sort this out into to bullet points orwhatever. And I've also experimented a lot withusing Claude for the uh for the conversation modefor practicing French, because then it canrespond to me in French also.>> Yeah, I need to do that. Yes, I totallyagree. I think that there are so manypossibilities, but.Yeah.>> But the thing about that is I also likehow good.
59:25Predicting the next token in phony
other: >> Yeah, I think you you mentioned likehaving something like which key for>> Yeah.>> Like voice commands.Uh so I mean the the parser internal to phony, ithas like a next token prediction.Uh so I mean perhaps.Something there could be used.You can probably also keep track of like whichcurrent rule is being parsed. So that you couldsay like, currently this is being parsed, and ifyou say this token, it will try to parse.Like these next rules and so on.So maybe something can be done there.>> Yeah, yeah, like if we give it a string sofar, like if we're pausing in the middle of acommand, right now my voice activity detectorjust cuts it. But what I want to do is I want topass it through like a small local decision modelthat just does kind of end of turn detection.So if it detects that this is not yet the end ofthe sentence or the end of the utterance, then itwill, you know, it'll do, you know, use thathesitation to show me a menu of the, you know,the the different parsing possibilities forthis phrase.>> Mm-hmm.>> Uh, maybe as a starting point.
1:00:32Interactive completion interface for phony commands
other: >> Yeah. So I mean I I used the next tokenprediction to when when I umLike input voice commands by my hands, then I usea completing read buffer so that it says uhLike gives me the possible next words that Ican enter.Uh, so I mean>> What am I what would I look for in yourlike setup to borrow that idea?Is that in your public config already?>> I it it's in my private config, but Ican uh share it in the chat later.Yeah.>> 'Cause that sounds really cool. And alsobecause I I have this like uhInterest in stenography, which I haven't testedoff yet, but it's uh, but the ty like typing inthe natural language commands by uh by coding isalso something that I've I've been curious aboutfor a long time.>> Mm-hmm.>> okay.>> I'll have to remember to send youcheric quarter.UmTasha, and let you see if that may be a betterfit for what you're trying to do.>> Which one?>> Sure, quarter.>> Oh yeah.>> It is not a sonography keyboard, it's adifferent uh style keyboard.>> Cool.All right.Send us the send us the deeds.
1:01:39Working with other applications
other: Yeah, so okay, so there's there's recording likeon on your phone or other mobile device, and thenthere's dictating into Emacs. Um, and also youthere's, you know, one of the other things youmentioned, Dan, was uh using em uh using thissame idea to control other applications on yoursystem. And we've talked a little bit about uhinterfacing with the browser, which we do a lotof stuff in, right? So it makes sense to be ableto voice control that, uh, which is part of thereason I was like, okay, Eric, Eric's got some uhuh some interesting uh voice targets for the Thesearch bar and and things like that. And I waslike, you know, if you if you use an extensionfor your browser, you can not have to use XD toolto copy things around.
1:02:19Voice repair with LLMs
other: >> Yeah, and the voice repair thatpotentially the LLM can actually help you and doit voice repair on a large section of text.>> Yes.>> In a more efficient way.>> And it might also be interesting to like topass anything thatThe that theParser didn't recognize to an LLM that just, youknow, it's kind of like a tool use sort of thing.Say, hey, did this, you know, is this actuallysupposed to be a command or is itregular dictation?>> Yeah, uh, we have to remember that wecan ask the LLM that when in doubt to dosomething different.>> Yeah.>> So those have to be fully binary.So you can say, I don't understand this and markit in a way that you go back and check it.And I think then also that the language modelwill have to be like very fast because you can'tlike wait for three seconds until it comes withits response.Because at that point it's better to just get arejection than to just say it again, I found.>> So for first small recognition.>> It it depends on the length, right?
1:03:23String distance
other: >> Yeah. For small recognition changes, itmight be interesting to use the LevinLevenstein distance.Um, the string distance, right?>> Mm-hmm, let me thank.>> Since that's pretty fast to calculate.>> Yeah.>> And uh, and that that that already has afunction in Emacs that is implemented in C, soit's fast, and you can just run your currentutterance against your list of um your listof commands.The thing thatIt's only slightly complicated is if you're alsousing it to specify the parameter of something,then you have to test like prefixes against yourcommand list.Um, and I I probably need to find some way to geta command list out of uhout of phony again.>> Um>> Like a list of like all the literals we'retrying to match.As a prefix.
1:04:11Prioritizing more literal matches
other: >> Yeah, so I mean the also theLike uh when when I do the parsing in phony, it uhkeeps track for the different trees like the costof umLike the particular parts if you have ambiguity,for example.And currently it is only used to like minimizethe amount of free text. So say that you haveLike a free uh dictation, but then you have somecommands, then you want toUhLike match the parts that is the command and notthe free dictation.And I guess maybe like if you do some fancy uhthings with that cost function to instead likecompare the literals with the distance from uhLike the the actual token that you got, and thenmaybe you can.Uh, choose the path with the shortest distance.Do what you said.>> I was also thinking aboutGo ahead.>> I think that they'reSo sorry, go ahead.
1:05:09Approximate match on invisible text
other: >> I was also thinking about using the stringdistance to to implement approxim approximatematch on visible text so that our a voice repairstuff can do editing without having perfectmatches on the on the recognized text.>> But I think that we have two problems.One is is macro repair and the other one is umMicro repair because the macro is like you havelike maybe three, four paragraphs of text thatyou know is um that uh will be uhThat you still have to reread completely. And theother one is you just have an utterance or twoutterances that you might want to repair.And I think the promise are very different inboth cases.But I think.>> So this is like when you're already inediting mode.>> Yes.Yeah.I think like uh repair sounds likeUmIt's probably the solution for uh like dictationerrors, probably.
1:06:13Constrained grammars and Talon Voice
other: But I think for like command errors, then youreally like we really want to have aA model with a decoder where you can actuallygrammar constrain it so that.Like, uh, because all of these likefixing it up after the fact to try to make surethat it matches the grammar.Or likehacks on top of like uhAn issue thatShouldn't be an issue.Right.>> How is that? How is Tallinn's?>> I I I totally agree, yeah.>> How is talents performance when you're, youknow, kind of shifting between the things thatyou want to constrain things on and versus thethings you want to say, just insert and theninsert the text that you're dictating?>> Yeah, then they are as fast.Yep.So so, umLike uh, how how uhI think that it works if that like when it getsyour um utterance.Uh it applies some acoustic model upon it thatgives you theprobability distribution of like what characteryou are saying at the different points.UmOf your speech.Uh, and then it it tries to uhLike maximize the probability.Of the decoding.Uh, butConstraint to what you're saying.So then if like one part of umOf your grammar is just a phrase with likefree text.Then it just doesn't apply a filter upon what uhThe acoustic.Or or yeah, in the sear in the search from theprobability distribution of the acoustic model.So, I mean I it's not a noticeable differencebetween commands and uh free text.Dictation.>> Worth considering what
1:08:02Multilingual
other: Uh so the one of the other things that I waskind of trying to figure out was whether you canhandle multilingual text.Is itIs the recognition engine English only, or canyou handle other languages?Yeah.>> It's English only. I think that theremay have been one model for German as well, butuh, it's basically English only.Yeah.>> I think there was some to like the talentplus the the subscriber tier has access to otheruh other um speech recognition models. Like Ithink they mentioned whisper as one ofthe options.Tchau.Yeah.>> Yeah, I I haven't looked into exactlyhow they solved that, but because the actual likedictation is a kind ofUm, it's not the best in Talon, basically. So Ithink that.Perhaps they they then use like for when you'redictating the>> okay.>> They then pass it to Whisper instead tohave a better dictation.>> So that's it.>> Because then it can make more use oflike the structure of the English language.>> I wonder if our I wonder if our computersare probably like fast enough that we can run thedictation twice, right? Uh, run one run thedictation once using a more constrained grammarand run the dictation at the same time using autokey or whisper or some other free model. And thenif it if if if it thinks it's it's likely to be acommand, then parse it as a command. And if it'slikely to be a dictation, then go ahead and Anduse the dictation results instead. The onlyfiddly part is I like to mix commands anddictation in the same.>> Yeah.>> Utterance, like the way that I say remindme too, etc. etcetera, etcetera. So I kind oflike want the best of both.>> Yeah, I think if if>> But at least remind me too, it's actuallyfairly reliable.For me.>> I think if it is possible to like inyour utterance when you're decoding it, if youcould get like the time span for where you'reactually dictating a phrase or a free word.Then maybe you could just cut out of that partand then send it to Whisper for to decode.Like just part of your utterance.Yeah, the timestamps can be useful.Whistle.>> Yeah, I don't get word level timing datayet from from Auto Keet. I only get utter like Idon't I only get segment level timing data, butWhisper, uh, I think Whisper can do word leveltimestamps and the hosted, uh, hosted speechrecognition services can do word timestamps andstreaming. So it's probably going to come downthe pipeline and and be available locally, uh,for for uh non-GPU eventually.>> But um, Emacs, umLike with Airwig, you can see the insertion ofthe text. So Emacs can actually timestamp that.So that might be possible. And uh, but Ithink that.
1:10:46Editing text
other: It also brings the issue of where do you want toworry about the editing of the text? Do you wantto do it at the same time as you're dictating?To have it correct at that moment, or are youwilling to save the utterances for correcting itas part of the transcription?And then allow the computer to fix that later.Like in the example I show you first, where Ihave as part of the text.Delete the delete the last two sentences.Or replace this word for that word.So I think that LLMs are smart enough.To be able to say, oh, this is.Part of the text, and this is a command tothe transcriber.Well, at least it appears like they are.>> And I think for my brain, it it has beenhelpful to separate the the like the raw inputstage from the editing stage, because otherwiseI'll get lost and I'll lose the train ofmy thoughts.>> And I think that happens also when weare typing.Uh, that when we try to actually fix the problemsas we go, we tend to actually forget what wewanted to do because now our brain isconcentrating on fixing.the spelling mistake that we had. That's one ofthe things that I see the advantage withspeaking, because you don't worry about thespelling. And when you're typing, you think, howdo you spell this? And you stopsuddenly and your brain of thought actually uhstops at the same time.>> So it sounds like>> Well, in that>> Go ahead.>> Oh, that's what I was going to say.That's that's kind of one of the things I've beenthinking about too, is like I've always done thefirst draft, you justYou just type. You don't, you don't worry abouterrors, you don't worry about.you know, any of that, and then you go back andyou, you know, fix it. But yeah, that is thestruggle when it comes to a word you're not, youknow, using as much, especially as the spelling.AndAnd then if you spell it wrong, you you do havethat in your head and you do kind of getdistracted. So IThat's, I think, is one of the big things aboutdictation that I want to.want to try using more, especially do try to getthrough things like blog posts where I feel likesitting down to type it.is different than talking through it.Yeah.That's what I thought that was very interesting,that idea of having dictating to another person.And being the person receiving the dictationversus being the person dictating toanother person.Maybe there's something about that because in thebank where I used to work.UhAt certain level, all all the people weredictating to secretaries who were doing that.And they had their own.um shorthand to be able to actually keep up withit, with the dictation.>> Oh yeah, one of the>> So maybe there's something there too.>> One of the embedded uh dictationinstructions models that I I came across was uhwas uh, yeah, you dictate as normal, but you pryou m you direct your editing instructions toyour your hypothetical secretary, right? So yougive your secretary a name, and that makes iteasier to separate the the instructions forediting from the rest of your text.>> Via voice did that because I rememberthat you were basically saying.Period.Coma. Semicolon.And things like that. And it will assume that youmeant punctuation at the same time that you weretyping. And that's one problem actually with themodels that we use. They insert the punctuationaccording to what they think we're actuallysaying. So that's why we need to go and repairit later.>> okay. In in addition to using L L Ms forrewriting, I think in one of your other emailsyou also mentioned using L L Ms to like to do thewhole MCP integration with Emacs and run sorts ofthings. Sorry, were you the one who wasexperimenting with that or have I gotten my wirescrossed with other people?>> Well, soMm.
1:14:44Large language models and context
other: What I did was the following. So, umI value the context that ChatGPT has for.UmMyUmwith my conversations. Every time that I open anew chat, it already keeps a lot of context aboutwho I am and the kind of expectations that I have.When we are doing it via an API, you lose that.So I have always missed the ability to talk tothe LLM.Via the browser.And uh, so that's where I basically created theequivalent to a Spookfox.Who allows me to send commands to ChatGPT and getthem back into Emacs immediately.>> Oh yeah, I have something similar.>> And umYeah, so you have you have something similar,exactly. So uh, the advantage is that is that aslong as you understand the JavaScript of theapplication, in this case, uh, Chat GPT.You can insert. So, for example, the uh, theTheyUmPoster style that I show of the paper.So that is actually done via Emacs, fromEmacs completely.So what I do is um I use Org ref.From kitchen, who?has now become a missionary toUh, visual code because he's no longer going todo Emacs. So we sent him as a missionary to thatpart of the world.And um, and then umIt downloads, it downloads the PDF automaticallyif it can.And then I have a command to open a session withChat GPT.uploads the PDF automatically so I don't have todo it.And it has the insertion of the prompt.And then Emacs just waits a sync.For the prompt to change in ChatGPT. The momentit changes, it downloads that PDF.that that uh png and puts it back intomy directory.So that's the kind of interaction that I don'tneed an MCP.I basically talk to the browser directly.To well, to chat GPT via the browser.And what has also allowed me is that I haveactually now a bookmap a tab manager inside Emacs.So anything that I want to do with the browser, Ican actually do it via Emacs.And the LLM can actually talk to Emacs.And through Emacs talk to the browser.So if I want to do something via clot in code inthe command line, I can say via Emacs, then talkto this tab, which is already opened and is thecurrent one, and then it doesn't have to worryabout authentication or anything like that.So, um
1:17:26Using Emacs to talk to websites
other: For example, umTo be able to talk to the website of theuniversity, the one that we use for teaching, Ican actually do it.Uh, via this interaction.So Emacs becomes kind of the bridge betweeneverything in my computer.>> I've a>> It's kind of the the center.>> I forget. Does your browser GT let us to dothat kind of JavaScript interaction with nonforeground, like with not the current tab withthe other tabs that are in the browser as well?>> Yes.>> okay.I should re I should revisit it.>> So the the chat GPT is like that. So Ican send it to the the the the the the tab and itdoesn't have to be the front tab. It alreadyknows which tab it is and Emacs is talking tothat tab uh irrespective of whether it's occludedor not.So there are a lot of advantages of being able toactually just connect the applications this way.>> I'll go look into that.
1:18:16Communicating with terminals from Emacs
other: >> Same with a terminal. So the terminal Iuse is Kitty, because Kitty allows you to createa socket.And being able to send commands to Kitty.Uh, via this socket. And uh, so the moment that Irun my email, I can actually have openautomatically a socket.to my university to be able to SSH all my trafficthrough a app, sorry, uh send my my data all theway through an SSH port.And so Emacs already tells Kitty, go and openthis SSH connection.In a tab.And uh, or if it's already open, then don't do it.So that's kind of interaction. So I think thatthe moment that we have tools that are kind ofprogrammable, the moment that we just havefull power.Over there.much more than when we have NCPs. MCPs seem to bemore like a straitjacket.Because they are very constrained about what theycan do. And here is more in terms of what doesthe JavaScript of the tab can do.What does the Elisp of Emacs can do?What does the JavaScript of Hammerspoon can doin macOS?
1:19:18OBS and other programs with sockets
other: >> Yeah, I've been having a lot of fun withthe WebSocket connection to OBS, as I'vementioned before. Also now, I've been lookinginto how uh subed works with MPV.And uh like I was resynchronizing audio and videosometime, and now I have voice commands forrestarting the video at a certain point and uhand just, you know, just m.Adding being able to add voice commands toapplications that have sockets and have havethese protocols for running them is great.>> Exactly.Yeah.Yeah, so that essentially is what happens, right?Once you can do it in Emacs, Emacs can controlwhichever other application you have.As long as he has some API to be able to do that.And um
1:19:59Youtube and org mode
other: And and then um similar with uh YouTube. Sorather than YouTube is horrible to keep trackof playlists.There's no way to know what you have playedor not.AndSo that's that's another aspect where uh it hasbeen actually very valuable to maintain inOrg mode.At least uh basically a uhA URL to I can actually show you quickly ifyou want.And share your screen. And let me share myscreen again.Uh, because while I was waiting forThe session. So, umAh, sorry.So this is this is another extension. Um, Ihaven't published it yet.So this is the the URL to the to the tothe playlist.And I'm basically saying, I wantFrom this playlist.Match the ones who have highlights in the titleand only give me the last fifteen.>> Nice.>> And then I run this and it actuallyfills this. And the first two fields are for myown notes.That I keep track of. So I use it for readingJapanese, so to listen to Japanese, uh, forsome uhpodcast that actually like to keep uhUhOh, about that, for example. This is the C theCBC about that. So he.About that doesn't have a playlist specifically.There's only one CBC l uh playlist.So this allows me to just go and grab the last.>> Yeah.>> Ten videos that contain about that.>> Huh.
1:21:35Customizing emacs for your needs
other: >> So that kind of things is what reallymakes us really crave Emacs.And and and um and I I've been using it sinceeighty seven, so has been a long relationship, so.>> Hey.>> okay.>> Wow.>> Yeah.So bring it actually, I think that that happensto all of us. You are a good example of that. AndI think that we are very thankful for what you doin terms of the community because.All of us.Most of the Emacs users are about creating aworkshop that adjusts to their needs.Rather thanthem adjusting to the to the workshop and then ifeach one of us findsuh their own way to actually do it.And then we share it with other people, right?okay.Um, the browser extension that I have to connectum to the browser, it's already in MELPA.It's browser GT.Um, I also extended bookmarks, so I have nowbookmarks with a muchNicere, uminterface and the ability to have tags.And uh, that's um also in MELPA.And uhYeah, so it's kind of pain it forward, right?That's what we all do.>> It's great.I'm looking forward to uh to revisiting that.>> But I'm going to post this one. So thisis actually the next one that I want to do. It'ssimple, but I think it's very powerful becausethen I can actually keep track of what Ihave watched.And uh, and and uh or justGive me the last videos and I don't have to wastetime in YouTube trying to find out what I wantto watch.>> And you can have a voice command that says,okay, you know, play play the next video fromthis queue.
1:23:13Little microphones
other: >> Exactly. Yeah, especially when you'reactually in the couch.Far from the computer, right?That's actually why I bought a little microphone.>> Ay, ay, ay.>> So uh, this is a tiny little microphonethat I wear.So the moment I get out of bed, I put one on.And they were so connected to my desktop.>> Uh.>> Uh it it even survived survived awashing.>> Ha.>> Hmm.>> The challenges of small tech.>> Because I forgot to actually take it off.>> Yeah.>> Exactly. Yeah.>> Which one did you end up going with?>> And uh, so I agree.Uh, so this is uh, what's the name of this? Um,Holyland. It's a very cheap microphone, it'saround thirty-five Canadian dollars.For a pair of two. Each one of them lasts mearound five, six hours. So with two of them, Ican last a day.And then I don't have to worry about my desktopdoesn't have a microphone.So, and I can actually just be around and beingable to control the computer if I want to.With the laptop, the the Mac laptops have verygood microphones, so I don't have that problem.And uh, but uh, with my desktop, it just doesn'thave one.>> I'm thinking of changing from my currentlapel mic because it doesn't have a batteryindicator. And so sometimes I've been like, oh, Iaccidentally ran out of of charge to somethingthat that kind of indicates the power level. So Ican at least look at it throughout the day. Um,and the like the DJ DJI minis also have some ofthem have onboard recording, so interesting. Um>> I use>> But I'm always I always have myphone anyway.>> I use a DJ I DJ I.>> Oh yeah?>> To record my thoughts when I walk.>> Yeah, yeah.>> And uh, because they have on board and Idon't have to worry about uh a connection to aphone or anything like that.I have also used it to record meetings.>> Mm-hmm.>> And they work extremely well, even in aroom with people.>> Hmm.>> I think that uh the voice recognition.doesn't require very high quality voice.And uh, it's just a matter of of recording it. Sothe DJI has all their advantages. I like this onebecause they're tiny.>> Yeah.>> They're very light.And they are very cheap.>> Yeah. And that one looks very discreet too,so you don't like look around. You don't walkaround looking weird.Yeah.>> Yes, and sometimes actually do it,right? So and I sometimes forget and I just walkout of the house. I think I lost one of thembecause I walk out of the house and then Idiscovered I had the magnet inside my shirt andhad no idea where I lost the other one.So>> If you can uh drop the uh>> Essentially, yeah.>> The um product details, I would be curiousabout that. I'll add that to my list.>> Oh yeah, yeah, I'll I'll I'll tell youabout it. Yeah, especially these days thateverything is on sale.>> So this is this is super helpful. Uh II'm just checking time becauseUh, technically, like.The kiddo is sleeping in, she's probably going tobe absent again this morning. I am trying to notbe stressed about it because she's still gettinggood grades. It does give you more time formeetups, which is great. So this has been superhelpful because I'm like, okay, now I want voicecommands in my mini buffer. I want voice commandsin my window manager. And it's nice to hear aboutthe high, like, you know, high, high uh value,low effort.voice commands that make a difference inpeople's workflows.
1:26:23Maybe a monthly meetup
other: Uh, do we want to do this sort of thing on maybea monthly basis? Uh, this sort is this sort ofsetup okay? Like, how do we want to connect witheach other going forward?>> Yeah, I think that we can do somethinglike um.Uh, what Org does and maybe have like a midlymeeting and whoever is around then.Just be there, right? And sometimes just to demo,sometimes just to talk.And umI'm here in Japan until the end of the year, anduh, but usually I'm in Victoria time. So for me,now it's eleven PM.And uh ten ten thirty, so that's been actuallythe challenge with respect to timing. But onceI'm in Victoria, then I think it's easier.And uh, but didn't work.>> We'll shift a bit later so that you're notwaking up at like>> Yeah.>> Four morning.>> I I I'm putting in the chat the um>> Yes.Thank you.
1:27:14Back to talking about inexpensive little microphones
other: >> The the name of the microphone I use.Uh, it's forty one dollars Canadian for.Two.Of them.>> Yeah, yeah.Two is good.>> And uh.That's actually one of them. There's anothermodel. This is a more recent model than the oneI have.And I think the one I have is no longer.UhBeen sold.And that button.Voice.It seems to be perfect.Cheap and um, and if I lose one, it's only twentydollars because I still have the other.>> And uh having two means you can slap outbattery wise, which is nice.Yeah.>> Exactly. The DJIs are significantly moreexpensive, and so that's always a problem.And uhBut yeah, I don't think that really requires avery high quality. Even a lavalier.UhWhite one is actually good enough. It's just theability to be.Uh, disconnected, right?>> Yeah.Yeah, and if you haveYou know, if you have earbuds and you'relistening to things, I er like as Mer as Ericmentioned, you know, the idea of being able touse Emacspeak to navigate through the text.Maybe with voice commands can be like next pageor whatever, right?Could be cool.>> There's another advantage of notcombining the headphones with the microphone ofthe headphones.In many headphones.The the moment that the microphone kicks in.The quality of the audio degrades.And um, so if you listen to music, it sounds wayworse the moment that the microphone startsto work.And so that's another advantage ofseparating them.Uh, your headphones fromUmThe microphone.
1:28:58What's next
other: >> What are people working on next in terms ofuh their setups?What are they figuring? What are you allfiguring out?>> I'm going to keep playing with audioand umWith voice. Uh, I'm also post uh, so we are veryclose to Hammerspoon's version two.So we're working together to uh debug it and uhand then get our modules. They're called spoons.And um, so uh trying to.Mm-hmm.Get spoons at the same time with the new release.And so that's going to be a major one for us.And uh, because we are basically living behindLua and moving completely to a differentlanguage. So everybody will have to uhYes.So that has been kind of my big open source workfor the last two weeks.Probably for the next two weeks, uh, again.And then umUh, what I'm going to do isTomorrow I'm going to post.MyRepository for Onivaben.And my modifications to earwick in a in a branchrepository. So you can see what I have.And uh, and then also my configuration, so whereI configure my own commands and thetranscription, the uh voice repair, so you canactually see what I'm doing.Uh, my configuration is just a mess. UmI never actually posted it, but I I I canactually extract that easily.>> That's okay. It cannot be more messy thanmy config, and somehow you all managed.>> Uh, well, that I think that's true. Anduh, but I have to be honest, so um, I ask uh helpum from Claude to be able to understandyour config.>> Totally fair.>> Uh, so that has helped our hello and>> Although Michael, I think, has been uhdoing it old school and actually like figuringit out.>> Yes.In parts of it, yeah, I still have a long way togo when it comes to Lisp, but I am I am workingon that.
1:30:58Figuring out a smoother on ramp
other: >> And I think, Eric, you've been interestedin having kind of a smoother on ramp, especiallysince EmacsConf is coming up in two weeks, so wemight get more people interested in uh>> Yeah.>> Invoice.>> Yeah, I mean it it would be nice if uhlike the setup that you guys use if it uh waslike easy to install. I haven't tried to do it,so I don't know how.Like, umHow far it is from, you know, wanting to uh setit up to having it set up with phony.Yeah, how much work that is. So I mean, uh,optimally it would just be like you install phonyand then you like M-x install blah, blah, blah,and then you are ready to go.UmI don't know if it's that.Simple.Oh uh>> So I guess then if you can get uh your uhYour your L L M to generate the uh instructions.>> Instructions.>> And if I uh, you can tell me like what Ineed to go back and and generalize to make itsmoother, I guess.I should I should I should test it with a with asample thing, a sample account so I can see whatit's like when you're starting from scratchinstead of cobbling everything together a littlebit at a time with duct tape and string.>> I mean, because I mean today theprobably the the probably most difficult part oflike getting started with uh Emacs lesson,for example.If you know, just getting a talon.Running.Uh andIt's not really possible for me to automate anypart of the installation process because it isproprietary, so like it's not.Something that I am allowed to do according tothe license. SoUh, that would also be a thing that would be verynice with these uh free models is that you couldlike have an even smoother on rampexperience than.If you are using Talon.If you can automate it all.>> That nerd dictation that I mentionedgetting working with speech input takes a it itIt mentioned taking a constrained vocabularyalso, so it might be possible to use that.As a as a kind of just aconstrained text out of it sort ofdictation thing.>> Yeah, I'm thinking solid.I mean, there's a difference if you're havinglike a constrained vocabulary versus aconstrained grammar.>> Yeah, it's true.Yeah.>> Because uh, you want still to be able tohave free words and free phrases inside ofyour commands.UmYeah, it's a language problem at the end.And then we have to learn it.>> Uh, okay. Actually, it it takes a Vossgrammar file.I don't know what that means.>> Mm.>> But okay, maybe it's a grammar thing too.I don't know.
1:33:50Monitoring multiple audio devices
other: Uh, for my part.But with EmacsConf coming up, I'm going to see ifI can convert my ASR setup, which mo whichmonitors different audio devices and labels theinput and then handles the events and and allthat stuff so that I can monitor multipleaudio streams.And I think it's doable because instead of justinstead of starting the process directly fromEmacs, what I can do is I can change my processto just tail a like a like a log file that allthe other processes are appending to. So I canstart one process per web conference room thatI'm attending. And then if somebody says, helpSacha, I want it to like erase the, you know,raise the alert, flip the window, to change thething in my Org dashboard so that it's likequantified red or whatever else.Uh, and I think it's doable because uh the waythat they've set it up is it's it's JSON L, soit's one event per line.And I can just have all the different processesthat are running ASR on different devices writethe one log file appending to it and then haveEmacs tail it to uh to keep reading the events.So it's going to be chaos, but it's going topossibly be interesting.>> Until everybody learns that.>> For the purposes of monitoring events.Mm-hmm.>> Until everybody learns that you're doingthat and everybody starts saying, help Sacha,help Sacha, help Sacha.>> Well, and then and then I qu I spend likefive minutes hacking a the equivalent of aslash ignore.So I could say, if it's from this, you know, thismeeting room, then don't do it. Uh, and I Ithink, Michael, from the conversation in Linuxsaloon two two eight, it's something that pe uhpeople are interested in, you know, kind ofmonitoring a meeting in the backgroundfor keywords.>> Yes, uh, there was there were.>> So>> Discussion on that, uh>> It might actually be generally useful.>> I know Nate was saying he wanted to haveit, uh, you know, just alert him when someonesaid his name.okay.>> And then you can imagine having an LLM, youknow, kind of summarize the last three minutes ofconversation, saying, okay, what am I respondingto here?I wasn't paying attention.So that'd be cool. Uh oh.>> And uh, that's actually something thatthe literature mentions, uh, the issue of recalland precision.With many of these things, so.>> Yeah.>> You essentially have to balance both.Mm-hmm.
1:36:10Directing speech recognition results into etherpad
other: >> Yeah. And the other thing that I want toexperiment with speech recognition wise isdirecting the uh the um automatic speechrecognition results into an etherpad so that wecan get live live ish transcription of the theevents, um, in a way that's editable by people.So in case you want to fix the misrecognizedwords in real time, it's possible. And I justcame across Ethermax, which lets us edit.Etherpad like web based collaborative documentsfrom uh from Emacs without any JavaScriptclient side.So, uh, so it should be straight straightforward,especially since it it does the right thing, evenif you insert into the buffer. So I've tried justdictating to it using a regular dictation setup,and that worked.So all I have to do is is redirectly uh thetranscript events um into that one so that theygo out into this pad that everyone else can seefrom just their web browsers.>> And in theory, you could also do it witha Spookfox because you could send the text.Via that intoThe web page.Yeah.>> That was actually pretty complicatedbecause I couldn't figure out how to, you know,how to wait what how do you how do I insert it sothat it triggers all the right events?But yeah.>> okay.>> Ty typing you're trying to find the elementand and how to trigger the events that cause itto be noticed in the right way. But sinceEthermax has sorted all of that stuff out on the
1:37:33Questions and answers from irc
other: Emacs side, I can do that. And then I can do the,you know, t monitor the IRC for questions thatpeople ask and get that posted as well. And maybehave it read out to me also when somebody has aquestion in IRC, so I can then go look forthe appropriate.>> Your computer is going to be busy.>> You know, place and and make sure it's inthe queue for the speakers to answer.So this all this voice recognition stuff iscoming at the right time.>> Your computer is going to be very busy.No.okay.>> That's I I have never tried running sixdifferent um recognition threads on it. Like thethe auto key server that I use, I've alreadychanged it with the help of LLM to bemulti-threaded. So it can it can do multipleworkers. So it's just, you know, can I makesense ofmultiple audio streams, multiple transcripts.>> Well.>> Uh, can I turn it into text, which iseasier for me to process simultaneously, comparedto trying to keep track of spatialized audio?Uh, also another technique that I'm tryingthis year.
1:38:35Transcription in the background
other: >> Yeah, and that's why I think I really,really want to try uh what you and Michael havedone, which is sending the audio, thetranscription into a buffer.Even if that buffer is buried and just keepthat updating.As long as the transcription is on.>> I used it recently.>> That seems to be very useful.Mm.>> Um, cause I so I have mine actually goingto a VTT file, so it's timestamped against my mymy recording from OBS. And I use it recently toclip or actually too to add chapter markers rightaway to my YouTube live stream afterwards becauseit was much easier for me to go back in. I didn'thave to wait for the, you know, the Whisper X out.tr transcription after the entire thing, becauseit was transcribing it throughout, I could getapproximate timestamps right away.>> Yeah, that seems very powerful. And I II can I can see the use for me in terms ofmeetings, or even as you were saying, just notesthat you want to keep as you're doing work.Just vocalizing some of the ideas that you have,and then you don't have to worry about that.Text have beenmessing the buffer that you're working on.>> Which allows us to stay in command modemore more often, and then just explicitly go intodictation mode when you want to insert.>> Yeah, and I and I can see even uh usingan LM to summarize uhThat and basically keep it as part of your diary,your log, whatever it is. So it has a lot ofpotential. You could actually just start at thebeginning of the day. And if I always have themicrophone with me.Then that can actually run forever.until the end of the day, and then I can actuallyask for a summary of what I did or what myPlans to do are whatever it is.So I think that that information can be processedand then you can get some value out of that.The options areLots of three side.
1:40:36Mostly constrained by imagination
other: Maybe we're more constrained byBy our imagination now than by the technology inmany ways.>> And that's one of the interesting thingsabout working with it in kind of Emacs frameworkbecause it>> Mm-hmm.No.>> Like Emacs has always felt like that forme, where it's it's not constrained by thetechnology, it's more constrained by imagination.So we have an opportunity to play around withsome ideas that are much harder to implement withjust the kind of the commercial or even the umeven the open source, uh, the free and opensource uh dictation focused options. I thinkEric, you'd mentioned before that uh you foundtalent to be a little constrained in terms ofextensibility. So The the things that weexperiment with can uh can illuminate possibly uhsome some options or ideas that are hard toexplore elsewhere.
1:41:30Putting it to work
other: >> And I think for my can my next steps onmy configuration, it's really just kind ofFiguring out.What?I actually need and then also start looking atways I can incorporate this into my actual workmachine. Um, right now this is all on my personalmachine instead of my my uh Mac that I usefor work.So I think that's probably.I think where this eventually goes, because Iwould like to use some of these ideas we've beentalking about.You know, for my day job and not just for myPersonal projects that I'm doing here on the side.So I think that's umThat's why I'm kind of experimenting on mypersonal machine first and just figuring out likewhat works, whatWhat do I need and what do I find useful? Andthen I'll.I'll be probably moving some of thatconfiguration over to my work machine and kindof, you know, actually taking advantage of it.During the day job. And I think the uhHelp Mike, Mike is a good idea. I have a umIt's not a shotgun mic, it's a dialogue mic, soit's over my head. UhInstead, but it's a little on the pricey sidecompared to uh the lapel mic. And I think thelapel mic will serve just as well for what we'retrying to do.So probably looking at that.
1:42:43Sharing common components
other: Uh, I think uh one thing that we should, like, ingeneral, try to work towards is to not umLike to find.the common components of the things that we aredoing so that we can likeUh, share.more of uh the work and to like reuseLike the efforts that we have.So that like whenever someone uh wants to startwith speech recognition, they don't have to likestart from scratch and define like, okay, what'sthe command for undo? What's the command for redo?What's the command for going for to lineten, etcetera?Uh, so that we don'tLike uh, fall victims to the Lisp curse.Basically.>> Which is a there's an interesting tensionthere because on one hand it it helps to have uhkind of the the more natural vocabulary whenyou're starting out. It makes it a little lessintimidating to be able to say things like, uh,delete this line.Whereas, uh, for actual, you know, expert use,you want the uh the the tighter vocabulary whereyou're saying as few things as possible, whichmight mean things that don't resemblenormal English.>> Yeah. So I mean, umPhoney to some extent all already has likecapability for exchangingthe syntax for different commands or different umLike rules, how you uh refer to, say, a line orhow you would undo and etcetera.So that is also like a thing that I've beenthinking more about, likeHow one could make it easier to definesyntax variations.Oh.And then you would be able to, for example, havelike a simplified cursor free and then anadvanced cursor free andUmI think that would also be nice to uh make iteasier to customize like parts of the syntax thatmaybe is are difficult for you to say because.Like, umUh, I found for example that the defaultUh, alphabet of Talon had some words that weredifficult to say for me because of my accent, soI had to change.Exchange them, for example.And I think that could probably be the case forsyntax as well, that just some word orders are.Like more natural to say.For some people, but other people like thinkdifferently and want.Want it the other way.okay.>> Yeah, so that's why I was asking you, okay,how do I how can we define aliases for things?How can we undefine a rule in case we don't wantthis specific word because we use it for regular,you know, for for regular like for other thingsor there's a there's a rule that's matching, wedon't want it to match. And like last night I wastrying to figure out how to add French numbers,and I was trying phony put dictionary ordictionary put or whatever it was called. I'm notentirely sure I understand how to do that yet.>> Mm-hmm.>> I was trying to add it to the numbers. UmIn order to get it recognized, but it's aI don't know how to do it.>> What would you say? How how did you tryto accomplish it or?UhYou can.Yeah.>> You can talk first while I go figure out myw where I put my my test code.>> Yeah, so I was going to say, Eric, thatuh you remind me something I read of a paper lastyear that they said that one of the challengesresearchers have is lack of common infrastructure.That they can build on top. So they have to builda lot of um scaffolding before they can startexperimenting. And I think in a way, I think thatwe're in a great advantage because wealready have.a common layer from where we can start doingthat. I'm certainly going to look into funny andhow things get done there.to try to understand better how it works.Yeah, I I think that the Airwig has a branchwhere uhIt builds upon phony, but it builds upon a forkof phony, so it's not like completelycompatible with.Like other phonic grammars, but uhYou can also look at that as well.
1:46:40Modifying how phony parses things
other: >> okay, so it turns out sometimes Orukeetgives me hyphenated numbers. So if I say twentyone, I actually get twenty dash one, which I think>> Mm-hmm.Right.Mm-hmm.>> Uh, the phony number number parsing doesnot currently anticipate. So I was wondering howone deals with how how one adds that as a aAs an option.>> okay, so I think that that the way youcould do that now is thatUh, because number is a an interface rule.And the default like provider for that interfacerule is called thePhoney studlib number.Uh so what you could do is that you uh saydefine aAn open rule may be called the Sacha number.Where one of the alternatives are phone isDudlib number.And then you contribute another rule which saysthat, okay, when I say twenty-one.That should produce the number twenty one.>> okay.>> And this should also be an alternativefor Sacha number.>> All right.>> That wasn't.>> Um, but hasI'm wait, I'm a little confused. How how do Iget this?session number to plug into or the rest ofyour awesomeLike crystal free phony commands that use numbers.>> So the the cursor free commands, uh,when theyUh, need a number, they match on the rule whichis called number.>> okay.>> AndWhich actual rule it is, like because the numberrule is an interface, then there is someresolution logic for which rule that shouldactually match.So by the default number resolves to phonistedlib number.But you can define your own rule.where like one of the possible matches are aphony studlib number, but where you provide yourother alternatives.>> okay.okay.>> And then when you say colon providesnumber, then that will be used.>> All right.>> That's the definition of number.>> okay, that makes sense. So>> And then it will work everywhere that uha number is used.>> okay, so I am replacing the thing thatprovides number.Bye.Uh, by my my my thing that uses alternatives. Soit's not likeSo so I need to make sure that I include all theother behavior in it.Instead of just adding two.The list. okay, gotcha. I think.I will try it and I will report back.>> Yes, yeah. That that's that's how it howit has to be done, like uh currently. And I havethought a bit about how.One could make it easier to just like extend thisrule in a more direct way, but that is how it hasto be done today.>> okay.>> Yeah.>> Thank you so much.
1:49:18Regular expressions
other: >> And do you have something equivalent tothe regular expressions matching where youcan say?A slow, uh, think in terms ofE Lisp where you can defineA regular is aUmRegular expression replacement.Where you say this part is the one that isvariable, it's going to be replaced by that, butit has to appear within this context.Mm, I'm not exactly sure how you mean. So do youhave like an example usage?So I think in terms of regular expression thathas the parentheses.Uh, in between. SoIt matches the regular expression, but only thething between parentheses is going to be replaced.And the thing outside the parentheses staysthe same.>> Like keyword one, phrase that gets re youknow, that that's the parameter, and thenkeyword two.LikeA scene.Is it still?I do you have context before and after the stuffin the middle that you're trying to extract?And now she has uhThat reminds me.>> Trying to find an example.>> Yeah, yeah. okay. Well, while Dan isqueuing up an example, that reminds me, uh, I Ido have some of the the commands that I use todefine in regular expressions that I might portover to phony, and some of them have like phrasefollowed by keyword. And I think with your newUm, with a new cost sorting.It it can do that, right? Where where it will itwill recognize the phrase as the variable partand then uh match the literals at the end. Isthat correct, Eric?>> Yeah, so m if you have like aa prefix that they say defined literal and then aphrase as the suffix. Is that the situation?>> Uh no, I was thinking.>> Sure.>> okay, translate hello world in French,where the okay translate and the in French areboth literals, and then the phrase is inthe middle.>> Uh yeah, yeah, but>> Yay>> But I think that should have uh worked.Uh, before as well, unless in French wasoptional, maybe.So if in French was uh optional, then now itshould uh always pick the in French and not uhjust swallow it for the whole phrase, yeah.>> All right.>> Yeah.okay.>> I think that means I can move more of my,uh, more of my old regular expression basedcommands to to phony, which is so much nicerbecause regular expressions get really hairyafter a while.>> Yeah. Yeah. And then the ability to havethe replacement section. Um.uh embedded in the regular expression allows youto basically have a context sensitive grammar.That if the word appears in between these otherwords, replace it. Otherwise, don't do it.So so do you mean?>> I think that's that's kind of the use casethat I was just talking about.>> Yeah.>> Like the the my for example, my particularuse case is okay, okay, whatever, whateverin French.Where it only triggers if it's bounded by thosetwo keywords.>> Yeah, and I mean if you also have uhspecial words for like splitting. So if say thatyou have a command which takes two phrases as theinput and then you have aLike special word to differentiate between thefirst and the second phrase, then that shouldalso work.For example.>> Oh yeah, how do I do likeIs command chaining a thing that I that you canalready do in phony?>> Yeah.>> It it feels like it should from a quickview of the the source code.How?>> Yeah, at home, like if you uhUse phony evaluate or phony evaluate as event.Uh, then you can justLike write out theLike a sequence of commands, and they willinterpret that as a sequence of commands and not.That's just one.So say if you have a command that isYeah, so so if you have a command where you saygo up to go to the previous line.Then you can phony evaluate the go up, go up, andit will go up two lines.>> okay, so Dan's got an example in the textchat, which is a research forward and then this.Kind of like us up.Word by itself.Followed by stuff and then followed by end.>> And then gick on it.>> Although I think do you mean to actuallykeep the middle asYour parenthesized group that you're capturing?>> UhThe syntax of of Lisp of E Lisp is a little bitweird because then the replacement would besomething like this. So let me explain you whatthat means.So it will.Uh, the chat is replacing backslashes anyway, butthe idea here is that.The word this gets replaced with the uhA backslash one.It's still the same. So it just puts backslashone again.And ant is the backslash two. So that still getsreplaced. So what so is it's the same.gets replaced is the one in the middle.So the text in the middle, the word in the middlegets replaced by the.So in this case, this whatever end will always bereplaced by this, the end.It's just that the syntax is kind of weird. Butlook for aReplace rejects. And that's the function thatdoes it. So replace rejects. Look atthe documentation.Because that's the one that describes how thissyntax actually works.Where you define what is remains the same andwhat remains variable.And it's just that the syntax is kind of weird.And uh, Python hasAlso a different syntax. Uh, Pearl has adifferent syntax. Everybody does it in a slightlydifferent way.>> okay. Have you defined the phony rule thatuses phrase before?>> Me? No, I have not.Have not used it.>> okay. Eric, do you want to share an exampleor should I pull up one?>> UmUh um.Pull up one.>> okay.>> I uh, yeah.>> Hang on a second. Let me uhHa.Let me figure out how I can do it. Oh, I take a Itake presenter here.And I share.Uh, share my window.Which I should have a voice commandfor eventually.Uh do do.Any of these? Like, so all of my phrase commandsat the moment, just use it at the end.But now that I know I can do it in the middle,that's okay too.>> okay.>> Uh, so here, for example, I'm looking forweb search plane followed by any text, and thatphrase is available as a string in the defunct.Is that sort ofSimilar to what you're looking for with thecapturing groups?Yes.>> Uh, yeah, sim, yeah, it is. And uh,although the advantage of the regular expressionsyntax is that uh you can express the text as aregular expression instead of a string. So I donot know whether that's possible in here. Thatinstead of web search plane, you can say Wfollowed by something.Then followed by search plane.>> Yeah, so so I think w the question is, canwe s can we match based on regular expressionsand not just literals?>> Uh no, so the the unit of uh matching uhuh is the word.UmSå min phone ärUh, you still specify like a regular language,but it's a regular language of words and notof characters.>> okay. So the>> So if you have the plural, for example,you have to specify both.Yeah.okay.Because that would be an example, right? That youhave, or maybe you have, yeah, so the plural, Ithink, is the example that the the S is optional.At the end.Mm.>> So I wonder if something like the way thatPK syntax allows you to specify RX.Might be uh might be an inch like it it might beinteresting eventually to add some kindof operator.Too phony.So that you could match on a regular expression.So I don't have to create alternate, you know,uh, al alternatives for the plurals.>> Oh, not even that.Oh.But hold on, just just before before youstart thinking.Imagine that you can specify the type of work.Only do it for nouns, only do it for verbs.>> That one I think might.Might be handleable by a dictionary, but I'mnot sure.>> Yeah.Yeah.Of course, the problem becomes also the cost ofthe transcription, because then it becomes moreexpensive to do the lookups.>> Well, I have a s side example in the, umThe the thing that I just added in order to splitmy layout.Funny to to change my keyboard layout here.>> okay.other: >> So here, for example, I have uh I havethis, and it only triggers if the word is one ofmy keyboard layouts. So either QWERTY, main,reset, Dvorak, or French.Uh, and it will only trigger if it's that wordfollowed by the word layout.
1:59:32Figuring out words in context
other: >> Now, uh, synonymous, sorry, uh, lookingat the word without context is not sufficient todetermine what type of word it is.Because we have nouns that they also verbs.>> Mm-hmm.>> We have words that they are everything.And so that that requires parsing of the text.>> And that that that is a like I is there ais there a specific use case for a voice commandwhere you might find that.Like how would you distinguish that as a human?>> I think that that's more for voicerepair because then if you actually have the textas a whole.Then it might make more sense to be able to dothat type of analysis than as you're dictating,because as you're dictating, you might not haveenough context to be able to make those decisions.Like think in terms of uh maybe there would thereare cases where certain word when it appears atthe beginning.Uh, you might want it replaced, but not when it'sin the middle.Or you want it replaced if it's a noun, but notwhen it's a verb.>> I see. Uh, I in on the French learning sideI've I can use spacey to tag words by theirtheir type.Uh, and their their like gender and all theseother things. So it is possible to use naturallanguage programming libraries in order toidentify these things.>> Just fine.>> Maybe?So if you wanted to say, you know, have a commandthat says uh upcase all the nouns.Or capitalize all the nouns, because in Germanit's like that, right?Then, um, then either an L L M can do that foryou, or if you really wanted to do itdeterministically, then maybe an L P.>> The LLM also gets.los loses context context well loses it track ofwhat it's doing very easily. So if you ask it todo too many things at once.It will not do them.>> Which is one reason why.>> So that's another problem.
2:01:33More about voice repair in large language models
other: >> I've been hesitant about LLM rewritingbecause I don't want to have to be, you know, beverifying, did it change, you know, did it changemy wording, even if I explicitly told it not todo that.>> I think that was actually the advantageof being able to tell it to do voice repairbecause it has a different>> Oh yeah.>> Interpretation of doing that and tryingto actually fix yourWith your wording, right?>> Yeah, yeah.>> Otherwise, you have to be very specificabout actually not doing that.And uh, but I think that uhAgain, so we have two problems, the problem ofinputting the text as we are speaking it, andthen the problem of fixing them later when.It's actually a more uh larger text.
2:02:17Regular expressions, and grammar portability
other: So uh if we uh get back to the like uh havingreg access.Like inside of a phony D fan.So I think thatThe reason that it would be difficult toimplement is thatLike it wouldn't be portable to talon. So when Iexported the grammar to Talon.Uh, soUhI think it would be pretty easy to implement likein the phony parsing side, but not umfor exporting to a grammar constrained recognizer.UmSo if I if we had that, then uh phony would.Not be like unified.anymore and then it would uh not be possible toshare grammars with uh each other anymore.>> I am.And also because then your your uh rule mightSo, it messes with other parsing things.>> Yeah.But I think that'sThat shouldn't be uhToo big of a problem with how the parseris designed.I don't think.So it's more a question of uh being compatiblewith the different uh back ends.Så datt.Like all grammars work for uh all setups.So
2:03:47Talon voice
other: I it's the first time I heard about Talon.So is is that better than?Things like whisper, or what would be theadvantage or disadvantages of that? Maybe we cantalk about that in another.Day, but I think that's also.Uh, I I got curious about actually what iscapable of doing.And then I see that there's actually paidfeatures also.But maybe that's for another day.I would say that for me the advantage isprecisely that.UmLike the the decoder from your speech is designedin such a way that it will.UmIt will only decode to a legal command, so youwill never have problems with.uh just m misrecognitions to like randomLike random misrecognitions. So it can onlymisrecognize into another like legal command thatsounds close to what you tried to say.Otherwise it says it basically ignores it, orwhat does it do otherwise?I wonder if he got frozen.>> Oh, it does look like it.Uh, I will let him know in the chat.Mm-hmm.Oh, he'sUmI think you're froze, Eric.You're frozen. YouHe will probably find out. I I actually haven'ttried talent much myself. I tried it briefly.And then I decided to just go with with Orkey onaccount of the uh the multilingual.Stuff, butThe constrained grammar recognition does soundvery tempting.>> Yeah, I think that we might be able toactually talk about that later.And uhYeah, I'm going to go too, so it's gettinglate here.>> Yeah, yeah. It's it's been two hours.>> And uh, but thank you very much for fordoing this. It has been great.okay.>> Yeah, we'll see you next month maybe. Uh,or once I survive EmacsConf.All right.Thank you.>> Yes, yes, and thank you very much fordoing that.Two. And uh>> All right.>> Always look forward to your newsletterevery week.okay.>> Uh, catch you all on maybe the Matrixchannel. And uh, looking forward to slapping morenotes after I steal large large parts of yourconfig and the packages that you're aboutto publish.>> okay, sounds good.>> All right. okay. Bye.>> Have a good day. Bye.
A while ago I wrote
that multi-variant themes have become the norm - pretty much every popular theme
these days is a family of a few dark variants and a light one. And every such
family ships its own command for moving between the variants:
modus-themes-toggle, ef-themes-select, tokyo-night-select,
batppuccin-select and so on.
I have to admit that I had completely missed that Emacs has a built-in command
for this since Emacs 29 - theme-choose-variant. I learned about its existence
only recently, when I tried it with my own
Tokyo Night theme and got this
in return:
Theme `tokyo-night' does not have any known variants
Not cool, given that the theme has four variants! So, what’s going on here?
The command
M-x theme-choose-variant looks at the theme that’s currently enabled and
switches to another theme from the same family. If there’s only one other
variant it just switches to it, otherwise it asks you which one you want. The
command is also available as toggle-theme, which is a much better name for the
two-variant case.
You don’t need to install anything to try it, as a few of the themes that ship
with Emacs come in pairs - tango and tango-dark, leuven and leuven-dark,
tsdh-light and tsdh-dark:
(load-theme'leuvent)
M-x toggle-theme will take you to leuven-dark, and another M-x toggle-theme
will bring you back to leuven. Pretty neat! The old theme gets disabled before
the new one is loaded, so you don’t end up with one theme stacked on top of the
other. (I wrote about that problem in
Clean Unloading of Emacs Themes)
Things are a bit different with the Modus themes. There are eight of them in
Emacs these days, so with modus-operandi enabled you won’t get a toggle, but a
prompt listing the other seven. And a theme that’s on its own, like wombat,
gives you the same error I got:
Theme `wombat' does not have any known variants
How themes opt in
So, how does Emacs know that leuven and leuven-dark belong together? In case
you’re wondering - it doesn’t guess this from their names. In Emacs 29 deftheme
started to accept a property list after the docstring, and the theme has to say
what family it’s a part of:
(defthemeleuven-dark"Face colors with a dark background.":background-mode'dark:family'leuven:kind'color-scheme)
:family is what ties the variants together. Themes with the same family are
variants of each other.
:kind should be color-scheme for a regular color theme. Themes that don’t
set it are treated as color schemes for the time being.
:background-mode is light or dark. Nothing uses it yet, but the manual
asks theme authors to set it anyway.
wombat sets a kind and a background mode, but no family. My themes didn’t set
anything at all - their deftheme forms are just a name and a docstring.
The autoload catch
Adding the properties to deftheme is not enough, though. They are stored on the
theme’s symbol when the theme file gets evaluated, and nobody has evaluated the
files of the variants you haven’t loaded yet. Emacs has to know the properties
of every variant before any of them is loaded.
The built-in themes solve this with a special cookie:
;;;###theme-autoload(defthemeleuven-dark...
When Emacs is built, the properties of every theme marked this way are
extracted into a file named theme-loaddefs.el, that’s loaded at startup:
That cookie means nothing in a package you’ve installed from MELPA, though. A
third-party theme has to use the regular ;;;###autoload cookie in front of its
deftheme. Starting with Emacs 29 the autoload generator knows about deftheme
and extracts only the properties from it, so you end up with the same put form
in the package’s autoloads file.
Without this the command will find only the variants that you’ve already loaded
in the current Emacs session, which for most people means none of them:
`foo-dark' has no variants
Who supports this?
I was curious how many themes have picked this up, so I went over the source of
60 or so popular ones. The short answer is “very few”. Protesilaos’s themes (Modus,
Ef, Standard, Doric) declare a family, and so do doom-themes and a handful of
smaller packages. Pretty much everyone else declares nothing, including big
multi-variant families like Solarized, Gruvbox and Kanagawa.
What surprised me more is that I didn’t find a single third-party theme that
autoloads its properties. As far as I can tell that leaves the built-in command
blind to the variants you haven’t loaded yet, and I guess that’s why the themes
that did the work kept their own commands anyway. (e.g. Modus loads its themes
without enabling them to learn their properties)
A few rough edges
The command is pretty basic and it has a few limitations you should be aware of:
It toggles only when the family has exactly two themes. Tokyo Night has four,
so I’d get a prompt every time. There’s no way to say “these two are the ones
I switch between”.
It doesn’t know what’s light and what’s dark, because nothing reads
:background-mode. You can’t ask it for “the light one”.
It refuses to work if you have more than one theme enabled.
It loads the new variant with a plain load-theme, so for a third-party theme
you haven’t marked as safe you’ll get the usual “Loading a theme can run Lisp
code” question.
That last one is the reason modus-themes-toggle is still around. Protesilaos
considered dropping it in favor of toggle-theme, and decided against it
because of the prompts.
Note: This is a command you invoke by hand. If you want Emacs to follow the
appearance of your OS or the time of the day, check out
Automatic Light/Dark Theme Switching.
What about older Emacs versions?
The good news is that the properties are harmless there. deftheme has been
ignoring any extra arguments for ages (I checked all the way back to Emacs 24),
so a theme that declares a family will load just fine on Emacs 27 or 28.
The bad news is that theme-choose-variant doesn’t exist before Emacs 29, so
the users of the older versions get nothing out of the properties. The autoload trick doesn’t translate either - the old autoload
generator doesn’t know about deftheme, so it copies the whole form into the
autoloads file and the theme gets declared at startup.
Both Tokyo Night and
Batppuccin support Emacs 27.1,
which means I can’t rely on the built-in command and I need one of my own
anyway. It’s not much code:
(defconsttokyo-night--variants'(tokyo-nighttokyo-night-stormtokyo-night-moontokyo-night-day));;;###autoload(defuntokyo-night-select()"Select and load a Tokyo theme variant interactively."(interactive)(let*((names(mapcar#'symbol-nametokyo-night--variants))(choice(intern(completing-read"Tokyo theme: "namesnilt))))(mapc#'disable-themetokyo-night--variants)(load-themechoicet)(setqtokyo-night--currentchoice)(run-hook-with-args'tokyo-night-after-load-hookchoice)))
The theme knows its own variants, so there are no properties to autoload and no
theme directories to scan. It works the same on every Emacs version, it doesn’t
ask you to confirm anything, and it can do things that only make sense for this
theme, like running a hook after the switch. That’s why I think that theme
authors who still support older Emacs versions shouldn’t rely on
theme-choose-variant for now. Just ship your own command, as most themes
already do.
Of course, nothing stops you from doing both. Declaring a family takes only a
few lines per variant, and it makes the theme play nice with the built-in
command on Emacs 29+. I’ll certainly add the properties to my themes, but their
own commands are here to stay.
Do you use theme-choose-variant? Did you even know it existed? I’d love to
hear about it in the comments!
Every Emacs user knows that pressing M-p in the minibuffer goes back through
the history of the things they’ve typed there before. That’s one of the first
things you learn, right after C-g. And if you go back too far you can press
M-n to go forward again. End of story, right?
Not quite! What happens if you press M-n right away, when there’s nothing to
go forward to? You might expect an error, but instead Emacs will often insert
something useful. That’s what the Emacs manual calls “future history” - a list
of things that the command guessed you might want to type next. 1
A Few Examples
Here are a few built-in commands where M-n does something handy:
C-x C-f (find-file) - inserts the file name at point (if there’s one) and
after it the name of the file you’re visiting, which is great when you want
to open one of its siblings
M-% (query-replace) - inserts the symbol at point and after it the last
thing you searched for with isearch
M-s o (occur) - the same suggestions, plus the active region
M-! (shell-command) - inserts the name of the file you’re visiting (or
the file at point in Dired), which is super handy for commands that operate
on the current file
C-x b (switch-to-buffer) - inserts the default buffer and afterwards
keeps going through the rest of the buffers
The last one shows something that applies to every command that uses
completing-read. When you run out of default values, M-n starts going through
the completion candidates themselves. So in a pinch M-n is a poor man’s
candidate cycling, even if you’re not using any fancy completion framework.
Tip: A lot of prompts show their default value (e.g. Describe function
(default car):) and most people just press RET to accept it. If the default is
almost what you want, though, press M-n to insert it into the minibuffer and
edit it there.
Using it in Your Own Commands
If you’re writing Emacs Lisp you get all of this pretty much for free. The
functions that read from the minibuffer (read-string, read-from-minibuffer,
completing-read, read-shell-command and friends) accept a default value,
and that default value can also be a list. The first element is the default and
M-n will go over the rest of them in order:
(defunmy-search(term)(interactive(list(read-string"Search for: "nilnil(delqnil(list(thing-at-point'symbolt)(add-log-current-defun)(andbuffer-file-name(file-name-basebuffer-file-name)))))))(message"Searching for %s"term))
Here M-n will first offer the symbol at point, then the name of the current
function and finally the name of the current file. There’s also read-regexp,
which adds a bunch of standard suggestions (the ones you saw in occur) to
whatever you give it.
That’s the trick behind most of the
smarter prompts
in the upcoming Projectile 3.5. I like this approach a lot, because the
suggestions don’t get in anyone’s way - if you never press M-n the prompt
behaves exactly as it always has.
Lazy Suggestions
There’s one catch with the list approach - you have to compute all the
suggestions before the prompt shows up, even though most of the time nobody
will ask for them. If they are expensive to compute that’s a problem. Enter
minibuffer-default-add-function. Emacs calls it the first time M-n runs out
of default values, and whatever it returns becomes the new list of defaults:
minibuffer-default-add-completions is what this variable is set to out of the
box, and it’s the reason why M-n goes through the completion candidates in
the first place. Here we just put our own guesses in front of them. Keep in mind
that the function gets called with the minibuffer as the current buffer, so if
your guesses depend on the buffer the command was invoked from (e.g. you want
the thing at point) you’ll have to switch to it first.
(with-selected-window (minibuffer-selected-window) ...) does the job. That’s
how find-file comes up with the file name at point, by the way, and I’m using
the same trick for Projectile’s projectile-find-file.
That’s all I have for you today. Give M-n a try the next time Emacs asks you
something - you might be pleasantly surprised! Keep hacking!
See C-h f next-history-element and the Minibuffer History section of the manual. ↩
The tiny group ofq Emacs users exploring dictation and voice control: let's bounce ideas around and see how far we can take this
Emacs users who are curious about speech: there are plenty of non-Emacs dictation tools like OpenWhispr and Superwhisper, but it might be worth the effort to make Emacs the center of your speech workflow
People who use dictation and voice control with other editors (Cursorless on VS Code, etc.): borrow ideas and share what you've come up with
People who haven't checked on the state of local speech recognition and who might be pleasantly surprised by what it can do these days
Me, so I can think about the things I want to experiment with and prioritize what I want to squeeze into these last two weeks before EmacsConf (aaah!)
Dictation is a tap away on Windows and macOS. If you're on Linux or if you're looking for something other than whatever's built into the operating system, tools like OpenWhispr are easy to install. Different Linux distros are working on integrating dictation: Omarchy has Superwhisper, Ubuntu is working on dictation with Project Myna. OpenAI, Claude, and Gemini all have conversational interfaces so you can chat with a large language model. Most of the tools I've seen start with dictation.
Some tools offer LLM-based rewriting to clean up filler words and false starts. You can edit, reformat, translate, and revise. Tools like Dragon and Talon Voice offer voice control and integrate into more applications.
There are any number of providers that would happily sell you a subscription for a dictation service with a cool demo, but you can get surprisingly decent results from free open-weight models that you can run on your own computer without a GPU and without cloud processing. I use sachac/whisper.el and phony with orukeet on a Lenovo P52 laptop (entirely on my CPU) from 2018. I use Kokoro for speech synthesis.
Sometimes I toggle speech recognition on and off with a keystroke, sometimes I switch between command and dictation mode, and sometimes I just leave it running in the background, using Silero voice activity detection to segment it by silences.
It does reasonably well. If you're philosophically opposed to large language models trained in massive data centers on enormous quantities of scraped data, you are not cut out of this game either. If you're open to more classical approaches like Vosk or CMU Sphinx, you might still be able to get voice control with a set of commands.
I've been experimenting with Emacs as the core of my speech recognition system.
You might be wondering what a 50-year-old text editing program has to do with speech recognition.
It's probably the most programmable piece of software around.
Over the years, people have built so much on top of it.
People have added task managers, note archives, email clients, web browsers, media players, and more.
I think it offers some interesting possibilities that other people might not have much of an opportunity to explore.
There are a bunch of us now experimenting with this, and before our meetup tomorrow, I wanted to think through the topic so that I can come up with more ideas based on things that are working well and share what I've been learning with other people.
There are three main topics I want to explore that might be at a bit of an interesting distance from the typical kinds of dictation that other tools offer:
No silos: taking advantage of what Emacs can offer
Typing + voice: using voice as an additional channel
Voice + other methods: capturing, editing and restructuring ideas
One of the things I love about doing my speech recognition through Emacs is that it
can take advantage of all the data and functionality that I already have.
Here are some examples of how effective it is when you don't have to deal with different applications for different features.
Speech recognition isn't 100% accurate.
A good speech recognition tool makes it easy to define a dictionary that influences how words get recognized.
For example, I refer to "Emacs" far more often than I refer to "IMAX."
I don't want to define this dictionary multiple times for dictation and spell checking and other things that I need to do with text. I want to fix misrecognized words once and have that available everywhere: when I'm dictating to my computer, when I'm automatically transcribing recordings from my phone, when I'm editing the transcripts of other people's presentations.
I want to be able to open bookmarks quickly.
I can use "open …"
to open one of my favourites in the foreground, and "background open …"
to open it without changing focus.
I can use "web scroll" to scroll the browser window without shifting to it, and I can click with "web click …".
I can configure some links to open in Firefox and some links to open in Chrome.
This uses a list of favourites that I can also use when writing blog posts, Markdown, Mastodon toots, and e-mails.
I can insert a link with completion.
I can even select some plain text (ex: "EasyEffects") and use my keyboard shortcut to automatically link it to the matching favourite.
I can save a link right from my blog post drafts with sacha-org-favorite-save-link.
And I'm not limited to websites.
I can run any kind of code or custom link through the same mechanism.
For example, I can say "open schedule draft" to open the draft schedule for this year's EmacsConf as an Org mode file and an SVG.
I don't have to manage different stores of data.
My voice commands have access to anything my Emacs has access to, which is a lot.
When I tell my computer to take a note or add a task, it can put it in the same Org mode file that's part of my daily routines.
When I'm trying to resynchronize audio and video in a recording, I can use "from the top" to restart the video player and jump to the first subtitle that I've narrowed my focus on.
I still type my code. I haven't quite gotten the hang of hands-free
coding yet, although a lot of people with repetitive stress injuries
have figured out things that work really well for them like Emacslisten or Cursorless.
Voice gives me an additional channel that I can use to keep my fingers
and my focus on one thing, while offloading the inevitable
distractions to something else that can keep track of it for me.
When I'm typing some code and an idea occurs to me, I can say "remind
me next week to …"
and the audio feedback reassures me that it's saved and I don't need
to let it occupy my brain.
When I'm stuck because I need to look something up, I can say "look up
…"
and my browser searches it for me in the background without stealing
my focus.
I love being able to say "let's go live" to start streaming on YouTube
and "over and out" to stop streaming, even when OBS is buried under
other windows on my laptop screen.
I like using voice commands to create natural shortcuts for the things
that I don't do frequently enough to dedicate and memorize a keyboard
shortcut for. It feels natural to use voice to expand snippets and call commands.
When I'm trying to figure out a bug or I'm thinking through a new feature, I can talk out loud and do some rubber ducking, and the notes are there so that I can go back over them later.
Misrecognized words are not a problem because if I capture enough context for myself, I can usually figure it out, and I have the recording that I can go back to.
When I get interrupted,
my notes are there to help me pick things up again.
For this, it really helps to be able to dictate somewhere other than at my cursor, and to integrate into all the other things that I do.
I prefer using a deterministic grammar to figure out my voice commands
so that I have a better sense of what's going to happen.
It's also pretty fast, and I can do everything locally.
I think this group of ideas is about offloading things using a secondary channel
so that I can keep thinking about something
without having to make a context switch.
Voice is great for that because I don't even have to move my fingers
or rearrange my windows.
For coding, it should be pretty straightforward to add
some voice commands that reload the web page or rerun the last test.
I should also be able to come up with commands to arrange my windows the way I want them. I
just haven't gotten around to implementing those yet, but I've saved the TODOs so that
I can focus on getting this post out the door.
When I'm writing a blog post like this, it's pretty natural to use dictation because there aren't that many weird things that are hard to say.
I type at about 100 words per minute.
I talk at about 210 wpm if I'm doing a full-on info dump.
I'm much slower at either when I actually have to think about what I want to say.
(I dictated+typed this post at about 26 words per minute.)
Talking helps me get the gist of the idea out of my brain before I can forget it.
I also like how, when I'm streaming or recording a video, having dictation means that I don't have to explain things out loud and try to type at the same time.
These are pretty normal benefits that you can get with whatever dictation tool you choose, so let's go into some of the more Emacs-y things.
For writing, I find myself shifting to getting the bulk of the ideas in through dictation rather than typing.
I still prefer to edit my own text instead of having a large language model rewrite it for me.
Here, Emacs's strengths as a proper text editor really come into play.
Org mode makes it so easy to manage text.
I've set up my dictation so that it's automatically split up into one sentence per line.
This makes each sentence easy to scan.
In an Org mode list, my dictation switches to automatically inserting new list items at the same level.
In a comment, it continues the comment.
Org mode shortcuts make it easy to move sentences and paragraphs around, reorganize lists, and move entire subtrees.
I can change between lists and paragraphs, between paragraphs and one sentence per line, and between comments and code.
I can separate my voice cursor from my
typing cursor with a command like "voice mark", which tells the computer where I want new text to go in. ("Voice clear" resets it.) Then I can use the keyboard to move around and do some edits at the same time. I can even switch to a different file to grab a link or copy some text.
Voice is also handy for switching things from one medium or another.
For example, I start many of my blog posts as sketch notes,
and voice lets me flesh out the idea in the process of getting it into my computer as a draft.
It does take a little bit of correction, but so would optical character recognition, even with an AI.
Having the ability to shift back and forth between voice and typing means that I can do other things with my hands. I have some fidget toys and a 5-pound weight near my laptop.
I can stand up and stretch.
It's nice to have more flexibility.
I'm still practising formulating my sentence all the way through before saying it, or at least speaking in more comprehensible chunks.
I often have lots of pauses and false starts.
Speaking more fluidly is a good life skill though, and it'll help me with making videos and talking to other people too.
I think this group of ideas is about using voice as an input method
and finding better ways to work with the raw material.
I'm thinking about voice commands that I might like to use for editing.
A number of other people have already started experimenting with those, like cursorfree and earwig. I think it's mostly a matter of picking the commands that I want and getting the hang of using them.
I'm also curious about using voice to sort ideas into different piles.
Like the way that I categorize lots of links for Emacs news every week.
I experimented with using voice for categorizing those before,
and I think it might be possible to generalize it so that I can write in a less linear way.
I can imagine brain dumping a whole bunch of points and then grouping them into the introduction, different supporting areas, and the conclusion.
People are already finding basic dictation useful, and voice control is also pretty mature.
I'm curious about the stuff that doesn't scale,
the things you can build when you have a
super personalized setup
where you aren't limited to a small set of features that the developers have anticipated.
My setup is nowhere near mass market.
I'm amazed that a few people have actually been able to scavenge enough from it to get things running on their systems.
None of these things are really revolutionary.
They're probably not even really good reasons to switch to Emacs if you're already comfortable with something else like Neovim or VS Code.
But I love being able to make these tiny tweaks to the way I work with my computer,
and given my experience with Emacs, I know they'll accumulate.
I'm looking forward to seeing what we can figure out together.
While reviewing the transcript and adding chapter markers (using sacha-subed-mpv-ocr-and-select-line-as-comment), I noticed that the audio and video tracks from BigBlueButton kept drifting apart throughout the video. I'm not entirely sure why. Even the original had these synchronization issues.
The desync bothered me enough that I wanted to sort it out. I could get the separate .webms for the audio, screenshare, and webcams, but their durations differed too, so I'd probably still need to figure out the offsets. I decided to work with the combined webm instead. I just needed to figure out the delays to add to the audio file to get it to match up. I'm not used to staring at people's faces trying to read their lips, but I'd had some practice when I corrected the offsets for the Emacs community panel. That one is public. Now my process is:
Jump to a speaker change, since that's usually when the timestamps drift.
In MPV, use C-+ or C-- somewhat randomly until I happen across a setting that lined it up. I think it's + to add a delay to the audio, which is needed when the audio says the words first and then the video follows. - is for when the video is ahead of the audio. MPV displays the offset when I change it, and I can also use I to display the stats.
Once I've gotten things mostly synced, skim backwards until I find the end of the previous segment where the offset needs to be different.
Add the value as #+AV_OFFSET: directive in a comment in my VTT file. Ex:
00:05:08.004 --> 00:05:11.531
our teaching materials.
NOTE #+AV_OFFSET: 600
00:05:11.532 --> 00:05:14.353
[Pedro]: And here in Europe we do have a
Test it by selecting a region with a few subtitles and using subed-record-compile-video to check it. I used or mpv --loop-file=inf to loop over the full clip.
Test the audio file for the whole video without regenerating the video part: mpv video-file.webm --audio-file=test.webm
Combine the new audio track with the video using ffmpeg, or regenerate the whole video with subed-record-compile-video.
Here are the offsets I came up with:
Offset
Start time
End time
-200
00:00:14.560
00:02:18.840
300
00:02:18.841
00:05:11.531
600
00:05:11.532
00:06:05.532
500
00:06:05.533
00:10:11.660
800
00:10:11.661
00:11:00.559
1000
00:11:00.560
00:13:17.451
1800
00:13:17.452
00:16:06.940
2500
00:16:06.941
00:18:16.704
3000
00:18:16.705
00:22:12.559
3600
00:22:12.560
00:26:31.406
3900
00:26:31.407
end
I'm not entirely sure that I've gotten the offsets nailed down yet, but they're better than the original. Once the talk airs on Dec 12, you'll get to see the results at https://emacsconf.org/2026/talks/ltx-talk/ .
So now I have a workflow for resynchronizing audio and video using Emacs. I really liked being able to navigate the video by using the transcript. It was easy to find the next speaker change to examine closely. I liked not having to do lots of fiddly little splits on my clips, particularly since I often found myself needing to move the offset a little earlier or later.
My next steps are probably:
modify compile-media.el to handle :av-offset for both open and closed captions
modify subed-mpv to handle jumping to the right place
modify subed-waveform to take the offset into account when displaying the waveform
Bozhidar Batsov has announced the release of Prelude 2.2. For those of you who don’t know, Prelude is a prepackaged configuration that is simpler and more flexible than configurations like Doom and Spacemacs. It’s not, I suppose, as full featured as Doom and Spacemacs but it’s less opinionated and easier to customize.
In general, I’m not a fan of prepackaged configurations but for someone just starting out, something like Prelude may make sense. In any event, Prelude has been around for 15 years and is a mature product. A product, furthermore, developed and maintained by an Emacs luminary.
One of the most obvious changes in this version is the change to the Tokyo Night theme. It replaces the traditional Zenburn theme. I hate both of them—especially Tokyo Night—but plenty of people disagree. In any event, it’s easy to change the theme so as usual with Emacs, you can have it your way.
One of the most significant changes is that Batsov has tried hard to make Prelude more familiar to “vanilla” Emacs users. One simple example of that is his use of use-package= instead of the Prelude specific prelude-require-package that previous versions used.
Another nice feature is prelude-doctor that troubleshoots your configuration and finds missing prerequisites. That makes getting Prelude setup easier.
Batsov has also sped up the startup process although, like me, he continues to insist startup time doesn’t really matter. There are several other changes so take a look at Batsov’s post for the details.
For someone who spends as much time in Emacs as I do, it is faintly ridiculous how much of my configuration time goes on the save keybinding. I have tried the stock chord, a shorter prefix, function keys, and spare keys; each one feels right for a day, and then the search starts again. So I am going to stop optimizing the key and let Emacs save the buffer for me. This post is the setup, not the verdict!
Here are the options for a built in automatic saving, so maybe I don't have to focus on any keybindings at all, but can I get used to it?
auto-save-mode is on by default in file-visiting buffers. It writes #file# beside the real file (TRAMP copies go to /tmp) after either 300 input events or 30 seconds of idle time. The original is untouched. It runs auto-save-hook but not before-save-hook or after-save-hook, so no formatter, VC refresh, or file watcher fires. Saving normally deletes #file#; after a crash, M-x recover-file or M-x recover-session gets it back. It is the only one of the two that protects a long continuous typing burst.
auto-save-visited-mode (Emacs 26.1+) is global and off by default. After five seconds of idle it calls save-some-buffers with no prompt and writes the real files. It runs the full save hooks, VC refreshes, backups, and watchers, and can create a file you were only testing. It also saves every modified file buffer, not just the current one, unless you narrow it with auto-save-visited-predicate (Emacs 29.1+), a buffer-local nil, or remote-file-name-inhibit-auto-save-visited for TRAMP.
That is the version I am trying: Org only, no TRAMP. It needs Emacs 29.1+ for the predicate; older versions would save every modified file buffer.
I am keeping auto-save-mode at its defaults and adding visited mode narrowly. Then I will live with it and see: does five seconds feel right?, do the hooks and VC refreshes annoy me?, does it save something I meant to discard?, and do I stop thinking about the save key (is this something I really want?)? If yes, the experiment wins. If not, I will know which side effects actually matter. I will still save deliberately before a commit or a risky change. Auto-save is a safety net, not a save point. I will don't worry report back, probably craving for a keybinding, but you never know!
Projectile asks you a lot of questions.
What do you want to search for? Replace it with what? Which command should I
run? For as long as I can remember those prompts were about as dumb as a prompt
can be - an empty line, maybe with the symbol at point as the default, and
you had to type the rest.
That’s a bit silly when you think about it, because by the time Projectile asks
you something it already knows quite a lot - the project you’re in, the function
your cursor is sitting in, the Makefile at the root of the project and what’s
in it. I’ve been meaning to do something about this for ages, and in the
upcoming Projectile 3.5 a bunch of prompts finally start to use that knowledge.
Let’s go over them!
The Search Prompt
Every command that asks what to search for (projectile-search,
projectile-grep, projectile-ripgrep, the search reviewer,
projectile-find-references and friends) now uses the same prompt. It’s still a
plain text prompt, so whatever you type is what gets searched for, but it has
learned a few new tricks:
RET on an empty prompt searches for the symbol at point (or the region), as before
M-n goes through a few more guesses - the name of the function you’re in,
the name of the current file and the last thing you looked for with Isearch
M-p goes through your previous searches, and the search prompts now have a
history of their own
TAB completes the word before point against the identifiers that occur in the project (super handy)
Here’s all of this in action:
The TAB completion is my favorite part. I can never remember whether something
was named projectile-replace-review or projectile-review-replace, and now I
don’t have to! The candidates are sorted by how often they show up in the
project, so the names you actually use end up at the top.
Where do the candidates come from? There’s no index and no tags file involved.
Projectile just runs rg (or git grep, if you don’t have ripgrep installed)
for the prefix you’ve typed and collects the words that start with it. That
takes a few milliseconds on a small project and a fraction of a second on
something as big as Emacs itself. Not too shabby, right? You need to type at
least two characters for the completion to kick in. And if you don’t like it,
you can always turn it off:
(setqprojectile-search-complete-identifiersnil)
Note: You might be wondering why the prompt isn’t simply using
completing-read. That would have been the easiest way to get completion, but
with something like Vertico pressing RET would then select the current
candidate instead of what you’ve typed, and I really don’t want a search prompt
that second-guesses my input. That’s why it’s a plain read-from-minibuffer with a
completion-at-point function installed in it, so TAB works the same way it
does in a code buffer. In the screencast above the candidates are displayed by
consult-completion-in-region. Without it you’ll get the stock *Completions*
buffer.
The Replace Prompts
projectile-replace reads what to replace with the same prompt, so everything
above applies there as well. When it asks what to replace it with, M-n
brings up the original text. After all, most replacements are a small edit of
the thing they replace (e.g. a rename), so it’s nice not to have to type it
again.
With a prefix argument the search and replace commands ask which files to work
on, and those prompts now complete over the file extensions that are actually
present in the project. (the most common ones come first)
The Command Prompts
The compile, test and run prompts got the same treatment. M-p has always gone
through the commands you’ve run before. Now M-n goes the other way - through
commands you haven’t run yet, but the project suggests - the default command for
the project’s type, followed by the commands of its
tasks (Make targets, npm
scripts, just recipes and so on). The tasks named after what you’re doing come
first, so the test prompt starts with things like make test:
The same suggestions show up on M-n when you run a shell command in the
project root with s-p ! or s-p &.
Filtering Search Results
Projectile’s search and replace results buffers have had filters for a while -
k/d to keep or flush matches by line, and K/D to do the same by file.
The file filters expect a regular expression and most of the time people type
pretty much the same thing there - something like ^test/.
Now the prompt suggests it for you. The default is the directory of the match at point,
and M-n goes on to that file’s extension, the file itself and then the
top-level directories that have matches, busiest first. Getting rid of all the
matches in the tests is D RET:
The Find File Prompt
projectile-find-file (s-p f) is probably the most used Projectile command,
and quite often the file you’re after is one that the current buffer already
points to - the module imported on the current line, a file mentioned in a
backtrace, the test for the code you’re editing. Projectile has had dedicated
commands for all of those forever (projectile-find-file-dwim,
projectile-toggle-between-implementation-and-test,
projectile-find-other-file), but you have to remember them and their
keybindings.
Now M-n at the plain old find file prompt brings up the file named at point,
followed by the test of the current file (or its implementation, if you’re in a
test) and its “other” files. After that it keeps going through the rest of the
project’s files, as before.
Projectile is pretty relaxed about what counts as a file name at point - a
bare name, a relative path, an import without the file extension, something
like cart.js:42 in a compilation buffer - they all work.
Note: Those are suggestions on M-n and not the default value of the
prompt for a reason. Completion UIs like Vertico move the default to the top of
the candidate list, and that spot belongs to the file you’ve been visiting the
most recently and the most often. Pressing RET right away should keep doing
what it has always done.
Odds and Ends
A few prompts that offer a handful of options now have a sensible default.
projectile-switch-to-buffer defaults to the project buffer you were in
last (just like C-x b), projectile-run-task to the task you ran last, and
projectile-find-file-in-subproject to the subproject of the current file.
C-u s-p C (projectile-find-changed-file with a prefix argument) asks for a
revision to compare against. It now defaults to the project’s main branch,
whatever it happens to be called, and it completes over tags as well, so
“what changed since the last release” is a M-n or two away.
projectile-add-known-project starts at the root of the project you’re in,
instead of whatever subdirectory the current buffer lives in.
M-n is Underrated
You’ve probably noticed that M-n shows up in pretty much every section of
this article. Every Emacs user knows that M-p in the minibuffer goes back
through the history. I’m not sure how many people know that M-n goes
forward, into what the Emacs manual calls “future history” - a list of
guesses that the command has made about what you might want to type. A lot of
built-in commands provide those (try M-n at the query-replace or find-file
prompts), but you’ll never see them unless you ask, so they are easy to miss.
It’s one of those fairly obscure Emacs features that really deserve to be
better known.
For package authors that’s probably the cheapest way to make a prompt smarter.
The functions that read from the minibuffer (read-string,
read-from-minibuffer, completing-read, read-shell-command) all accept a
list as their default value, and that list is what M-n goes through:
It doesn’t get in anyone’s way, it works with every completion framework, and
it’s only a few lines of code. I wrote a bit more about M-nhere, as it
certainly deserves an article of its own.
Closing Thoughts
None of those changes is a big deal on its own, but together they make
Projectile feel a lot smarter to me. All of this will be a part of Projectile
3.5, and it’s already available in the master branch if you want to play with
it today. If you can think of other prompts that could do a better job
of guessing what you want - I’d love to hear about them!
Every good thing should be a habit, and every bad thing turns out to be a habit as well.
Habit is such a great quirk. I lately realised that whatever productivity hunt or anti-procrastination drive we go on, habit is the only de-facto solution there.
How I noticed it
I started realising this after reading the slides by yantar92 (Ihor Radchenko) for his EmacsConf 2026 talk, Personal task management under stress (with Org mode). He is the Org mode maintainer, and he does it in his spare time alongside a day job. I have been following him and attending the monthly Org meetup, and I am always astonished by how he even manages his life: so many emails on the Org mailing list that only he can take care of most of the time, work life, personal life, pending tasks and patches to review.
In the talk he outlines how tasks cannot be spread across different places like apps, the browser, email, your head, a notebook and maybe a phone call. They need one home. His first rule is simply "If you manage tasks in Org, do it in Org", and the second one is the one that stuck with me:
Task management won't work unless it becomes habit. Ever!
This is where Org mode and habit come into the picture.
The habit I already had
I noticed that I often open reddit (r/emacs, r/OnePiece and so on), lobste.rs, mastodon and many more tabs to catch up every day and see what is happening. This has become so habituated that every day, without any effort, my hands naturally takes me there. It is a three times a day thing: morning, lunch and late night. That can be put down to media craving, but that is another topic.
The key thing to notice is that it has no obstacle. It is never missed, there is no holding back, and even at the busiest time there is at least a glance over it. That is my habit, and it connected all my GTD thoughts, productivity, self-help and everything else. From that moment I made sure, and even configured my system, to make it a thorough habit to capture notes, schedule tasks every day and just get on with them.
What a habit is made of
Both popular books on this say roughly the same thing in simple words:
In The Power of Habit, Charles Duhigg describes a loop: a cue triggers a routine, and a reward tells the brain the loop is worth remembering. To change a habit, keep the cue and the reward and swap the routine.
In Tiny Habits, BJ Fogg says to make the new behaviour so small it needs no motivation, attach it to something you already do (an anchor: "After I …, I will …"), and celebrate it right away so it feels good.
Yantar's slides put the same idea in his own words: "Build new habits using existing habits". My tab ritual is a ready-made anchor. The cue (morning, lunch, night) and the reward (catching up) are already there, so the task habit only has to ride along with it.
Habits in Emacs and Org mode
This is what that looks like in plain Org, nothing fancy. It is the same idea as my Art of Getting things Done post: start with defaults and let the system evolve.
Capture everything into one inbox
The cheapest habit is capture. One key, one file, no thinking about where it goes. org-capture does this from anywhere in Emacs, and you sort it later.
(setq org-capture-templates
'(("i""Inbox" entry (file "~/inbox.org")
"* TODO %?\n%U")))
(keymap-global-set "C-c c" #'org-capture)
(keymap-global-set "M-k c" #'org-capture)
(keymap-global-set "s-k c" #'org-capture)
;; *-k since sounds like `K'apture
(keymap-global-set "M-j" #'org-agenda)
(keymap-global-set "s-j" #'org-agenda)
;; *-j since sounds like A`J'enda
This is the anchor. Before reddit, open org-agenda (M-j). It takes a few seconds and it tells you what today actually needs. Yantar splits his day view into "Must do today", "May do today" and "Can do on a good day", which keeps a bad day from turning into a guilty one.
Open it anywhere, everywhere and anytime, make it a rhythm and make it a habit
Track the habit itself with org-habit
Org has a built-in habit tracker. A habit is a TODO with a STYLE of habit and a repeater, and the agenda draws a small consistency graph next to it, so a broken streak is visible at a glance.
(with-eval-after-load 'org
(require 'org-habit))
* TODO Process inbox.orgSCHEDULED:<2026-11-26 Thu .+1d>:PROPERTIES::STYLE:habit:END:* TODO Catch up: r/emacs, lobste.rsSCHEDULED:<2026-11-26 Thu .+1d>:PROPERTIES::STYLE:habit:Effort:0:20:END:
The second entry is my favourite idea from the talk: instead of fighting the distraction, give it its own habit with a time limit ("check social media (daily, once per day, 20 min max!)"). Clock in with C-c C-x C-i, and the Effort estimate tells you when to stop. A .+1d repeater means "one day after I last did it", and something like .+2d/4d allows a little slack for habits that are not strictly daily.
Review weekly, and plan to fall off
Daily habits keep things moving, and a weekly review keeps the list honest. Group the someday tasks under projects or topics so the review stays short, and trim what no longer matters.
Habits also break: a trip, an illness, a busy month. Yantar's fourth rule covers exactly this: "First, go back to the habit of using your task management". Do not rebuild the system, just open the agenda again tomorrow.
Closing
None of this needs a new app or a perfect setup. One plain text file (see Org mode is the best OBTF), one capture key, one agenda glance tied to a habit I already had. The tools only help once the habit is there.
Marcin Borkowski (mbork) has a nice post on how he uses frames in his workflow. The TL;DR is that because he often works on several projects in parallel, he has a separate frame for each project. That makes a lot of sense. You don’t get buffers confused among projects and everything for a project is “in one place”.
That brings up the problem of switching among frames. There is, of course, other-frame (Ctrl+x5o) but like other-window it can be a bit clunky. Mbork set out to remedy that by writing a function to switch to a given named frame. That’s sort of like ace-window for frames, except that you use the frame name instead of a label generated on the fly.
The first problem is that frame names don’t have to be unique. It wouldn’t be too hard to enforce unique names manually but mbork decided to rewrite set-frame-name to enforce a unique name when naming a frame. It’s pretty simple and should probably be the Emacs default.
Once he had a way of ensuring unique frame names, he rewrote select-frame-by-name to select a frame by name and to create a frame with that name if one doesn’t already exist. The result is a very nice workflow for handling several projects that you’re working on at the same time. Take a look at mbork’s post for the details.
Emacs Prelude2.2 is
out! 2.0 and 2.1 shipped within a few days of each other back in
March, while 2.2 took
eight months and about 150 commits. It’s a big one!
A New Look
Let’s start with the most visible change. Zenburn had been Prelude’s
default theme since day one, and I still love it (I’ve been maintaining
its Emacs port for ages, so it’s not like we’re breaking up). Still, at
some point I got tired of looking at it. These days I’m mostly using
Tokyo Night and Batppuccin (my take on Catppuccin), which I wrote about
a while ago,
and I figured it was time to freshen up Prelude’s look as well.
Tokyo Night is the new
default, with its light variant during the day and the dark one at
night. Prelude follows your system’s light and dark mode where Emacs
knows about it, and the clock everywhere else (see automatic light/dark
theme switching
for the gory details). If you’re a Zenburn fan, keeping it is a one-liner
in personal/preload:
(setqprelude-theme'zenburn)
What’s New
Broadly speaking, this release was about four things:
internal housekeeping and consistency (every module is now set up the
same way, the way you’d set things up in your own config)
modernizing the internals (more of what’s built into Emacs these
days, fewer third-party packages, faster startup)
covering more of the popular programming languages out of the box
better defaults for the UI and the overall experience
Here are the changes I’m most excited about.
A Welcome Screen
Prelude now shows you a welcome screen when you start Emacs
without a file to open. It points newcomers at the basics (your
personal config, the list of enabled modules, the manual) and gives
everyone quick access to their recent files, projects and bookmarks,
plus a tip of the day:
M-x prelude-welcome brings it back any time. If that’s not your cup
of tea, (setq prelude-welcome-screen nil) turns it off.
M-x prelude-doctor
When something doesn’t work, the first question is usually “what’s
missing?” M-x prelude-doctor answers that for you. It checks the
programs Prelude relies on (git, ripgrep, a C compiler for
tree-sitter grammars), the grammars and language servers of the
modules you’ve enabled, modules that do the same job (e.g. Company and
Corfu), and the obsolete Prelude hooks your config still uses:
It also lists the modules that were added to Prelude since you made your
copy of the modules file, which is a nice way to find out about new
modules. And the report is exactly what a bug report needs, so paste it
there.
More Languages Out of the Box
Java, C#, Kotlin, PHP, Swift, Julia, R, Nix, SQL, Terraform and Zig got
modules of their own, so Prelude now covers most of the popular
languages out there. More importantly, the experience of opening a file
in a new language got a lot better. Prelude offers to install a missing
tree-sitter grammar the first time you need it (and falls back to the
classic major mode if you say no), and it starts a language server only
if there’s one installed, mentioning it once if there isn’t. No more
Eglot complaining every time you open a file. Here it is for a Go
project on a fresh install:
M-x prelude-treesit-install-grammars installs the grammars of all the
modules you’ve enabled in one go, if you’d rather get that out of the
way.
Just Emacs
This one isn’t exciting, but it’s the change I like the most. Prelude
has always tried not to feel alien to people who know Emacs, yet over
the years the modules picked up Prelude-specific ways of doing things -
prelude-ruby-mode-hook, prelude-ruby-mode-defaults and the like.
Now every module installs its packages with use-package and sets up
its major modes with a named function on the mode’s own hooks:
The depth of -50 means Prelude’s setup runs before your own functions on
the same hooks, so your config always has the last word. Want something
extra in Ruby buffers? Add it to ruby-mode-hook, like you would without
Prelude. Want Prelude’s setup gone? remove-hook does the trick. All of
Prelude’s options also work from M-x customize now, and there’s a new
manual page on writing a module for those of you who’d like
to contribute one.
Faster Startup
I still think that startup time doesn’t really
matter,
but Prelude now starts in about 0.4 seconds in a terminal with the
default modules (down from 1.3). There’s a new early-init.el that
tunes startup, packages are no longer initialized twice, the shell
environment is read only for GUI frames and daemons, and a bunch of
things (TRAMP, Eglot, calc, etc) are loaded only when you need them.
You can keep your own early settings in personal/early-init.el.
Odds and Ends
A few more things worth mentioning:
The Vertico module got Embark
(C-. and C-;), the vertico-directory extension and consult’s
narrowing (e.g. < b in consult-buffer shows only buffers).
repeat-mode and context-menu-mode are on by default.
New optional modules: Corfu (as an alternative to Company), Apheleia
(async format on save), eglot-booster, Forge, MisTTY and AI (a thin
wrapper around gptel).
You can pick jinx as the spell
checker and ws-butler for
cleaning up whitespace, if you prefer them to the defaults.
Prelude installs fewer packages - browse-kill-ring,
discover-my-major, smartrep and gist are gone, as are which-key
and editorconfig on Emacs 30+, where they’re built in.
Most setups should keep working as they are, but a few things changed:
the theme, a handful of key bindings (e.g. the Go test commands, some
Ivy and Org keys, and M-y is Emacs’s own yank-pop again),
prelude-require-package is deprecated in favour of use-package, and
the prelude-*-mode-hooks are obsolete (they still run, and
prelude-doctor will tell you which ones you’re using). The upgrade
notes cover all of that, so give them a quick read before
running M-x prelude-update.
15 Years Later
Prelude turned 15 this year, and it’s in better shape today than it has
been in a very long time. I’ve got a few more ideas for 2.3, and I hope
it won’t take eight months this time.1 As always, thanks to everyone
who reported problems, sent patches and kept using Prelude over the
years! You rock!
I like to dictate one sentence per line.
My voice activity detection sometimes adds extra breaks in between lines if I pause too much in the middle of a sentence.
sacha-whisper-insert takes care of inserting the comment markers using comment-indent-new-line.
After I edit my dictation, I usually want to make the comments more compact.
The following function
overrides delete-indentation so that join-line and fill-paragraph all manage the common prefix properly, which means sacha-reformat-paragraph-or-region can cycle through wrapped, one line per sentence, or everything on one line.
;;;###autoload
(defunsacha-delete-indentation (&optional arg beg end)
"Join this line to previous and fix up whitespace at join.If there is a fill prefix, delete it from the beginning of thisline.With prefix ARG, join the current line to the following line.When BEG and END are non-nil, join all lines in the region theydefine. Interactively, BEG and END are, respectively, the startand end of the region if it is active, else nil. (The region isignored if prefix ARG is given.)When joining lines, smartly delete comment beginnings, such that onedoes not have to do this by oneself.From https://tony-zorman.com/posts/join-lines-comments.html"
(interactive
(progn (barf-if-buffer-read-only)
(cons current-prefix-arg
(and (use-region-p)
(list (region-beginning) (region-end))))))
;; Consistently deactivate mark even when no text is changed.
(setq deactivate-mark t)
(if (and beg (not arg))
;; Region is active. Go to END, but only if region spans;; multiple lines.
(and (goto-char beg)
(> end (line-end-position))
(goto-char end))
;; Region is inactive. Set a loop sentinel;; (subtracting 1 in order to compare less than BOB).
(setq beg (1- (line-beginning-position (and arg 2))))
(when arg (forward-line)))
(let* ((comment (string-trim-right comment-start))
(prefix-start (and (> (length comment-start) 0)
(regexp-quote comment)))
;; A continuation of a comment. This is important for;; languages such as Haskell, where -- starts a comment;; and --- still is one.
(prefix-cont (and prefix-start
(regexp-quote (substring comment 0 1))))
(prev-comment? ; Comment on previous line?
(save-excursion
(forward-line -1)
(back-to-indentation)
(search-forward prefix-start (pos-eol) 'no-error))))
(while (and (> (line-beginning-position) beg)
(forward-line 0)
(= (preceding-char) ?\n))
(delete-char -1)
(unless (save-excursion (forward-line -1) (eolp))
(delete-horizontal-space)
;; Delete the start of a comment once.
(when (and prev-comment? prefix-start (looking-at prefix-start))
(replace-match "" t t)
;; Look for continuations.
(while (and prefix-cont (looking-at prefix-cont))
(replace-match "" t t)))
(fixup-whitespace)))))
Let's use advice to override it so that it lasts even if I reevaluate the original.
A couple days ago I started typing a new Emacs mode for really fast image viewing and triage. (Click the link to read the rationale behind all this.) But after working with it for some hours, I realised that the layout just wasn’t ideal:
If we’re doing a line based layout, you have to have really small thumbnails — otherwise you get so little information density in a screenful.
And then I realised that the file names have very little interest. The size is only interesting if it’s zero — that’s a broken image, but a missing thumbnail would also tell me that. The date is the most interesting thing, but since I’m sorting by date, it’s not that vital anyway.
So:
A grid! Well, duh.
The package can do both layouts, but defaults to using a grid now.
The image details are still available, both as tooltips, via a command, and shown automatically when walking through the images with TAB:
I think that’s kinda usable? Gives you an overview while tabbing through images. Fast. Vroom vroom.
Back in 2017 I posted my emacs set up for finding files globally. I tend to work with lots of small projects instead of mainly with one at a time. When I use find-file I have to switch folders quite often. If I've already opened the file I can use switch-to-buffer, but then I have to remember whether I have the file open. If I've opened it recently I can use recentf. If I'm opening something in the same project I can use project-find-file. But a lot of times it's easier to use something based on locate, like icicle-locate or consult-locate. But locate is too broad. I want to find one of my files, not one of the files on my disk. I essentially want to treat my home folder as one big project.
In 2014 I was using helm; in 2016 I had switched to ivy; now I use the vertico+marginalia stack. I'm posting the updated code here:
Find files globally
1. Make a list of files
The locate command on Linux and the mdfind -name command on Mac produce a list of filenames on the disk that match some pattern. From that starting point, I filter the list to files that I might want to actually open in Emacs.
Text files. On Mac, mdfind "kMDItemContentTypeTree = 'public.text' restricts the output to text files. On Linux, I can check the extension.
Home folder. On Mac, mdfind -onlyin $HOME restricts the list to only files under my home folder. On Linux, I can check the filename prefix.
Only my files. I want to exclude files from third-party libraries (e.g. node_modules in JavaScript).
From an hourly cronjob, I make a global list of filenames that I am likely to work with. This is around 17000 on my system. I sort them so that the newer ones are closer to the top:
To make the recent-file-list query fast on Linux, fd --changed-within 2hours is probably the best bet. Linux doesn't have a real time filename index like Mac does, so the fd command on my system takes over 10X as long as the mdfind.
2. Static file list
I have these helper functions for reading a text file into a list of strings:
(defunread-file-into-string (filename)
"Read file contents into a string"
(with-temp-buffer
(insert-file-contents filename)
(buffer-substring-no-properties (point-min) (point-max))))
(defunread-file-into-lines (filename)
"Read file, split into lines, return a list"
(split-string (read-file-into-string filename) "\n" t))
Periodically I read .global-file-list.txt into an Emacs list, removing files that are generated from other files. For example if I have apple.md in the list then I'll remove apple.html from the list.
(defvaramitp/global-file-list '() "List of most files I work with.")
(defunamitp/update-global-file-list ()
"Periodically update my global file list."
(condition-case nil
(setq amitp/global-file-list
(amitp/remove-generated-files (mapcar 'abbreviate-file-name (read-file-into-lines "~/.global-file-list.txt"))))
(file-error (message "amitp/update-global-file-list: could not read global file list") nil)))
(amitp/update-global-file-list)
(defvaramitp/update-global-file-list-timer
(run-with-idle-timer 1200 t #'amitp/update-global-file-list))
(defunamitp/remove-generated-files (filenames)
"In a list of filenames, remove the ones that are generated from
another file in the list"
(let ((filename-set (map-into '() 'hash-table)))
(--each filenames (map-put! filename-set it t))
(--each filenames (map-delete filename-set (-amitp/replace-ext ".md"".html" it)))
(--each filenames (map-delete filename-set (-amitp/replace-ext ".org"".html" it)))
(map-keys filename-set)))
3. Dynamic file list
The static file list is useful but I want to merge other data sources into it:
Files from recentf
Recently modified files (.recent-file-list.txt from above)
Currently open buffers
Files in the current project
I merge these and delete duplicates:
(defunamitp/all-files-list ()
"Files to list in amitp/all-files";; Use destructive delete-dups, much faster than cl-remove-duplicates
(delete-dups
(append
(mapcar 'amitp/abbreviate-file-name
(append
(-take 1 recentf-list)
(amitp/buffer-file-names)
(amitp/remove-generated-files (directory-files default-directory t))
(amitp/remove-generated-files (read-file-into-lines "~/.recent-file-list.txt"))
(amitp/remove-generated-files (amitp/all-files-in-current-project (amitp/project-root-for-directory)))
(amitp/remove-generated-files (-drop 1 recentf-list))))
amitp/global-file-list
nil ;;; need this because append reuses the last element, and delete-dups modifies the list
)))
(defunamitp/all-files ()
"Global filename match, over all files I typically open"
(interactive)
(find-file
(completing-read "All files: "
(amitp/all-files-list)
nil
t
nil
'file-name-history)))
5. Annotating with Marginalia
Marginalia annotates the completion buffer when it knows they're filenames. I can tell it that my command is outputting filenames:
(use-package marginalia :defer t
:config
(add-to-list 'marginalia-command-categories
(cons #'amitp/all-files 'file)))
6. Customization
One thing I love about Emacs is that I can customize it for my needs. I don't think this code will be directly usable but the ingredients may be useful to remix for your own needs.
My previous post focused on my latest discovery of an Emacs feature --
window management with windmove.1 I described the way the windmove
functions facilitate moving point among windows, as well as deleting
windows. But I didn't mention that you can specify the window that
will display a buffer.
In the simplest scenario, I might be writing about an Emacs feature
and have a single window open. I'd like to visit my init file in
another window. Typically I'd press C-x 4 f, which runs the command
find-file-other-window, and then
enter ~/.emacs at the prompt. Emacs creates a new window
and fills the buffer with the .emacs file.
Where does this window appear? It depends on the size of the frame.
Generally if the frame is taller than it is wide, the frame will be
split horizontally, and the visited file will be placed in the lower
window. Otherwise, the split is vertical and the visited file will be
placed in the right-hand window. But if I wanted the opposite
behavior -- to split a narrow frame vertically, for example -- I'd
first have to run split-window-right (C-x 3)
to create a new window on the right, run other-window
(C-x o) to activate (or move point to) the new window,
and then run find-file (C-x C-f). A single
windmove-display-right followed by find-file
will put the init file in a new window on the right regardless of
the frame's aspect ratio.2 This is demonstrated in
the animated GIF, below.
One drawback is that the windmove-display functions will place "the
buffer displayed by the ... command [that you] invoked immediately
after" windmove-display. Sometimes that buffer is an intermediary
buffer that's used to clarify the new command's behavior. Thus,
org-agenda, which opens a menu, will put *Org
Agenda* in the default location. But you can outsmart Emacs and
run org-agenda-list (usually bound to C-c a
a) immediately after window-display-down to get
your agenda to show in the window below the active window on a wide
frame.3 There doesn't seem to be a way to change this
behavior -- you can't, for example, use a M-1 prefix argument to tell
it to skip one buffer. The prefix arguments are designated for other
changes in behavior.
The windmove functions let you "point" in the direction of the
target window, so I find them intuitive. They're packaged with
Emacs, and they make managing Emacs windows easy. So now this is
the most recent feature that I've adopted. But November isn't over
yet.
2 Unless the current window is too narrow for splitting.
3 Having just done that, I find the result a bit
unsatisfactory because the frame isn't split evenly -- *Org Agenda*
takes up 75% of the frame. But maybe that's because I have about
three dozen items scheduled for today. I suppose a well-organized
user would have better results.
At my day job, I use multiple Emacs frames a lot. I often work on two or sometimes even more projects in parallel, and the way I don’t get lost is that I keep every project in a separate frame. Moving between them with other-frame (C-x 5 0, which I also bound to M-) is sometimes slightly clunky – especially that from time to time I’d like to be able to see the list of all my frames and possibly select one of them. (Before you tell me that my window manager could do that, let me explain that I use terminal Emacs inside a virtual machine, so I only see one frame at a time.)
I edit a lot of transcripts,
and I've also been dictating to my computer more and more
for both prose and voice commands.
Speech recognition is pretty accurate, but there are some terms that it tends to get wrong.
There are also some terms that I find hard to say, like sometimes my brain will just hiccup and I'll end up saying "start screaming" instead of "start streaming".
I want to make it really easy to correct a misrecognized word throughout my current buffer
and save it for future edits.
One of the advantages of doing this kind of replacement within Emacs instead of a separate dictation tool is that I can use it for both editing text (like transcripts of other people's presentations) as well as pre-process the speech recognition results when I dictate or use voice commands to control Emacs.
I can even use it to start gradually getting my transcripts to follow Emacs keybinding conventions, like C-c instead of "control c", and for finicky capitalization like LaTeX.
I like using Prot's substitute.el.
I bind substitute-target-in-buffer to C-; . I can either replace the current word or select
a couple of words if I think I need to be more specific.
I ignore "SPEAKER_…" because then I can use the same shortcut to easily change speaker identification in transcripts.
(defvarsacha-substitute-save-changes"SPEAKER_""Non-nil means save changes to `sacha-subed-common-edits'.If this is a string, it is treated as a regular expression, and onlystrings that do NOT match this regular expression will get saved.If this is a function, call it with the target string. It should returnnon-nil if the substitution should be saved.")
(defunsacha-substitute-save-common-edits (target sub count scope)
"Keep track of changes so I can add them to `sacha-subed-common-edits'."
(when (cond
((functionp sacha-substitute-save-changes)
(funcall sacha-substitute-save-changes target))
((stringp sacha-substitute-save-changes)
(not (string-match sacha-substitute-save-changes target)))
(t
sacha-substitute-save-changes))
(customize-save-variable
'sacha-subed-common-edits
(cons (list sub target)
sacha-subed-common-edits))))
customize-save-variable is in charge of saving the changes after I replace something with susbtitute.el.
If I want to remove or edit entries, I can use M-x customize-variable to change sacha-subed-common-edits.
Here's another function to define a correction if you don't want to use substitute.el.
;;;###autoload
(defunsacha-subed-add-common-edit (beg end replacement)
"Add this word to the misrecognized words."
(interactive
(let ((beg (if (region-active-p) (min (point) (mark))
(skip-syntax-backward "w")
(point)))
(end (if (region-active-p) (max (point) (mark))
(save-excursion (forward-word 1) (point)))))
(list beg end
(completing-read
(format "Replacement (%s): " (buffer-substring beg end))
(mapcar (lambda (o) (if (stringp o) o (car o))) sacha-subed-common-edits)))))
(customize-set-variable
'sacha-subed-common-edits
(cond
((member replacement sacha-subed-common-edits)
(cons (list replacement (buffer-substring-no-properties beg end))
(delete replacement sacha-subed-common-edits)))
((assoc replacement sacha-subed-common-edits)
(setcdr (assoc replacement sacha-subed-common-edits)
(append (list replacement) (cdr (assoc replacement sacha-subed-common-edits))))
sacha-subed-common-edits)
(t
(push (list replacement (buffer-substring-no-properties beg end))
sacha-subed-common-edits))))
(delete-region beg end)
(insert replacement))
At some point, I really should abstract this out to its own package, because it's just so useful.
Other people have actually managed to get it to work, which is always a nice milestone.
Anyway, here it is, in case it's helpful for you too!
One thing that’s annoyed me for yonks is how slow Emacs is when displaying images. Emacs has never been fast on this point, exactly, and has gotten better over the years — but at the same time, image sizes have exploded. In the bad old days, images were just a couple of megabytes, but with modern cameras, images can be 25MB, easily.
So now it’s really painful to page through directories of images:
It takes half a second for each image, and if you don’t find that annoying, you’re way more patient than I am.
Those are from my camera, and I’ve adjusted the image size down to “just” 10MB — because it’s just too painful to deal with 25MB images all around. For instance, when posting a 25MB file to WordPress, it uses about half a minute to scale it down to various sizes. Not fun.
The Emacs slowness in this area has, in the past, led me to use other non-Emacs ways of looking through images. So horrible! When you find images you want to copy an image somewhere else, for instance, you have to go through all these non-ergonomic contortions… It’s a complete nightmare! Have you people seen non-Emacs interfaces!? They’re awful!
Now, Emacs has things like image-dired that will go through a directory and create thumbnails, which makes things more liveable. But it does that by creating thumbnails up-front, which I just don’t like. And it doesn’t really help with the display of the images themselves when you want to look at them.
Now, what’s the baseline here?
larsi@corrigan:/home/sony/ftp$ time djpeg DSC09468.JPG >/dev/null
real 0m0.128s
Well, just decoding one of these 10MB images takes more than a tenth of a second. Emacs also resizes images before display, so this is perhaps a more fair comparison:
larsi@corrigan:/home/sony/ftp$ time convert -resize 1500x DSC09468.JPG jpg:- >/dev/null
real 0m0.264s
So — large images just take a lot of time anyway, and there’s not much we can do about that.
But what if we cheated?
Whoa. No, those li’l images haven’t been resized and cached (like image-dired does) — they’re extracted directly from the exif metadata: All modern cameras store a thumbnail inside the images. So I’m just extracting them and displaying them on-the-fly. As you can see from the screencast there, it’s so fast that even if I jump randomly around in the buffer, it keeps up.
(It inserts thumbnails for the lines displayed in the window, and then the next and a half window’s worth, thinking that you’re presumably going to scroll down. And then whenever you move around, it inserts the thumbnails for the page you’re currently viewing. So we’re not wasting preciouses electricity on things that are never going to be shown — my test directory here has 8K images.)
If the images don’t contain thumbnails, the new mode does things the hard way — by calling convert to scale the images down. This is, of course, a lot slower, but things run asynchronously, anyway, so the UX is UXing, as they say.
(What’s that? They don’t? They don’t say that? They should!)
But what about looking at the pictures in full, then? That’s as slow as before, surely?
Let’s have a look at what’s in the JPEG:
larsi@corrigan:/home/sony/ftp$ exiftool -json -a -G1 -s -preview:all DSC09471.JPG
[{
"SourceFile": "DSC09471.JPG",
"IFD1:ThumbnailImage": "(Binary data 7453 bytes, use -b option to extract)",
"MPImage2:PreviewImage": "(Binary data 287215 bytes, use -b option to extract)"
}]
There’s a 1616×1080 “preview” image embedded in there, too!
(Side note — amusing JSON format here, with the size of the image (in bytes) embedded in a string. Which also includes helpful command line options. Such JSON.)
So:
Emacs displays these previews so fast without doing any magic that it refreshes faster than I can hit n.
If there are no thumbnails, the mode precomputes the next dozen images, so you only see the slowness if you never take any pauses. Lay off that n finger, man! Not cool!
(Or rather, it will do that tomorrow — my fingers got too tired from typing all day long…)
In addition, the new mode also allows looking at entire hierarchies with M-x image-triage-tree, which is useful when doing image archaeology.
The useful Dired commands are present in this mode, too — you can mark images (both from the listing view and the per-image buffer), and then copy them over somewhere. (This was the main reason I wrote this — I had a bunch of old images I wanted to go over and copy over the useful ones (therefore the name image-triage).)
It’s not feature complete yet, I guess… but seems to work fine for my use case, at least.
And I wrote the mode by hand! So there! Except that I got Claude to write a helper command (I’ve written exif parsers by hand twice already, so I didn’t want to do it again) in C to dump thumbnails, because exiftool is just too slow:
So the new C programme uses half a millisecond to extract the thumbnail. exiftool uses… er… let’s see… carry the one… 0.072s to do it. Is that right? Yeah, I guess — exiftool is a Perl script, after all. So the C program is… 144x faster.
Now you’re asking yourself — hasn’t somebody already written a thumbnail extractor that you can just apt install instead? Yes, exiv2 exists and is fast… but can only extract thumbnails, and not previews. And! It can’t extract to stdout — it insists on writing to the same directory as the image is in, so it’s a pain to deal with. So whatchagonnado.
(Typical Linux situation — one solution that’s general but slow, and one solution that’s fast but outdated and awkward to use.)
But I understand many people are opposed to using LLMs, so you don’t need to compile the extra binary. In that case, things look like this:
Not as impressive, but I guess it’s usable — it’s asynchronous, after all.
So there you go.
I’ve put the code on Microsoft Github, so you can give it a whirl if you want.
I really liked two things in this week's newsletter.
First, Ihor Radchenko has posted his talk on task management, Which he prepared for EmacsConf 2026, coming up this Dec 12 and 13.
He's okay with posting it early so that people can start thinking about the ideas in advance and make the most of the live Q&A during the conference itself, so check out how he deals with tens of thousands of items.
Similarly, the panel that he organized on Emacs community is now public, so you can take a look at it too.
That one is a long one, and I'd love to hear your thoughts.
The second thing that I thought was really fun was Ethermacs, which uses web sockets for synchronous editing, so now people who aren't using Emacs and people who are can still edit the same Etherpad together. (And using Emacs means no JavaScript needed, which is good news for our non-JS community members!) And after a little bit of tweaking, I've been able to use it to edit the etherpads that we have for EmacsConf. Whee!
(You might be able to tell that I have EmacsConf on the brain. =) )
Over at Ray on Emacs, Ray Zeitler writes about moving among windows
and discovering windmove. It was a nostalgic moment for me because
I’ve been in the same place. The problem with other-window
(Ctrl+xo) is that you may have to invoke it several times and, as Zeitler says, you can easily overshoot your target.
The next step in my journey—and apparently in Zeitler’s—was the discovery of Windmove. It allows you to use the arrow keys with (by default) the Shift key to move through the windows in a two-dimensional way. It’s a big improvement over the standard other-window command but it does interfere with certain Org bindings.
The next step in my journey was the discovery of abo-abo’s excellent ace-window package. It allows you to easily move among windows as well as perform many other actions such as splitting, deleting, moving, and copying windows. You can see a complete list at the link. To be honest, I use it almost exclusively for changing focus to another window. It works just like abo-abo’s other ace functions. You invoke it (I use Ctrl+xo to leverage my muscle memory) and the windows are labeled. Then you merely choose the label of the window to want to move to. As as added feature, if there are only two windows, it simply moves to the other window without the need for further input. You can also precede the command with the universal argument and it will swap the windows instead of simply moving to the target window.
All-in-all, ace-window is the best package I’ve found for window control. Perhaps it will be the next step on Zeitler’s journey too.
Two weeks ago I wrote about how I discovered and began using the
bookmark feature.0
Recently I came across the windmove functions1. This discovery
caused me to lose interest in bookmarks; now bookmarks are a mere
curiosity.
The windmove functions allow you to "operate" on a window; the
target window is given as a direction relative to point.
Operations include:
selection, like next-window, but direction overrides window order
deletion, like delete-window, but direction indicates the window
to delete
buffer display (not yet in use by the author)
Arrow keys specify the directions. Of course, arrow keys already
move point one character to the left (or right, up, or down). So
the windmove functions are bound by default
to S-<left>, S-<right>,
S-<up>, S-<down> for window
selection. For example, you can activate the window on the left with
windmove-left or S-<left>.
Org users already press S-<left>
(and S-<right>) on a heading to change TODO status.
As well, we press S-<up>
(and S-<down>) to increase (decrease) a heading's
priority. Luckily, it's easy to specify a different modifier key. I
configured my system to make windmove-dir respond to
M-s-<dir>2 with the following statement:
(windmove-default-keybindings '(meta super))
Similarly, you can delete windows in a given direction. For example,
to delete a window on the left, run windmove-delete-left. I've
defined C-M-s-<dir>3 for the
windmove-delete-dir functions by adding this to my init file:
(windmove-delete-default-keybindings '(control meta super))
I used to struggle with other-window (C-x o), sometimes
"overshooting" the desired window, or I'd resort to using the mouse
to click in it. Now with this intuitive method of selecting
windows, I can keep my hands on the keyboard and spend less time
figuring out how to get around.
Open a Dired buffer with the files you want to search.
Use %g to do a regular expression search through the files for one of the terms. The files containing the term will be marked.
Use t to toggle the marks, resulting in all the files that don’t contain the term being marked.
Use k to temporarily hide the marked files, leaving only those that contain the term.
Go to step 2 using the next term.
When you’ve searched for all the terms, you’re left with a list of files that each contain all the target terms. JTR recommends that you mark the remaining files and do a final regular expression search with the A command to search through the contents of the marked files and show the results in another buffer.
The nice thing about this method is that it’s interactive: you progressively narrow down the list of target files by eliminating files that don’t contain the terms your looking for. You can, as JTR says, even manually eliminate files that you don’t want to consider as you go along. It’s a good technique and worth remembering.
Here’s a Dired thing that most Emacs veterans know well, but only clicked for me yesterday: searching for specific words and terms in different files while narrowing the results down until you find exactly what you need.
There are many ways to do this, some in Emacs and some outside, but I find that the manual-visual process in the middle makes this especially powerful, as you get to see the files selected each time and decide what to keep as you keep narrowing down your search.
Let’s say you want to find journal entries where you wrote about a vacation that involved going out of state, and maybe get an idea of where you stayed, say a hotel vs. an Airbnb.
In Dired, go to the folder where the words are (say your journal notes directory) and enter %g for a regex search for term 1 — in our case, “vacation”.
Dired will mark the files containing “vacation” somewhere in the text.
You now start the manual narrowing process:
Enter t to mark all the opposite files, the ones that were not included in the results before. What you have now are all the files that do not have the word “vacation” in them.
Enter k to remove the marked lines from view (don’t worry, this just hides the files. They are still there, just hit g). You now have the files you don’t need — those that do not have the word “vacation” in them — out of the way.
You can now go back to step 1, running another search on those narrowed results. In our example, enter %g again for term 2 — “airport” (maybe you drive, but you get the idea) — and narrow again. Because we are now only working with the files that remained after our first round of narrowing, these files (by deductive logic of what we did) now contain the word “vacation” already. The files we are now narrowing (steps 3.1 and 3.2) will contain the word “vacation” and the word “airport”. When you’re done narrowing a second time and have the files that contain “vacation” and “airport”:
Mark all the files you have left (or the one you decide you want from what’s left, looking at the list of files), and enter A1. This works on the file at point unless you have a couple marked, so that’s why we need to mark those first. This runs a fresh regex search over the full contents of the marked files, and will show the results in a dedicated buffer, so you see all the results from all the files in a list, showing you which file they are from and on what lines you can find them. Since this is a regex search, you can get fancy here. For me, I found that at this point the selection is small enough to find what I need: I can run one search for “hotel”, another for “Airbnb”, no problem.
As I said above, there are many ways to run something automatic and not go through these steps, but the fact that you see the files in front of you is powerful.
For example, in step 5, when you look at what you have left, you might find an old packing list template that somehow snuck into your journal folder (this never happens to me though! I’m way too organized… uhm…), or maybe you have an idea of what time of year you went on a particular vacation you’re looking for (say if it was a vacation during the summer), so you can manually take out files that contain the above words but have a timestamp of December and February.
A runs the command dired-do-find-regexp, for searching, so it’s worth noting that in Dired it has a sibling: Q for dired-do-find-regexp-and-replace, which replaces the searched term with your choice. Great for fixing a mistake you may have in a couple of files, like a misspelled name you keep getting wrong. ↩︎
It’s been a little bit quiet around these parts; sorry about that. I’ve been really busy for the past fifteen months with a major project that I am finally ready to formally release. So I’d like to talk about that project, and also a potted history of AI and Emacs.
It’s called DreamCoder, an AI coding harness that is very different from the ones you’re probably familiar with already.
I installed Claude Code a few days after its first release some time in May 2025. I put some coins in the slot machine and I put it to work building a complex piece of enterprise middleware I’d built several times in my career. Wow.. watching this thing chomp its way through the project with that chaotic, early Sonnet energy. It was far, far from perfect; it required a lot of human steering, input and correction, but the speed advantage was undeniable, and seeing it jump between disparate programming languages, frameworks and theoretical and practical programming from one turn to the next was just such a sight to behold.
One thing that struck me with Claude Code is that it was the first terminal application I’d used in a long time. I found it an odd choice for a coding agent; then everyone else copied them and made their own terminal coding agents.
Why on earth do I have to stare at a shoe rack-sized terminal window to do this? Sure there are GUI versions also; but the terminal interface remains the primary modality for most of these tools. Most GUIs, and most harnesses now have them also, are second-class citizens. And they all look the same. A boring sidebar with chat headings and a chat pane is what most of them look like.
But a serious coder needs more than that. Even a casual user will bristle when they try to copy and paste multi-line text in a terminal.
So in May 2025 I decreed that I would build a better harness, and surely now that I have AI this should not take more than 2 or 3 months to build.
And so, after 15 months of work, and endless UI and backend iterations, culminating in a successful beta test, I am now ready to release DreamCoder, which is I think the acme of what a coding harness should be.
DreamCoder is a frontier coding harness with a tiling window manager that runs in your browser on all 3 platforms.
Before I get into the meat and potatoes of all of that, I want to talk about AI history and Emacs’s role in it.
Let’s roll back time to the 1950s.
Past
Emacs and LISP, if you did not know, both have a special place in the annals of AI history.
John McCarthy was an AI researcher at MIT, and in the 1950s he set out to create the Advice Taker, a piece of software that envelops a framework for what a basic human should know that he called commonsense reasoning using “mathematical logic”. His postulation was that if we can express with symbolic precision all the aspects of what constitutes humanity like ordinary facts about life, that we can set in motion the rudiments of AI.
In the 50s there was little in the way of computer software that could do this. To formalize such a system you need a lot of data, rigorously formatted, and a method of manipulating the data. The data and code itself may intertwine recursively, and so an ordinary programming language would not work.
To help him achieve this, McCarthy created the LISt Processing (LISP) language made up of two facets: M-expressions, a functional language in the vein of Algol; and S-expressions, designed for symbolic data representation, and never intended as a method of writing code. S-expressions were dolled up with parentheses. M-expressions meanwhile used square brackets to visually separate the two. Uniquely, the language specification had an eval feature that would prove that the language is also a universal Turing machine… if only McCarthy had the means to do so. It was theoretical because McCarthy lacked, in time, staff and money, what he needed build this recursive evaluator that can take as input its own world state and evaluate it alongside new expressions, a fact made even more apparent by the sheer complexity of his M-expression language and the limited resources he had at the time.
Steve Russell who worked with him proved him wrong the way most young people do: by just doing it. Russell wrote the first LISP Interpreter with a working eval function, but M-expressions got sidelined; the imperative, procedural nature of programming got squished into S-expressions instead. They had to hand roll the language on paper then punch it into cards and then batch run them. Eliding M-expressions was a simple matter of pragmatism. And so LISP was born. And through several accidents of history, M-expressions never gained traction. M-expressions live on in Wolfram’s Mathematica, but few other places.
Much later, McCarthy eventually conceded that,
“One can even conjecture that LISP owes its survival specifically to the fact that its programs are lists, which everyone, including me, has regarded as a disadvantage.”
S-expressions were always intended as the storage format with a bridge language to manipulate them. But by pushing evaluation into the same symbolic representation format as the data, we have what we call LISP today. That is why LISP is so unique. Consider a simple calculator. (+ 2 2) can simultaneously represent an expression that we want to compute, two plus two, or perhaps a ledger of record of a calculation we have already done.
McCarthy never built the Advice Taker in its purest form. He and his team ran into many philosophical, mathematical and computational walls that kept them occupied for a long time.
The idea behind the Advice Taker was simple. If you want to go somewhere in your car, you can symbolically express this by building a chain of narrative facts – kinda like a flowchart, but as small snippets of rules and facts, not as one grand design.
The system would automatically resolve ambiguities, and all the logician had to do was capture the microcosm of the world he wished to represent:
(at me home)
(walkable home car)
(walkable home driveway)
(drivable car shop)
And so on. If you’re a student of Computer Science you’ll see echoes of Prolog here. The intent was simple: if we can symbolically express the world around us, we can advise that symbolic world with real-life facts, and have the automaton that uses this reified symbolic world change with it.
But the axiomatic complexity of a world model would never survive an encounter with a 3-year-old child. Every axiom you write begets a new one — so you can walk to your front door? Well what if the door is locked? Or what if your car is parked on the street and not in your drive way?
A rules-based order of the world is a tender, beautiful one; but it is hard to build. It’s a fractal of ever-more specific and pedantic rules that conspire against you, just as you think you have a soluble world, typed and ready.
Anyone who has ever written Prolog knows exactly what that feels like!
I have my own personal story to add to this. In the 90s as a teenager I got a summer internship at a business that built banking software. They clearly didn’t know what to do with us teenaged interns, so on our first day they crammed us in a room and split us into teams and told us to build a flow chart for assembling a bike. Team exercise or something. Best one wins. We were told to be as specific and explicit as possible and account for as many conditions as we could think of, and the poor employees who had to mind us did their best to help. I distinctly recall losing because in my flowchart I forgot to open the box the disassembled bike came in.
McCarthy meanwhile eventually moved on and set up his own AI lab at Stanford, but the idea of the Advice Taker lived on.
In the late 70s Stallman and Steele create EMACS (Editing MACroS), also at MIT’s AI Lab, a set of building blocks on top of TECO, a famously inscrutable text editor. TECO did not update the screen by default; you had to toggle that on and hope your edits worked. You typed out terse keyboard commands, crossed your fingers and hoped you got it right, and then you patiently waited for your text manipulation to take effect. Rinse and repeat until you got what you wanted.
Stallman and Steele wanted more: they wanted macros so they could automate tedium of typing all that line noise. This strand of augmentation and later on self-modification is of course a unifying theme in Emacs today. The history of Emacs is long; but its outcome is known to us. I am typing this very article in Richard Stallman’s Emacs.
McCarthy’s Advice Taker left its mark in a subtle but indelible way. Warren Teitelman built the ADVISE system in his thesis with a cool title that reads like something out of a pulpy 1970s sci-fi novella: PILOT: A Step Toward Man-Computer Symbiosis. Teitelman, he later said, was deeply inspired by McCarthy’s original idea of advising systems.
In his thesis, he describes a method of arresting a function call and inserting code before or after it is run. He was tired of editing other people’s LISP code by hand, and wanted a way of modifying their code without touching it directly. He built and rebuilt his system several times over the years, culminating in his ADVISE system in Interlisp, a structured editor and language runtime for manipulating LISP code and data. Interlisp eschewed plain text files; instead, you manipulated the tree at a high level of abstraction with explicit instructions like “move X list to Y position”. You can see my own attempts at merging structured editing with plaintext editing in Combobulate.
MIT AI hackers eventually implemented Teitelman’s ADVISE system from his PILOT thesis in their own versions of Emacs. Later, it was canonized in Chalupsky’s own 1992 re-implementation in Emacs Lisp that lives on (M-x find-library advice.el) as one of Emacs’s advice systems to this day.
What began as an idea for expressing automata using symbolism in an as-yet theoretical language in the 1950s culminated in a system for dynamically altering functions in GNU Emacs in the 1990s. What an unlikely lineage and history.
A cast-iron system made of stern rules cannot spawn general intelligence.
Symbolism and AI did not end with advising functions. There were many attempts at symbolic intelligence. Terry Winograd’s SHRDLU; Marvin Minsky’s Frame Systems; and even Emacs’s ELIZA-style M-x doctor all make use of symbolic “AI”.
None of them brought us closer to the AI that proponents of symbolic AI hoped they would.
In hindsight that seems obvious.
Writing a LISP macro just so will not produce artificial intelligence; nor will a carefully crafted web of rules and symbolic algebra suddenly spark intelligence. We know that today, but for a generation of computer scientists it felt like the future we have all read about in science fiction novels: a perfect, logical intelligence. A positronic brain. Robby the Robot; HAL 9000; C-3PO; Data; or the Speedies and Cuties from I, Robot. The unifying theme of these science fiction stories is they are automatons that follow strict rules — they obey Asimov’s three Laws of Robotics.
Every turn of hardware and software brought them ever closer to one day realizing the vision of an artificial intelligence, captured in neat axioms and LISP S-expressions, and modified in tools like Emacs.
It is surprising that symbolic AI, the vanguard movement for artificial intelligence, would instead dissipate into the wider body of Computer Science and programming as tools, languages and concepts, but not survive as a viable method of achieving AI.
Perhaps we always knew. Because at some point – even if we never really fully internalized it – we discovered that a ductile system that is shaped by its master’s desires is a tool that survives the ages because it remains eternally useful.
A cast-iron system made of stern rules cannot spawn general intelligence.
For all the mathematical purity, beauty even, of the idea of a clockwork mind that is introspectable and malleable and its behavior expressed as S-expressions and interpreted by elegant algorithms and honed macros, we can, through the benefit of hindsight – now that we do have AI through other means – see that it was not to be.
The argument in favor of ductility is especially poignant when you learn of the Connectionists, which sounds like a bad 1960s band, but was in fact a loose coalition of people who believed firmly that neural networks, not symbolic AI, were the path to success. The Connectionist viewpoint was deeply unpopular in AI academia of that era, and funding for it was scarce.
Frank Rosenblatt invented the Perceptron, a foundational concept in neural networks, in 1957. Before Rosenblatt died in 1971, Marvin Minsky, an authority in the AI movement at MIT and a leading proponent of Symbolism, knifed the idea of Perceptrons and neural networks in a book he co-authored with Seymour Papert. They named the book, which they also dedicated to Rosenblatt, Perceptrons. The book deftly explains the mathematics of Perceptrons but undercuts their possible utility by showing that a single-layer Perceptron cannot represent an XOR gate. It was a deliberately obtuse reading of what neural networks could and could not do. With one additional hidden layer, a network can represent an XOR gate. It was a sneaky thrust of the stiletto: Minsky’s claims were overstated. A fact that was not lost on anybody in the Symbolic or Connectionist camps.
It’s disputed if the Perceptrons book led to the first AI winter in the 1970s. It certainly did not help. But funding for many AI research paths dried up in the 1970s.
The Connectionist movement was vindicated in the long run. They lost the battle then, but they won the war, and the fruits of their research eventually gave us AI.
The ductility we so prize in our software and tools today is antithetical to a strict, symbolic world model spun of axioms and facts that we hoped would one day birth AI. Yet to try and give birth to this world they had to build the most ductile tools of them all: LISP and, from that, also software like Emacs. The ultimate hacker’s tool.
It is ironic then that a neural network, a crude facsimile of how a brain works, a construct that is by its nature ductile and malleable, won out in the end.
So I feel a profound sadness that I started out programming DreamCoder in Emacs, the most extensible editor in the world, by hand back in May 2025, only to see DreamCoder write itself… in DreamCoder today.
Future
I am still sad, but I also know that our industry completely reinvents itself every decade or two. This is my second career upheaval. Most programmers today have not been around long enough to go through it themselves. So I feel for them that this especially massive quake is their first encounter with how unsentimental our industry is.
But for all the sadness, I wake up every day with a feeling of optimism that I have not felt in a very long time.
I finally get to build again, no longer weighed down by my decades of knowledge and experience that held my ambition in check. I truly have not felt this liberated since I was a teenager programming in Delphi, blissfully unaware that the things I was busy building were impossible for a self-taught teenager to ever realize. I see this reflection in others: the best programmers I know also love AI. Amateurs also revel in AI’s capabilities, happy that they can finally solve problems they could never afford to pay a programmer to do for them.
I must admit that building software has, over the years, gotten a lot more complex, with an ever-larger share of that work being repetitive tedium. This is more so with hobby software – as I do not get paid to do it, so I do not have a moral duty to see it through – where I’d do all the fun bits leaving just the enervating, boring and soul-crushing parts behind. Do you have a projects folder full of sad, abandoned projects like I do?
Now I can craft in abundance. AI has freed up a lot of toil but I somehow still find myself busy all day doing real work.
Building a coding harness is perhaps the closest I will get to the optimism all those researchers and scientists must have felt in the 1970s and 1980s. They hoped that with a little bit more work, their logical rules would kindle a new intelligence. Fifty years on, and I can simply tell DreamCoder to improve itself and watch as it changes before me. I can ask the AI running inside it to analyze the changes I have made to its tools and prompt and have it adjust them accordingly. It feels like science fiction; the very thing the researchers of yesterday strove to build. Yet we really do live in this reality now.
Taste is a scarce, human resource.
So. DreamCoder. Let me address the 900 lb gnu in the room: DreamCoder is not an Emacs-related application. The reason is unfortunately one of economics and access: I want to build an AI coding harness for everyone. But don’t worry: I have some cool plans for DreamCoder + Emacs, and AI + Emacs more generally going forward. So stay tuned.
But what about all those other coding harnesses? Well, most of those harnesses all suffer from the same mistakes. It is a problem that is not unique to coding harnesses or the people who make them, but a constraint we all labor under, and one that is not easily replaced by AI:
Taste is a scarce, human resource.
And for all the bounty of AI, it still requires a human to persevere and to see things through. One thing intensive use of AI coding has taught me is that we’re going to need a lot of computer programmers who know what they’re doing going forward. I believe this is so, because let us be honest, most people do not want to program computers, even if that computer can actually do the bulk of the work for them. It requires a steady hand to build reliable software; that has not changed.
Therefore, if we programmers have to spend a lot of our time interacting with AI, then the tool we do it with should be ‘human-centric’ in its design, and it should take advantage of all the modern features we have at our disposal.
Back in May 2025 I took a look at all the tooling and said “no, thank you.” Today I look at the landscape and I feel pretty much the same.
And I think I am not the only one who feels that way. Most of these coding harnesses, to me, feel bristly. They shouldn’t be; but they are like that because we are at an important inflection point where no one really knows what the future looks like. We’re all just… fumbling around a bit. It’s an exciting time to build software, even if we don’t quite know what the world will look like a few years hence.
One thing I am adamant about is that DreamCoder must be a powerful, frontier-class coding harness. That means it should have all the features you’d expect from that: backgroundable sub agents, MCP servers, cache efficiency, and all that stuff. Check.
Sub-agents
MCP servers
Your own agents
Terminals beside chats
The frontier-harness basics. Click any of them to see it full size.
But that stuff quickly recedes into the background because, you know, it just works. Day to day you will dart between chats and terminals and whatnot, and you need an interface that accommodates that. Emacs is a tiling window manager; so is DreamCoder. DreamCoder’s window manager is a little bit cleverer than most window managers as every pane has a minimum, comfortable and maximum size. The window manager will therefore ensure windows always fit snugly on your screen, and you’ll never end up in a situation where windows are tiny and unreadable. It has a sophisticated constraint satisfaction solver that tries to balance your demand for a new window (“open a terminal”) with the challenge of keeping your visible panes roughly the same size. If DreamCoder can’t wedge in a new pane, it’ll punt one to the hidden window bar. Just click it to resurface it, or hover it to see what it’s doing; it’s a live view.
Panes are made to fit; if a new pane must evict an old one, it is pushed to the hidden window box.Avy-style selection and embark-style actions.
Because of my Emacs roots, I think a good tool must be keyboard-friendly. Because it runs on a browser you get the mouse for free of course. But smacking the tab button over and over is a frustrating user experience in complex webapps, and doubly so a tiling window manager: where exactly are you going to end up when you tab from one window to the next? To combat that, I built an avy-style window and “point of interest” selector for chats. Tap a key and pick from a selection of “embark”-like actions such as clicking links or opening pictures. It’s a work in progress, but I think it works well.
Familiar type-to-complete mechanics
Most high-volume operations like opening and creating panes is done through a Helm-like interface with search-as-you-type. It’s really efficient, of course. And it works with a mouse also; which is sort of the point. The keyboard’s there for those who want it, and the mouse for regular folk who are just getting started. One unique feature of the design, which admittedly I am still exploring privately, is that everything is stored as Javascript objects (on account of running in your browser) so it’s not too much of a leap to build “macros” that prefill most of these dialog windows, leaving behind just the fields you want to edit.
But yeah. With DreamCoder I want to take the best of Emacs and its coterie of third-party packages and bring some of that with me. The world is still not ready for an Emacs-shaped future, sadly, so that is why DreamCoder is a standalone application and a web frontend.
Another thing that drives me wild: I see people with tmux running 10 claude codes (or codex, or…) cycling between them like a duck gallery at a carnival to see if one of them is done working, or if it needs human intervention.
So there’s two things to unpack here: one is running lots of things in parallel, and the other is observability. You need insight into what is going on: is an AI jammed because it’s awaiting an answer or a tool safety prompt? Perhaps you’ve parked a bunch of chats pending some conversations with coworkers or other work that must finish first.
In DreamCoder you have workspaces. They’re like virtual desktops (or window configurations in Emacs lingo): a snapshot view of panes as you want em. As you can see from the screenshots, panes expand to fill all the space. So if you want more space, you can: resize them (with the mouse or keyboard); shuffle them to a named workspace; or float them so they sit on top of the other windows.
The event graph
Objectives
Image panes
On your phone
More than a chat window, already.
But if you’ve got a lot of things happening in multiple workspaces, it’s hard to keep tabs on that. That’s why DreamCoder has a big, honking minimap in the top-right corner. One for each workspace. The minimap is a miniature of your actual layout. Each pane in the map gently pulses when it’s working, and it makes it abundantly clear when it’s blocked. When there’s nothing to do, it’s green.
Because workspaces and panes are distinct things you interact with, it must be easy to navigate between them.
I also wanted full-on, optional Emacs key bindings, but that is… pretty much impossible to properly build. Browsers lock you out of some rather important Emacs button combinations. Sadly that feature is parked until I can solve it on all major browsers without breaking your normal browser keys.
That’s not to say it doesn’t have Emacs-inspired key bindings. Most global actions are reachable with Alt+x, akin to M-x; local, pane-specific ones with Alt+c. Alt+m activates keyboard mode: you can now type the number of the named pane to jump to it; or WASD to switch the active pane in that cardinal direction.
Support for open weight models like Qwen, Gemma, Deepseek, GLM, etc. is also very important to me. They work so well. I’m really surprised, here in late 2026, just how capable small models are at local-only development compared to just one year ago. Qwen 3.8 27B, for example, is fantastically good for its size. You can do a lot of good software development with it if you’re a capable hand yourself. Bigger models equal more auto piloting; but that Qwen model? Wow. So local models work great. In fact I think the future is local for a lot of use cases. Intelligence is fast approaching a cost where it will be too cheap to meter. If you remember the personal computer revolution in the 1980s and 1990s, then there are definitely echoes of that here.
If you’ve been holding off on local models then I do recommend you reconsider. Small ones like Qwen 3.8 27B (or its cousin, Flash Next) can run well on a high-end gaming rig or Mac, or with a little investment if you do not have that. If you have a dinky old computer and you’re cash starved, then not all hope is lost. Turn to the potato agronomists on twitter: give twitter’s AI, Grok, what you have and what you can reasonably spend and tell it to track down the cutting edge setup for your rig. This is no lie the fastest, easiest way to catch up to the cutting edge of self-hosted inference today. Five minutes.
Coding harnesses are the IDEs of the future
As I’ve been building DreamCoder, I have come to the belief I’m not just building a coding harness. Coding harnesses are an IDE for the future; it will do more than just display a chat window for coding agent work. DreamCoder does more than that already. It’s going the way of Emacs in that it’ll consume a wide range of adjacent workflows and tools. But I have only just gotten started. I am brimming with ideas I’m building in parallel, but they take time because as I said it’s not about the code; it’s just one small facet of building something that works well. But you know that already: it’s always the last mile.
DreamCoder is the most ambitious, technically complex and advanced software project I have ever built in my life. And that’s just the beginning. I’m not done. I’ve barely started. I will be blogging about this going forward, in addition to my usual Emacs scribblings.
In fact, the thing I’m currently grinding away at is a world-class pentest and cybersecurity suite in DreamCoder. Every single bit of software we have ever written is vulnerable; we have many rough years ahead of us. Just look at the crippling vulnerabilities coming out every day now almost. Even the most security conscious person is going to find themselves on the wrong side for no other reason than we depend on packages that were mature and stable and assumed to be secure. DreamCoder can do its bit to help catch many of most obvious weaknesses, especially as new software is minted every day that also needs thorough testing.
Pentested endpoints and their states
Findings and how exploits were traced
Screenshot of DreamCoder's upcoming, awesome pentesting and cybersecurity suite. It's built for humans. The AI does the work, and you and your team assess its results and impact. The graph overview is AI-generated from its explorations and findings. Do not worry: no human will ever have to suffer the indignity of writing flow charts like that. (If you're interested in/have questions about the pentesting stuff, please e-mail me.)
To round it off, I would like to formally invite you to join me in making DreamCoder better by trying it out. It’s great. It’s not a toy; it’s not a demo; and it’s not a weekend prototype. It’s a frontier coding harness that has most of what you’d expect: MCP, backgroundable sub agents and shell commands, terminal windows, skills, hooks, 99% cache hit, it runs for days, and an interactive UI for all of it. There’s a handy dandy importer for your Pi, OpenCode or Codex configs also to help you get started. A couple of clicks and your model settings are set up in DreamCoder. Ready to go.
Please do e-mail me your thoughts ((rot13 "zvpxrl@znfgrevatrznpf.bet")) on AI, coding harnesses, what you’ve built with it, and what you think more generally about where our world is heading. I’m keen to hear from you.
And if you want to hear more from me on the technical aspects of AI, building coding harnesses, and more, then do sign up for the DreamCoder newsletter below.
Another month, another agent-shell update. If you missed the last post, have a look at the 0.87 update. This time around, the most notable changes are around rendering, performance, and bugfixes, sprinkled with new features here and there.
As usual, this post showcases highlights, but please check out the full list of changes if you're after the nitty-gritty.
What's agent-shell?
agent-shell brings your favorite AI agents to Emacs, keeping you at home: familiar buffers and bindings, no terminal emulation. All powered by ACP, the Agent Client Protocol.
New supported agent
DeepSeek Harness joins the family, bringing the total number of supported agents to 24. Start DeepSeek with M-x agent-shell-deepseek-start-agent, or pick it from M-x agent-shell as usual.
Antigravity moved to agy (action required)
Latest Antigravity ships with ACP out of the box, so agent-shell now runs agy acp rather than a separate binary you had to download and unpack. If you're an Antigravity user, install a recent CLI, make sure agy is on your PATH, and sign in once:
agy acp --login
Blockquotes: rendering + navigation + copy
Blockquotes improved their display, rendering embedded Markdown (#942).
They also joined the TAB navigation party. TAB and S-TAB now visit blockquotes, stopping on their first quoted character.
With point on a blockquote, RET now copies the quote's raw Markdown, without the > markers.
Images in table cells
Images are now rendered as thumbnails within tables. Press RET on an image to open in full view.
Thank you @alberti42 for #938. Tables also realign in the resized window's own buffer now (#934), so splitting a window no longer leaves a table laid out for the window it used to be in.
Links
Hovering a rendered link (or with point on one) now shows its target URL, so you can judge whether it's worth opening.
agent-shell-markdown-open-link-at-point opens the link at point.
agent-shell-markdown-xref-backend plugs into xref-backend-functions, so M-. on a rendered path:line citation visits it. It returns nil anywhere else, web and binary links included, leaving point to the next backend.
Recursive folding
RET toggles the fragment at point, as usual. C-u RET now toggles groups recursively (#924, #945).
Queued -> steered
Queued a prompt, but wanted to steer instead? Pressing M-RET on an empty prompt now offers to steer the last queued prompt into the running turn (#918, #919). While this isn't something I need often, I'm pretty happy with the UX we landed on.
While on the topic of steering, chat mode now handles steered prompt labelling (#930, proposed by @Gleek). If you'd like to render labels differently, agent-shell-chat-label-function now receives the :steered param.
Exposing more options in header
Agents often expose options that never make it to the buffer header. Additional options are now offered via the (+N) menu (#921).
Filtering noisy notices
Agents write all sorts to stderr, and agent-shell surfaces it under "Notices". You can now use agent-shell-notice-filter-function to filter notices (or modify) as preferred (#950 by @astoff). It receives an alist with :text, one stderr line, and returns the text to show or nil to drop it:
A filter that signals or returns a non-string is reported, and the notice shown unfiltered.
Your own system prompt
agent-shell-system-prompt is appended to the agent's default system prompt, sent whenever a session is created, loaded, resumed or forked (acp.el #37 by @systemfreund):
(setopt agent-shell-system-prompt "Keep answers short and respond like a pirate.")
Only agents advertising ACP's systemPrompt capability can take one. Configure a prompt for an agent that can't, and agent-shell says it's ignored rather than dropping it quietly. An agent config's :system-prompt takes precedence.
Secrets resolved at agent start
agent-shell-make-environment-variables now takes a function as a value and calls it when the agent starts, rather than when your config loads (#948 by @nbarrientos). Handy for a password store still locked at init:
A function that errors or returns nil leaves the variable out of the agent's environment and says so in a boxed warning in the shell. Works across all agents.
Shells follow project-switch-project
Starting a shell from C-x p p used to land in the current shell's directory rather than the project you just picked, and offer that directory's sessions to resume. It now starts in the chosen project (#949 by @OSadovy).
Fork and show history
When agent-shell-session-fork-restore-history is non-nil, forked sessions will attempt to restore interaction history as per agent-shell-session-restore-verbosity.
agent-shell-session-fork-restore-history is off by default, so you'll need to enable it with:
Note: You'll need an agent that supports loading a session right after forking it, like claude-agent-acp 0.90.0 or newer.
Faster streaming
Streaming performance received some love. Message chunks are coalesced before rendering (#883 by @moyotar), thought chunks are batched the same way, and restored sessions replay with far less overhead (#897 by @Gleek).
Lots of fixes
As mentioned, the much effort in the release went into fixes and improvements.
Rendering:
Bold renders next to text and punctuation (#925 by @vritser), with CommonMark flanking rules relaxed for CJK (#942).
Numbered headers and bold steps no longer render as list items (#939 by @budu), nor does markup that merely reads like one.
A fenced block's last line is fontified (#916 by @liaowang11), two flush source blocks render as two (#940), and nested ones stay verbatim while streaming.
Headers keep their title when a code fence follows directly (#947).
Text quoted into the prompt keeps its quote face (#952 by @OSadovy).
Copilot multi-hunk diffs render as separate hunks (#931), and Codex streamed output is fenced correctly (#906 by @bartbunting).
Icons scale correctly on HiDPI Linux (#917 by @heraplem).
Unfinished tool calls survive turn end (#941), so a late subagent keeps its title and grouping.
Performance and responsiveness:
Buffers shown in no window measure against a live one (#885 by @bcc32), and measuring glyph height no longer triggers window hooks (#886, also @bcc32).
agent-shell-cwd-function is called once per command (#857, also @bcc32).
Pending Markdown is protected and fontification updates silenced (#915 by @daym).
Chat mode relabels only the last turn while streaming, not the whole buffer (#943, profiled and proposed by @Gleek).
In shell-maker, auto-scroll can be suppressed during bulk updates (#50 by @Gleek), which is what makes the faster replay possible.
Also in shell-maker, the curl --version check that ran on every submission is gone (#32 by @carlosdagos).
In acp.el, agents handle SIGTERM before being killed on shutdown (#35 by @fjolliton).
Elsewhere:
Undo history no longer carries programmatic renders: the compose buffer starts empty (#893 by @liaowang11) and resets after a deferred render (#902 by @bcc32).
A restored session finishes initializing even when rendering errors (#887 by @bcc32).
Flymake context is only used when flymake-mode is on (#892 by @liaowang11), and single-line regions carry one line number (#922 by @martenlienen).
Quoting a region leaves the mark where reading stopped (#896 by @OSadovy).
Minibuffer completion keeps the agent's candidate order (#929 by @Zzull).
Remote URLs are skipped when parsing local links (#926 by @mpmiszczyk), and optional system-sleep functions are declared (#928 by @mboldt).
In shell-maker, non-ASCII prompt history no longer reads back as raw bytes, and entries already corrupted by older versions are decoded on read (#49 by @kazmuroi).
In acp.el, agent stderr reaches error handlers one line at a time rather than in arbitrary pipe chunks (added for notice filtering).
Public functions
A few more additions for package authors building on agent-shell.
Prompt locations
agent-shell-prompt-ranges returns the range of every prompt in the buffer, in buffer order, covering prompts typed at the shell, replayed by a restored session, and steered into a running turn (#882). Each comes back as an alist spanning the comint shell prompt itself (:prompt-start, :prompt-end) and the input typed after it (:input-start, :input-end).
Usage events and ACP _meta
agent-shell-subscribe-to now offers a usage-update event, broadcast when the agent reports context window or cost usage. Events now also carry ACP's _meta, so integrations can read whatever an agent attaches without waiting on agent-shell.
Choosing sessions programmatically
agent-shell-session-strategy now accepts a function. It's called with the resumeable sessions and returns new, latest, prompt, or a (session-id . ID) cons to load a specific one:
If you peeked at the commit logs for the period, you'll see it's been another busy month. Since the last post, 193 commits landed, 32 issues have been closed and 27 pull requests merged. As of this writing, the backlog sits at 6 open issues and 5 open PRs (versus 4 and 6 last time around).
Zooming out a little, here's how the backlog has tracked:
As usual, this chart was generated using the /github-activity skill shared in my emacs-skills repo.
While paying for tokens keeps agents running, sponsoring keeps agent-shell running.
agent-shell is built and maintained by me, an indie dev, while the tools it competes with often have well-funded teams behind them. Funding Emacs-native tools, so we can keep living in our beloved editor, matters now more than ever.
Using agent-shell at work? Ask your employer to sponsor too. Companies can contribute at a scale individuals can't.
Pull requests
Thank you to all contributors for these improvements!
agent-shell
#857: Call agent-shell-cwd-function only once per command (@bcc32)
#873: Add Antigravity default-model-id and default-session-mode-id defcustoms (@tychoish)
#883: Coalesce streamed message chunks before rendering (@moyotar)
#885: Measure a buffer shown in no window against a live window (@bcc32)
#886: Do not trigger window hooks when measuring glyph height (@bcc32)
#887: Finish initializing a restored session even if rendering errors (@bcc32)
#889: Add a separate provider notification handler (@Cy6erBr4in)
#892: Only use flymake error context when flymake-mode is on (@liaowang11)
#893: Start the viewport compose buffer with an empty undo history (@liaowang11)
#894: Render the viewport's held-back markup when a turn ends (@liaowang11)
#896: Leave the mark where reading stopped when quoting a region (@OSadovy)
#897: Reduce overhead when replaying restored sessions (@Gleek)
#902: Reset undo history after a deferred markdown render (@bcc32)
#939: Don't render numbered headers and bold steps as list items (@budu)
#949: Start a new shell in the project chosen with project-switch-project (@OSadovy)
#952: Keep the quote face on text quoted into the prompt (@OSadovy)
acp.el and shell-maker
agent-shell stands on acp.el to speak ACP and shell-maker for its shell foundations, so fixes landing there reach you just the same:
acp.el #34: Allow listing sessions without a working-directory filter (@Gleek)
acp.el #35: Let the agent handle SIGTERM before killing it on shutdown (@fjolliton)
shell-maker #50: Allow suppressing auto-scroll during bulk updates (@Gleek)
Make it sustainable, sponsor agent-shell
As of this writing, we're 89% of the way to the 150 monthly sponsors goal, a tiny closer since the last update. If agent-shell is part of your daily workflow, please consider becoming a monthly sponsor (or ask your employer to).
Not in a position to sponsor? A GitHub star helps with exposure and brings in new users.
Charles Choi has just released another interesting little utility. Although it’s restricted to Safari and the Mac, it’s a nice idea that could probably be ported to other operating systems without difficulty. The idea is to be able to easily move from reading a Web page generated by Techinfo to reading the same information with the Emacs Info reader.
Reading Info pages with Emacs is straightforward and comfortable but the external utilities to read them outside of Emacs are terrible. Therefore, a lot us who started with another editor learned to go to the Web first rather than try to navigate the horrible external reader packages. But, as Choi points out, recent events have shown us that we can’t always count on the Web being there for us.
Choi’s solution to all this is the Counterpart utility that provides a menu in Safari to open the Web page’s content in Emacs. Of course, this only works for Techinfo generated content. Your immediate reaction may be, “Who cares?” but I’ve sometimes wished for something like this so that I could have the content side by side with whatever I was working on in Emacs. That also make’s it easy to copy text out of the Info buffer when you want to add a quote to whatever you’re writing.
A year and a half ago I made a kitchen clock, which has worked well (except that I had to swap out the screen which broke mysteriously).
But yesterday I was having some work done here, so I had to remove one of the wifi access points here, and… the clock stopped working. *gasp* Yes, because I had in my infinite wisdom decided that I would generate the clock face on a different machine, because the clock is a Raspberry Pi Zero 2 W, and I just assumed that it didn’t have enough memory to run Emacs (which I am, being a totally rational person, using to generate the SVG that’s being displayed).
So it’s a Rube Goldberguesque setup of having the image being generated on the main server, and then scp‘d over once a minute, and then being displayed on the console here in the kitchen.
But the wifi outage made me wonder — is it true that the machine doesn’t have enough memory to do it all on device?
So it’s got 416MB of useful memory, and while just running and doing nothing special, it’s using 129MB of that.
What happens if I load an Emacs with all the SVG libraries and stuff and generate the image?
It’s using 186MB — so the Emacs occupies about 50MB max.
*sigh*
It’s so easy to think of Emacs as this “big thing”, but everything has gotten so much bigger around it that it doesn’t matter at all any more.
So now I’ve changed the code to run on-device, so the only thing that goes AWOL if the wifi goes missing is updated temperatures.
Denote is a simple note-taking tool for Emacs. It is based on the idea
that notes should follow a predictable and descriptive file-naming
scheme. The file name must offer a clear indication of what the note is
about, without reference to any other metadata. Denote basically
streamlines the creation of such files while providing facilities to
link between them.
Denote’s file-naming scheme is not limited to “notes”. It can be used
for all types of file, including those that are not editable in Emacs,
such as videos. Naming files in a consistent way makes their
filtering and retrieval considerably easier. Denote provides relevant
facilities to rename files, regardless of file type.
Backronyms: Denote Everything Neatly; Omit The Excesses. Don’t Ever
Note Only The Epiphenomenal.
Below are the release notes
Version 4.3.0 on 2026-11-19
This version introduces quality-of-life improvements as well as a
series of abstractions that empower developers to change how Denote
retrieves its data. Concretely, developers can write an optional cache
or database for Denote.
I am developing denote-data, which is an in-memory cache. Its job is
to make certain operations faster. The package is still in
development, though I hope to have an initial release within the next
weeks: https://github.com/protesilaos/denote-data.
Once denote-data is ready, users will be able to experiment with
another package that will be made public soon. That one will provide a
much-requested feature. But I will write more about it when the time
is right.
AI policy changes
I have added AGENTS.md and CLAUDE.md to denote.git. I copied those
files from the emacs.git repository. They instruct AI agents to not
write patches or comments for the Denote source code. Users can still
use whatever program they want, though they are expected to prepare
their own code or bug reports.
I am doing this because Denote is legally part of Emacs: I have
assigned copyright to the Free Software Foundation. The GNU project as
a whole is waiting for legal advice on how to handle AI-generated
contributions. I agree with the current GNU position and will adapt
accordingly.
In addition to that, I prefer to write even these release notes by
hand even if nobody will read them. They give me an opportunity to
review the entire package. I go through the commit logs and check back
on the diffs. Then I know what is the state of the project and what
may be done next.
Abstractions for a cache or a database
I have introduced several variables and hooks that allow developers to
affect how Denote retrieves its data. Existing users will not notice
any difference. This is relevant for those who plan to write relevant
packages. Users will have to opt in to whatever new functionality.
Info node: Evaluate (info "(denote) Abstractions for a cache or database").
I did this in response to issue 724 by kimsaram32, with participation
from Aaron Jensen, relict007, Samuel W. Flint, mentalisttraceur,
Mirko Hernandez: https://github.com/protesilaos/denote/issues/724.
Disable the “fancy” file prompt
By default, Denote’s file prompt reformats file names. A Denote-style
file name is split into columns so that its components are easier to
read. Users who prefer to see the actual file names can now set the
user option denote-fancy-file-prompt to a nil value.
Note that in addition to this user option advanced users can also
change the relevant completion metadata. Check the variable
denote-file-prompt-extra-metadata and the functions mentioned
therein.
Extra backslashes in query links now result in an error
Denote supports direct links to files as well as “query links”. Those
look like links but actually produce a buffer with files that match
the given query for file contents or file names. Query links are
documented at length in the manual. They are the functional equivalent
of the commands denote-dired (search for file names and put them in
a Dired buffer) and denote-grep (search for file contents and put
them in an Xref buffer).
Queries that have extra backslashes will now report an error. This can
happen when users try their regular expression in something like M-x
re-builder and then bring it into the query link. That is a common
mistake with Emacs regular expressions in general (I do it as well):
in Lisp programs we write double backslashes but in interactive calls
we use single backslashes.
I developed denote-data as part of denote.git because this made it
easier for testing purposes. This helped me write the necessary
abstractions. Now denote-data will become its own package as was
the plan from the beginning.
I made lots of minor refinements that improve the reliability of
relevant functions. I also introduce stylistic changes on occasion
in the interest of ensuring consistency throughout the code base.
This is the kind of boring yet essential work that makes it easier
to maintain the project long-term.
The variable denote-file-prompt-use-files-matching-regexp can be
let bound to affect the FILES-MATCHING-REGEXP value of the
denote-file-prompt. There are many such “use” variables that help
users write simple wrappers around Denote functions. Thanks to
andsy10 for the contribution in pull request 735:
https://github.com/protesilaos/denote/pull/735. The change is
small, meaning that andsy10 does not need to assign copyright to the
Free Software Foundation.
I documented some of the packages that extend Denote. If you are a
package developer, please contact me and I will add your package to
the list—everybody is welcome! To this end, thanks to Matthieu
Muller for writing the section about the denote-paperless package
and Pavlo V. Lysov for writing about the denote-solo package.
Those were done in pull requests 711 and 713, respectively:
Fixed a crash in the denote-file-prompt that could happen with
some unexpected file names. Thanks to Marco Baringer for the
contribution in pull request 708: https://github.com/protesilaos/denote/pull/708.
Fixed an issue with a helper function that could under certain
conditions do the wrong thing for the command
denote-link-dired-marked-notes. Thanks to João Sena for the
contribution. This was done in pull request 730:
https://github.com/protesilaos/denote/pull/730. No copyright
assignment is needed.
The user option denote-org-store-link-to-heading supports a new
local value, as a symbol. It produces links to headings like
[[*Heading text][Heading text]]. Thanks to Michael Korat for the
contribution in pull request 723: https://github.com/protesilaos/denote/pull/723.
No copyright assignment is needed.
Removed obsolete functions from the manual. Thanks to kimsaram32 for
the contribution in pull request 728: https://github.com/protesilaos/denote/pull/728.
No copyright assignment is needed.
The denote-date-prompt supports Unix timestamps. Thanks to Jeff
Valk for the original contribution in pull request 722:
https://github.com/protesilaos/denote/pull/722. No copyright
assignment is needed. Also thanks to Jean-Philippe Gagné Guay for
making a follow-up tweak to how this is handled internally. This was
done in pull request 726: https://github.com/protesilaos/denote/pull/722.
Jean-Philippe is a long-term contributor who has assigned copyright
to the Free Software Foundation.
The already comprehensive manual includes more useful information.
For example, on how to handle files with accented characters in
their title. To this end, we now have the function
denote-slug-remove-accents. This is based on the code originally
written by Jean-Philippe Gagné Guay in issue 603:
https://github.com/protesilaos/denote/issues/603#issuecomment-2869702877.
I made stylistic changes to it to make it fit with the rest of
the code. I added it in response to issues 603 and 718:
As convenient as accessing online services can be, any disruption in availability without a fallback is painful. Given events of late, many are learning the hard way what it’s like to live without that fallback.
GNU Emacs has long supported reading documentation via the Info reader package. Info reader is a “local first” system, where all documentation is stored locally. The source format of the documentation is Texinfo which is exported to different formats, among them Info (used by the Emacs Info reader), HTML, and PDF.
Texinfo exported HTML is typically hosted on a website (usually GNU Project), with each Info node mapped to a URL path and indexed by most major search engine services.
Discovery of information in Texinfo documentation is frequently done via web search. If the user desires to view that Texinfo web page in the Emacs Info reader, that has to be done manually by corresponding the web page to its Info node.
Counterpart is a new utility to automate opening the Info node counterpart of a Texinfo exported web page in Emacs. This utility is designed for Emacs users on macOS who also use the Safari web browser. It requires the installation of a macOS Shortcut which is run from the main menu bar. More detail on using it can be found in the Counterpart User Guide.
Once a desired Info node is opened in Emacs, you can then bookmark it for later access, no internet connection required.
The ef-themes are a collection of light and dark themes for GNU
Emacs that provide colourful (“pretty”) yet legible options for users
who want something with a bit more flair than my modus-themes or my
minimalist doric-themes.
The two themes add to an already comprehensive collection that covers
a broad spectrum of styles. All themes are consistent with the spirit
of avoiding exaggerations while remaining legible.
Note that since version 2.0.0, the ef-themes are built on top of
my modus-themes. They benefit from all the changes I make there.
Most of you know that I think very highly of Álvaro Ramírez. That’s mainly because I’m a huge fan of Journelly, which I use many times a day as my memo book. It has many other uses so take a look at the link if you’re interested in a note taking/journaling/private tweet/memo book application. I can’t recommend it enough.
Ramírez has, of course, done many other things, many or perhaps most, in the Emacs sphere. See his site for details. In a recent post he writes about making contributions to Emacs and getting them merged. Those of you who have been down that road know that it’s hard to get started. You have to navigate the GNU copyright assignment process, which seems needlessly baroque until you remember that all this is being run by volunteers.
You can follow the link to find out what his contributions are. They are all live in Emacs 31 so if you are up to date they are available to you now. The main takeaway for me was the satisfaction that Ramírez got from making those contributions. None of them were huge changes and merely scratched an itch that Ramírez had. If you have a small itch that you’ve scratched, you should consider sharing it with the community. You too can become part of Emacs’ long and influential history just as Hari Seldon’s successors in the Second Foundation contributed their own additions to Seldon’s Psychohistory.
[ The stream will be recorded. You can watch it later. ]
Today I will implement some new features for my Emacs configuration. I
will include the final code on my website, as an update to this publication.
As usual, I will keep the chat open and shall answer all questions.
UPDATE 2026-11-17 18:52 +0200: Pasting the code.
UPDATE 2026-11-17 19:24 +0200: I forgot the prot-text part.
UPDATE 2026-11-20 11:04 +0200: I decided to remove the rgrep
call because I never liked its behaviour.
The code I wrote during the livestream
Custom Org link types
;;;; Custom link types(defcustomprot-org-grep-directoryorg-directory"Directory where prot-grep links search in with `rgrep'.":type'directory)(defunprot-org-grep-follow(query&rest_)"Use QUERY to `rgrep' the `prot-org-grep-directory'."(let*((current-file(file-name-nondirectorybuffer-file-name))(grep-find-ignored-files(append(listcurrent-file)grep-find-ignored-files))(heading(format"\\*+[\s\t]+\\<%s\\>"query)))(compilation-start(concat"find "prot-org-grep-directory" -path "(shell-quote-argument"*/.git")" -prune "" -o -type f "" -iname \"*.org\""" -exec grep -inHER --color=auto "(shell-quote-argumentheading)" "(shell-quote-argument"{}")" "(shell-quote-argument"+"))'grep-mode(lambda(_mode)(format"*prot-dired-grep-marked for `%s'*"query))t)))(defvarprot-org-grep-complete-historynil"Minibuffer history for `prot-org-grep-complete'.")(defunprot-org-grep-complete(&rest_)"Complete prot-grep link types using `prot-org-grep-complete-history'."(let*((default(carprot-org-grep-complete-history))(input(completing-read(format-prompt"Text to search in `prot-org-grep-directory'"default)prot-org-grep-complete-historynilnilnil'prot-org-grep-complete-historydefault)))(format"prot-grep:%s"input)))(defunprot-org-grep-export(query&rest_)"Export prot-grep link types."(format"[ Prot Grep for: %s ]"(orquery"")))(deffaceprot-org-grep-link'((t:inheritsuccess:underlinet))"Face for prot-grep link type links.")(org-link-set-parameters"prot-grep":follow#'prot-org-grep-follow:complete#'prot-org-grep-complete:export#'prot-org-grep-export:face'prot-org-grep-link);;;###autoload(defunprot-org-insert-grep-link(query)"Insert prot-grep link for QUERY.
When called interactively, prompt for QUERY. Else QUERY is a string."(interactive(list(prot-org-grep-complete)))(when(or(nullquery)(string-blank-pquery))(error"The QUERY cannot be nil or an empty string"))(insert(format"[[%s]]"query)));; TODO 2026-11-17: I want to add an "until" logic.(defvarprot-org-meetings-link-regexp"\\`\\([A-Za-z]+\\) since \\([0-9]\\{,4\\}-[0-9]\\{,2\\}-[0-9]\\{,2\\}\\)""Regular expression for the contents of prot-meetings links.")(defunprot-org-meetings-sort(entries)"Sort the ENTRIES from oldest to newest.
ENTRIES is a list of plists of the following form:
(list
:heading HEADING
:text TEXT
:time HEADING-TIME-OBJECT)"(sortentries(lambda(entry1entry2)(<(plist-getentry1:time)(plist-getentry2:time)))))(defunprot-org-meetings-display-buffer(entriestitle)"Display ENTRIES of `prot-org-meetings-follow'.
ENTRIES is a list of plists of the following form:
(list
:heading HEADING
:text TEXT
:time HEADING-TIME-OBJECT)
Sort ENTRIES with `prot-org-meetings-sort'."(let((buffer(get-buffer-create"*prot-org-meetings*")))(with-current-bufferbuffer(save-excursion(erase-buffer)(unless(eqmajor-mode'org-mode)(org-mode))(insert(format"#+title: %s"title))(insert"\n\n")(setqentries(prot-org-meetings-sortentries))(dolist(entryentries)(insert(format"* %s\n%s"(plist-getentry:heading)(plist-getentry:text)))(insert"\n\n"))))(display-bufferbuffer)))(defcustomprot-org-meetings-fileorg-default-notes-file"The path to the file where prot-meetings links search in.":type'file)(defunprot-org-meetings-follow(query&rest_)"Find headings with meetings that match QUERY.
QUERY matches `prot-org-meetings-link-regexp'."(if(string-matchprot-org-meetings-link-regexpquery);; TODO 2026-11-17: I want an "until" logic which will also go;; into the `prot-org-meetings-link-regexp'.(let*((name(match-string1query))(since(match-string2query))(since-timestamp(format"[%s]"since))(since-time-object(prot-org--timestamp-to-timesince-timestamp))(title(format"Meetings with %s"query))(entriesnil))(with-temp-buffer(unless(file-exists-pprot-org-meetings-file)(error"The file `%s' does not exist"prot-org-meetings-file))(insert-file-contentsprot-org-meetings-file)(org-mode);; TODO 2026-11-17: I want to match only DONE headings.;; TODO 2026-11-17: I want to get the CLOSED timestamp as well.(org-map-entries(lambda()(when-let*((heading(org-get-heading:no-tags:no-todo:no-priority:no-comment))(_(string-match-pnameheading))(heading-timestamp(or(org-entry-getnil"DEADLINE")(org-entry-getnil"SCHEDULED")))(heading-time-object(prot-org--timestamp-to-timeheading-timestamp))(_(>=heading-time-objectsince-time-object))(text(org-get-entry))(entry(list:headingheading:texttext:timeheading-time-object)))(pushentryentries))))(ifentries(prot-org-meetings-display-bufferentriestitle)(user-error"There are no matching entries"))))(error"The query `%s' does not match `prot-org-meetings-link-regexp'"query)))(deffaceprot-org-meetings-link'((t:inheritwarning:underlinet))"Face for prot-meetings link type links.");; TODO 2026-11-17: I want to implement a `:complete' and an `:export' parameter.(org-link-set-parameters"prot-meetings":follow#'prot-org-meetings-follow:face'prot-org-meetings-link)(defvarprot-org-meetings-person-prompt-historynil"Minibuffer history for `prot-org-meetings-person-prompt'.")(defunprot-org-meetings-person-prompt()"Prompt for a person for prot-meetings link type."(let((default(carprot-org-meetings-person-prompt-history)))(completing-read(format-prompt"Meetings with PERSON"default)prot-org-meetings-person-prompt-historynilnilnil'prot-org-meetings-person-prompt-historydefault)));;;###autoload(defunprot-org-meetings-insert(persondate)"Insert prot-meetings link for PERSON since DATE."(interactive(list(prot-org-meetings-person-prompt)(org-read-date)))(when(or(nullperson)(string-blank-pperson))(error"The PERSON cannot be nil or an empty string"))(when(or(nulldate)(string-blank-pdate))(error"The DATE cannot be nil or an empty string"))(insert(format"[[prot-meetings:%s since %s]]"persondate)))
Indent text-mode region
(defunprot-text-insert-prefix(prefixstring)"Prepend PREFIX to every line of STRING."(with-temp-buffer(insertstring)(goto-char(point-min))(insertprefix)(while(and(forward-line1)(not(eobp)))(goto-char(line-beginning-position))(insertprefix))(buffer-string)))(defmacroprot-text-define-prefix-command(scopeprefix)"Define command with SCOPE to insert PREFIX to string.
SCOPE is a string that describes what the command will do. PREFIX is
the prefix as a string.
The command will target the text between `region-beginning' and
`region-end'. It will produce and error if the region is not active."`(defun,(intern(format"prot-text-prefix-%s"scope))(beginningend),(format"Add prefix `%s' to text between BEGINNING and END positions.
Report an error if the region is not active."prefix)(interactive(if(use-region-p)(list(region-beginning)(region-end))(error"The region is not active")))(when(=beginningend)(error"The BEGINNING and END cannot be equal"))(let*((text(buffer-substringbeginningend))(replacement(prot-text-insert-prefix,prefixtext)))(replace-region-contentsbeginningendreplacement))));;;###autoload (autoload 'prot-text-prefix-blockquote "prot-text" nil t);;;###autoload (autoload 'prot-text-prefix-indent "prot-text" nil t)(prot-text-define-prefix-commandblockquote"> ")(prot-text-define-prefix-commandindent" ")(defvar-keymapprot-text-prefix-leader-map:doc"Commands to insert prefix to the active region text.":prefix'prot-text-prefix-leader"b"#'prot-text-prefix-blockquote"i"#'prot-text-prefix-indent)
Emacs configuration
My personal Emacs configuration. It is comprehensive, both in terms of
the [custom] code it contains as well as the documentation on what each
piece of functionality does.
Backronym: Do Observe, Transpose, Examine, or Mirror All
Configurations, Stranger (dotemacs); Dotfiles Operate Transparently
For the Included Linux and Emacs Setups (dotfiles).
Last year I improved my code for copying the current location to the kill ring. Recently it occurred to me that this was not the last word. In fact, I’m pretty surprised I didn’t think of it earlier – it’s sort of obvious in hindsight. The idea is that it should copy the range of lines when the region is active.
As most of you know, I’m one of those people striving to move as much as possible into Emacs. I’ve mostly succeeded in that except for the usual sticking point: the browser. No modern browser will run in Emacs and I’m not sure that we’d want one to. Still, it would be nice to be able to do all or most of our browsing tasks from with Emacs.
There is, of course, EWW. It does a pretty good job of displaying text and images but has no JavaScript support. Some of us consider that a feature. It turns out that most of what JavaScript does isn’t really necessary and merely gets in the way.
Joshua Blais has taken using EWW a step further and made EWW his default browswer. That means that whenever he clicks on a URL and certain other links, the link is opened in EWW or—for special links—in another application that runs in Emacs. The point is, all browser activity starts in Emacs, usually in EWW.
Of course, Emacs can’t handle every browsing task so Blais uses the & key in EWW to escape to a “normal” browser. Blais says that EWW suffices for 85–90 percent of his use cases. He has some functions to kick off Emacs apps for MP4, PDF, and other specialized links. Everything else goes to EWW. He’s added a couple of custom bindings for EWW functions he uses a lot but it’s mostly a normal EWW instance.
Blais’ experiment shows that it is possible to almost browse from within Emacs. Sites that rely on JavaScript in an essential way are not going to work of course, and there are still a lot sites that insist on JavaScript so they can enforce the delivery of ads or implement a pay wall. Blais’ method gives us a chance to consider if those sites are worth viewing.
This is the first of a few articles about the AI system I use for teaching maths. Basically, ten months ago I decided to buy an AI subscription to learn more about the technology, and today I run a small fleet of machines and agents that draft my lessons, check my exams, index my syllabus, and argue with me about design at midnight. This first article is about the recent years before any of that, because it turns out to be the part that made everything else possible.
Part 2
was about models and harnesses. But a model in a harness is still just a clever voice. What turned the setup into a system was the organs: the memory, the senses, and the reflexes bolted on around it. This is the final part, and it starts with a full circle.
The knowledge base that was already ten years old
People ask how I got my teaching knowledge into the AI. The answer is anticlimactic: I didn’t. I had spent a decade writing it in plain text — Org-mode notes, syllabus annotations, lesson reflections, the whole zettelkasten from Part 0
.
Over at the Emacs subreddit, Sahkopi4 recounts his journey from Vim to Emacs. Actually, his journey was from Nano to Emacs by way of Vim. When he first started using Linux, Nano was the default editor and he began with that. Eventually he wanted more power and because Vim seemed more popular in the forums he inhabited, he learned Vim. He really like it and the power that it brought him was an eyeopener.
He experimented with other Vim-like implementations but they didn’t work for him so he stuck with Vim. Eventually he tried Emacs and almost immediately became a convert. Like me, he jumped right in and didn’t try to use Evil or some other Vim emulation. Like many of us, he loved the experience and now wants to do as much as he can in Emacs.
As always, a lot of the action is in the comments. Many said that immigrants from Vim should use Evil because it gives you the best of both worlds: the modal, composable editing commands of Vim and the power and flexibility of Emacs. Others said that Evil induces a sort of cognitive dissonance where neither system is fully in control.
There is, of course, the occasional post proclaiming loudly that Emacs is no good because it uses Lisp with all those parentheses. The ankle biting aside, the comments offer an intelligent and useful commentary on Sahkopi4’s journey.
For me, landing changes in Emacs upstream always felt somewhat out of reach, so I kinda postponed it for a long while. Perhaps the biggest hurdle was getting over the process to assign copyright to the Free Software Foundation, which does feel a bit archaic (download, sign, and return a PDF) and slow (mostly waiting for an email response), though hey, I have nothing but sympathy. Open source is unsustainably tricky. As consumers, we often like free as in freedom and free as in beer, but neither pay the bills. We hope some company steps in to fund these projects, but that rarely happens. As a result, most open source projects are starved (even popular ones), run by volunteers working for free.
All that is to say, if the upstream Emacs contribution/onboarding process seems less than ideal, cut it some slack. The project as a whole primarily runs on the blood, sweat, and tears of unpaid contributors. If you can, fund the maintainers you rely on (or better yet, get your employer to do so).
If you've been thinking of contributing to Emacs upstream, don't procrastinate like me and just give it a try. Compared to the typical GitHub pull-request process, your first Emacs contribution may feel a little daunting and dated, but there's a lovely fuzzy light at the end of the tunnel. You see, Emacs has been around for 50 years. Very few software projects get to live this long. Landing contributions on a project with such a rich history is a real treat!
But I digress… Let's get moving. Once I got over procrastinating, I finally got a handful of small contributions landed on the master branch. Thank you, Eli Zaretskii, Stefan Kangas, and Gerd Möllmann, for your help. From then on, I eagerly waited for them to formally make it to a stable release.
With that in mind, I tweaked dired-hide-details-mode by adding the dired-hide-details-hide-absolute-location user option, which hides the directory's absolute path, typically displayed at the top of Dired buffers (bug#72272, commit).
At some point, I ran into a snag trying to run macosrec from my beloved eshell. The process just crashed with a cryptic abort trap: 6, so the issue wasn't super obvious. It turned out the utility required granting an OS permission that can only be requested by the host app (Emacs) if it includes the relevant description in its Info.plist file.
As of version 31, Emacs includes NSSpeechRecognitionUsageDescription in its Info.plist (bug#72827, commit).
Send to… (aka macOS sharing)
context-menu-mode now includes a "Send to…" item, enabling sending the current file(s) or region text to external apps or services. You can also invoke M-x send-to directly. On macOS, it's powered by the native sharing picker (I use it frequently to AirDrop things to my iPhone). Elsewhere, it falls back to shell-command-do-open (bug#76120, commit, follow-up fix). These two implementations plug into new generic plumbing (send-to-handlers), so you could, for instance, add a handler sharing via Android's native share sheet (android-browse-url can do the heavy lifting) or KDE Connect on Linux (kdeconnect-cli --share).
Emacs 30 lost macOS dictation when migrating to NSTextInputClient. Implementing selectedRange in nsterm.m brought it back (bug#79070, commit). With LLMs/agents being a thing these days, dictating into your Emacs buffer may be just the thing to complement your AI workflow.
Are you getting value from any of my upstreamed changes or my Emacs packages? Please consider sponsoring to keep the work going. While my patches may seem relatively straightforward, some took quite a bit of effort to land upstream.
My Emacs work not your cup of tea? No worries. As mentioned earlier, sponsor the maintainers you rely on instead.
Back in April I wrote about a month of Elisp and finished by mentioning that, having experienced neocaml (a modern Emacs mode for OCaml), I'd started writing a tree-sitter powered Emacs package for Haskell. That package is curry-mode, and I'm releasing version 0.1.0.
curry-mode is a major mode for Haskell built on Emacs's built-in tree-sitter support. It provides font-locking (Emacs-speak for syntax highlighting), indentation, navigation, imenu (the buffer index you navigate with), a REPL (read-eval-print loop) using GHCi, the interactive environment of the Glasgow Haskell Compiler (GHC), and Cabal integration, and hands everything semantic (completion, go-to-definition, types on hover, code actions) to the Haskell Language Server (HLS) via Eglot, the client for the Language Server Protocol (LSP) built into Emacs.
Why another Haskell mode?
I started out using Emacs at University on SunOS SPARC machines. At the time I learnt both of the viable editors, vi and Emacs, but leant towards Emacs because of how far you could customise it. Over the years I've mostly used other people's packages and configuration, with detours into IDEs when Java or Scala demanded it. I'd never built a large mode from scratch, and the best way I know to learn something is by doing it.
There is already an official haskell-mode with many users and many features, so why build a new one? haskell-mode has grown complex over the years, bundling everything from indentation to a REPL to HLS interaction in one monolith. It has to, since it predates both tree-sitter in Emacs and language servers. With tree-sitter built into Emacs 29+ and HLS providing the semantic features over LSP, a modern Haskell mode can be dramatically simpler.
I'm not the first person to think this. haskell-mode issue #1804 collects the attempts at a tree-sitter powered major mode for Haskell, including two separate haskell-ts-mode packages. There is erikbackman/haskell-ts-mode, which is now archived, and pranshu/haskell-ts-mode. Neither attempt became popular enough to sustain the effort, and I thought I could do a better job by following the architecture of bbatsov's neocaml.
That architecture is a mode built in layers. At the bottom, curry-mode provides the syntax layer with highlighting, indentation, navigation and imenu, all from the tree-sitter AST, and works with nothing else installed. On top of that, HLS via Eglot adds the semantic layer with completion, types, diagnostics, code actions and formatting. All the good things you expect from an LSP.
Each layer should be useful on its own and each one above improves on, or replaces, what the layer below provides. You shouldn't need a running language server before Emacs can indent your code. If things go well, perhaps some of this can be folded back into haskell-mode once it no longer needs to support Emacs versions before 29.
What's in a name
Naming is hard, and realistically this mode should be haskell-ts-mode the third, but that is a really terrible choice. Instead I named it after Haskell Curry, after whom both the language and the concept of currying are named. A delightfully intertwined name, I think.
Standing on neocaml's shoulders
I closely modelled curry-mode on neocaml (and its sibling fsharp-ts-mode), so the packages share plenty of structural and stylistic similarities. Perhaps that's not surprising, since both are statically typed languages with an ML heritage. Borrowing his good ideas let me quickly tick off the basics, like a base mode with language-specific derived modes, the REPL integration pattern, and the build tool interaction pattern. Even imenu, code folding and navigation from tree-sitter started as fairly direct translations of the neocaml code. Hopefully bbatsov is fine with that.
bbatsov has also written up Building Emacs major modes with tree-sitter: lessons learned, which covers many of the same lessons I learnt the hard way. If you're thinking of writing a tree-sitter mode, read that first. If only I'd checked his blog sooner it would have saved me some time.
So let's skip the similarities and talk about what's different about Haskell.
What you get
The 0.1.0 release covers the most common things you'd need in day to day Haskell work:
Font-locking with 4 levels of detail for .hs, .hsc and .hs-boot files.
Indentation from tree-sitter rules, with region shifting (C-c > / C-c <) and the indentation offset guessed from the existing code.
Navigation by definition (C-M-a / C-M-e), by expression (C-M-f / C-M-b), by top-level declaration (M-a / M-e on Emacs 30+), and a jump to the import block and back (M-g i).
Imenu grouped into functions, types, classes, instances and imports.
A GHCi REPL (curry-repl) with tree-sitter highlighting of what you type, and commands to send definitions, regions or the whole buffer, reload, and ask for :type and :info at point.
Cabal integration with curry-cabal-mode for .cabal files, formatting with the cabal-fmt or cabal-gild formatters, and commands to run cabal build, test, run, repl and haddock (Haskell's documentation generator) from any Haskell buffer.
GHC errors in M-x compile output, so M-g n / M-g p jump to the source location.
Eglot registration for haskell-language-server.
Debugging with dape, an Emacs debugger client, and Well-Typed's haskell-debugger (experimental, needs GHC 9.14+).
curry-mode doesn't provide completion, type lookup, Hoogle search (the Haskell API search engine), documentation browsing or code actions. HLS does those better than any Elisp I could write.
How much simpler?
I was curious whether "dramatically simpler" was true, so I counted lines. curry-mode is about 2,100 lines of Elisp against just over 20,000 for haskell-mode, roughly 10 times smaller. That number is a bit misleading, since haskell-mode includes plenty that curry-mode hands to HLS. Comparing the features both modes actually implement is a fairer comparison:
Concern
haskell-mode
curry-mode
Ratio
Font-locking
1,219
122
~10x
Indentation
2,870
190
~15x
REPL
2,019
357
~6x
Cabal
1,228
611
~2x
Mode, navigation, imenu
1,874
837
~2x
Tree-sitter shows up clearly in the first two rows. haskell-mode includes a hand-written lexer (haskell-lexeme.el) that copes with the layout rule, string gaps, character literals and pragmas, and adds font-lock keywords on top of it. curry-mode asks the tree-sitter syntax tree instead, and around 120 lines of treesit-font-lock-rules cover all four levels. For indentation, haskell-mode ships two indenters (haskell-indent and haskell-indentation), because Haskell layout is hard enough that neither one alone was enough. curry-mode has about 190 lines of treesit-simple-indent-rules. Again there is a gap in functionality in the indentation but really I think most developers would be better served by an external tool.
The REPL and Cabal savings come from leaning on what Emacs already provides (comint, compile) and on external tools like cabal-fmt, rather than from tree-sitter.
Working with tree-sitter
Most of the size difference comes from tree-sitter. Once you have a syntax tree, font-locking is a set of queries (patterns matched against nodes in the tree) rather than a pile of regular expressions, and the same tree gives you navigation, imenu, folding and Combobulate support with little extra code. Combobulate is a package for structured navigation and editing that works across any language with a tree-sitter grammar. It also makes new features easier to add. Want to find all the tests in a file using the Tasty test framework? That's a query over the tree, not a parser you write yourself.
The Haskell grammar story is a little fragmented, though. The official tree-sitter/tree-sitter-haskell is missing many bug fixes and newer GHC features. tek/tree-sitter-haskell applies most of those fixes and is active, but doesn't commit the generated C parser that Emacs needs to build the grammar. So curry-mode uses my fork of tek's, which adds the generated parser files, and installs it for you. I chose tek's grammar because it has the best language coverage, but I'd love for the fork to become unnecessary.
That leads to my bigger point, which is that a tree-sitter grammar is no longer optional for a language. GitHub code navigation, Emacs, Neovim, Helix, Zed and plenty of other tools are built on tree-sitter, so a good grammar matters as much as a good standard library or build tool. Ideally the grammar would track each GHC release, or even be mechanically derived from GHC's own parser. GHC Haskell keeps growing new syntax, and keeping editors working across versions raises the same problems that Trees that Grow, the extensible AST design used inside GHC, tackles for the compiler.
I hit a few rough edges along the way. Tree-sitter ABI (application binary interface) versions are confusing. Emacs often supports ABI 14 as the lowest version, but you can build grammars with ABI 15, and since ABI 15 isn't backwards compatible with 14, loading the wrong one will SEGV your Emacs. curry-mode now checks the version of libtree-sitter (the tree-sitter C library Emacs is linked against) and gives a clear error instead. Grammar releases also tend to follow the tree-sitter tooling version rather than semver, so a minor version bump can bring major headaches. Finally, with tree-sitter the AST is your API, and an AST is never going to be particularly stable, so curry-mode warns you when the installed grammar is older than the one it expects.
Indentation
Haskell is whitespace sensitive, which makes indentation the hardest part of any Haskell mode. Unlike most languages, there is often more than one valid indentation for a line, and they mean different things. The first rule for curry-mode is to do no harm, so indenting a line should never break a program that was already correct. Beyond that, the tree-sitter rules aim to cover the common layouts like do, where, let, case, guards, records and the rest of the everyday code I write. Where the rules get it wrong there is an escape hatch. curry-cycle-indent switches to indent-relative, which lines up with the previous line, and region shifting moves a block by one level.
Some cases are still hard (NondecreasingIndentation, CPP blocks, and edits that change the parse tree as you type), and the roadmap lists them as known issues. Getting a whole file into the right shape is a job for a formatter like ormolu or fourmolu, which you can already run through HLS with eglot-format-buffer. This is another place where curry-mode provides a usable base and leaves the heavy lifting to the tool that's best at it.
Trying it out
curry-mode needs Emacs 29.1 or newer, built against libtree-sitter 0.25 or newer. On Emacs 30 you can install it from GitHub with use-package:
On Emacs 29, use M-x package-vc-install RET https://github.com/tmcgilchrist/curry-mode.
The Haskell tree-sitter grammar is installed automatically the first time you open a Haskell file, or you can run M-x curry-install-grammars yourself. For the semantic features, install HLS (for example with ghcup install hls) and run M-x eglot in a Haskell buffer.
The README has the details on key bindings, font-lock levels and configuration options.
What's next?
How mature is curry-mode? It covers what I need for my Haskell work, and I've been using it daily. The grammar could use polish to keep up with the ever-growing syntax of GHC Haskell, the font-locking needs tuning to look just right, and I'm sure there are corners of Haskell I haven't touched. The roadmap collects ideas for where it could go next, from formatter integration to running the right test from point. I also want to build out the higher layers. I have a branch adding Combobulate support for Haskell (PR #12), which adds structured editing on top of the same syntax tree, and debugging with dape needs more use before it moves past experimental.
Most of the hacking for this release is done, and I'm going to spend time on other projects for a while. Perhaps people will find curry-mode useful and borrow the code for haskell-mode, or enough people will use it that it lives on as a modern Haskell mode for Emacs. Please try it out and report issues for anything that breaks.
Contributions, bug reports, suggestions and feedback are most welcome. Remember, Emacs can be whatever you make of it.
Charles Choi has a nice hint for those of you who travel and phone home with Emacs. Here’s the situation: you are travelling and log into your home server with SSH and emacsclient. It’s wonderful. Just like being at home except the date/time stamp is wrong. The time and date are whatever your home server thinks they are but you want them to be local time.
The answer is simple. You simply need to change the TZ (timezone) environment variable to reflect your current location. For example, if you’ve travelled to New York (in the US) you would set TZ to “America/New_York”. Emacs, of course, provides a command to do this: (setenv "TZ" "America/New_York").
The zone codes can be a bit opaque so Choi has added a command to the latest Casual suite to set the TZ variable complete with completion. Take a look at his post if you’re interested.
Please note that planet.emacslife.com aggregates blogs, and blog authors might mention or link to nonfree things. To add a feed to this page, please e-mail the RSS or ATOM feed URL to sacha@sachachua.com . Thank you!