Sacha: Sacha: Fantastic, this is great, I finally get to talk to you. I
Sacha: appreciate that you blogged so quickly about some of the
Sacha: things that I mentioned, and we can certainly dive right
Sacha: into that, or you have a lot more experience with how these
Sacha: conversations go, so I can let you take the lead.
Prot: Prot: Since you put in the effort to write, we already have a
Prot: very good structure. The idea is, let's have your screen, so
Prot: you can share your screen with Jitsi.
Sacha: Yeah. I will share my screen.
Prot: And we can go right into it. Let's see.
Sacha: yeah oh you know if if at some point I should be really like
Prot: So if you hover over...
Prot: Okay, yeah, you have it.
Sacha: fancy... Future session, we should get crdt working because that's fun.
Prot: Ah, yes. Oh, that would be nice. Yes.
Sacha: Yeah, that would be nice. All right.
Sacha: So I've been making good progress in splitting up my config into
Sacha: multiple modules. I just have to iron out a couple of things
Sacha: like do I actually have to load the autoloads from the user
Sacha: list directory or does it automatically take care of that?
Sacha: Because sometimes it doesn't seem like it's doing the
Sacha: thing. Anyway. It's making good progress. And in fact, I
Sacha: came across something that I'm not sure you know about yet,
Sacha: or maybe you know about it and you decided not to do it. I found
Sacha: out that, so, okay, so here's the context. You know, when you
Sacha: do your literate config, you have your modules and they're
Sacha: actually just one big file, like one big source block with a
Sacha: commentary and everything in it. Yeah, yeah. So I found out
Sacha: that you can use a hook if you want to, to add stuff to the
Sacha: tangled files afterwards. So the way I set it up with my
Sacha: config is I still want all the different functions
Sacha: scattered all over the place because I'm not yet as
Sacha: organized as you in terms of the modules. So the
Sacha: org-babel-post-tangle-hook here, post. Yeah, yeah, yeah, post
Prot: So what did you do with that? Let's see.
Sacha: and boilerplate... has that boilerplate here we go so what
Sacha: it's what this does is when it tangles it it then goes back
Sacha: into the file and it inserts all that extra text and the
Sacha: footer into the tangled files so I still have my links to
Prot: Nice.
Sacha: the different source files where it comes from. So this is
Sacha: the section where it comes from but I also have all the extra
Sacha: lovely commentary and stuff so I'm like... Yeah,
Prot: Ah, that's smart. That's good. That's good. Yes.
Sacha: that way, you don't have to keep repeating things. Although I
Sacha: guess if you really wanted to repeat things you could you
Sacha: could theoretically have the license just as a no web
Sacha: reference and then have it go in there automatically.
Sacha: anyway so I thought that was really cool so I'm making
Sacha: progress on the things that I had mentioned in the in the blog
Sacha: post about organizing my config into multiple modules
Sacha: and other yeah Let me see. I can look at the sacha.el here and I
Prot: And how far are you in that project? How far are you?
Sacha: can do an occur on the files that have the lines that have the
Sacha: defun. I only have 482 defuns to get rid of. This is
Sacha: already a lot less than what I started with because like you,
Sacha: I have a very large... Almost 40,000 lines in this sacha.org.
Prot: Yeah, yeah, that's massive. Yeah.
Sacha: It's fun and it's interesting. It is a little reassuring to
Sacha: know that people still rely on your published modules
Sacha: instead of actually, like, do people take your config? I
Sacha: know you've got stuff in the config that makes it possible
Sacha: for people to just load it and add their customizations on
Sacha: top, but do you hear from a lot of people who do that?
Prot: From a few of them, yes. And this is why I actually created
Prot: those customizations. But I must say, I have been trying to
Sacha: Yeah, yeah.
Prot: make it more difficult for them. So I used to have a use
Prot: package, but now I disabled it on purpose and I have my own
Prot: macros, so that somebody doesn't just copy-paste. And I
Prot: don't do this to be mean, but I do it because this way somebody
Prot: will have to think about, like, okay, what is this?
Prot: What am I doing here?
Sacha: yeah I figure making making them still do that okay what am I
Sacha: doing here while still being able to automatically load all
Sacha: the function definitions will probably get them over that
Sacha: you know like make it a little bit easier for them so at least
Sacha: that way like right now it is difficult to copy things from my
Sacha: config like like you're so like okay maybe this is a feature
Sacha: but you know, maybe changing it will be nice.
Sacha: The other big thing that I need to do with my config is
Sacha: I'm thinking about shifting everything to the sacha- namespace
Sacha: instead of the my- namespace, which is going to be a lot of
Sacha: renaming, which is actually, it was actually the question
Sacha: that I had about renaming things, not necessarily coming up
Sacha: with clever names that have good acronyms like you do. And I
Sacha: love that the humor that you have in there, but like, like
Sacha: just mechanically, are we talking wgrep is like, is there a
Sacha: more modern, emacs 31 way to rename things? Am I just using
Sacha: erefactor or like replace-regexp? What do you do when you need
Sacha: to rename a symbol in possibly multiple files?
Prot: If it's in multiple files, I do the grep approach. So it's not
Prot: that sophisticated, but it works. Because the thing
Prot: with the multiple files is, and it goes also to what you were
Prot: telling me in that article, is first you organize, and then
Prot: you refactor. It's that idea. The multiple files will not
Prot: have a lot of extraneous information. You will not be
Prot: matching, at least in theory, you will not be matching too
Prot: many false positives.
Sacha: Yeah, and if you're doing a single file,
Prot: So you won't have to sort it.
Sacha: what do you like to do?
Prot: I have a package called substitute.
Prot: One of the ways I do it is just
Prot: substitute the symbol at point. But of course, this is just a
Prot: minor convenience. You can do that with a query-replace.
Prot: I'm not saying that you really need the package. But the idea is
Prot: that you do it and you know that it works. Like, for me...
Prot: I know that it works in the file.
Prot: So for me, that's very reliable.
Prot: But the other thing I should mention is
Prot: keyboard macros from dired combined with substitute.
Prot: So you start from a dired buffer, and you go file by file.
Prot: That's the general idea. And in each file, you will perform,
Prot: for example, a search to the symbol. Once you are on the symbol,
Prot: you do the substitute-replace command, and then you move to
Prot: the next file. So that is the workflow. And I do that a lot, for
Prot: example, with my themes, because they have a lot of
Prot: repetitive code, like each theme.
Sacha: Okay, the other thing that I was thinking of as a
Sacha: workflow improvement here, because I'm sure that I'm going
Sacha: to keep calling them by their old names, especially
Sacha: interactively, like have a lot of commands that go off the
Sacha: meta x, my do this and this and this is I might also need to
Sacha: think about adding a function alias automatically. And one
Sacha: way I was thinking of doing that was just, you know,
Sacha: iterating over our array and bulk defining aliases so that
Sacha: all the sacha- stuff is now named my- stuff but I was wondering
Sacha: if that was a or actually also manually inserting the like
Sacha: well not of course manually but but creating forms for like
Sacha: defining the aliases somewhere but I was wondering if
Sacha: this was something that you already did as part of your
Sacha: workflow like do you when you rename things okay
Prot: No, I haven't. When I rename things for my packages, I do use
Prot: aliases. But for my own code, if I rename it, basically, it's
Sacha: yeah yeah
Prot: just the latest name. So I don't try to keep aliases around.
Prot: Because I eventually use a similar name,
Prot: it won't be very different.
Sacha: huh all right yeah yeah I mean like it's it's there you
Prot: But what you said about the obarray makes perfect sense.
Sacha: might as well do do it automatically right okay all right
Sacha: that's me oh okay okay I can
Sacha: I can do my jitsi thing so I can see
Sacha: everyone and the screen at the same time the screen is very
Sacha: small okay so so that's I do have a dual monitor setup, which
Prot: Yeah, you need that dual monitor setup,
Sacha: is why I was like, OK, maybe I can start looking at your
Sacha: B-frame things. And in fact, in the minutes before I called,
Sacha: I figured out how to use MasterChat CLI to get the YouTube
Sacha: live chat into a command line program, which means that it
Sacha: can be run from call-process or make-process or other such
Sacha: wonderful things. So now it's an Emacs buffer. And then I was
Sacha: thinking, okay, maybe I'll make a pause frame or like a
Sacha: B-framed like dedicated frame for it so that I can have the
Sacha: chat of a live stream displayed within Emacs because you
Sacha: know, it's Emacs. We should do that. Yeah, yeah, yeah.
Prot: Nice. Yes, of course.
Prot: And you can have it in a side window dedicated buffer.
Sacha: Although I might actually have to write my own like Node.js
Sacha: program so that I can also send text from it, from Emacs.
Sacha: I think the masterchat CLI, it only displays, but
Sacha: the library that it uses, if you pass it your browser
Sacha: cookie, you can use it to send messages back to chat as well.
Sacha: The reason I had liked Twitch before was because
Sacha: Twitch had some kind of IRC type thing that you could connect
Sacha: to. And then that meant, of course, that you can use ERC from
Sacha: within Emacs in order to send stuff to it. Anyway, live
Sacha: streaming and chatting, I've also been getting into that
Sacha: lately. And I was going to pick your brain about this whole
Sacha: like workflow for making videos or live streaming them. And
Sacha: more importantly, going back afterwards and
Sacha: remembering to post them or edit it, in case you forgot
Sacha: something or whatever. So if you happen to have any tips
Sacha: or the things that you like about your setup, I would love to
Sacha: hear about that.
Prot: Though in my case, the setup is really simple,
Prot: and I admit that I could improve it.
Prot: But it's really simple right now,
Prot: where I have a wide monitor.
Prot: So it's one display, I don't have two,
Prot: but it's like 2500 pixels instead of 920.
Prot: So I have a little sidebar on the side,
Prot: and there on the sidebar I put OBS, for example,
Prot: and I put everything I need there on the sidebar.
Prot: And then I have enough space to have
Prot: whatever it is I am displaying
Prot: and maybe another widget on the side.
Prot: So that is in terms of the physical layout
Prot: of the monitor here.
Prot: And then in terms of the Emacs side,
Prot: I don't have a lot going on.
Prot: I have one package to load the different font configuration.
Prot: So when I do streaming or videos,
Prot: I will load basically the presentation setup.
Sacha: It is a spontaneous.
Prot: That's Fontaine, exactly.
Prot: But again, it's not a matter of the package.
Prot: You could have a function that just changes the
Prot: default phase, the height attribute.
Sacha: I have this monitor and then laptop,
Sacha: so this is my workaround for not having
Sacha: enough space in this desk for a super wide monitor.
Sacha: My husband has a super wide monitor which I like to borrow
Sacha: during EmacsConf.
Sacha: Hello child who is wonderful and likes to
Sacha: make cameos during my EmacsConf. Okay, I'm going to hug you.
Prot: Hello!
Sacha: Yes. So okay, so live streaming and then you just basically
Sacha: hop on the stream and talk about stuff.
Sacha: I know you've mentioned things like just starting Emacs with your
Sacha: Scratch buffer, but yeah, how about the interesting
Sacha: workflows for not accidentally spilling secret stuff
Sacha: online?
Prot: Part of that is...
Prot: so I use Vertico normally for my completions.
Prot: I have some configurations for private Vertico,
Prot: where by default, it doesn't display
Prot: what Vertico normally displays.
Prot: It's just a blank minibuffer,
Prot: the way it is with the default Emacs minibuffer UI, right?
Prot: But what happens is as soon as you do TAB
Prot: or as soon as you move up and down,
Prot: then it displays Vertico.
Prot: So that, that is one way for me to make sure
Prot: that I'm not showing anything I didn't want to show.
Prot: The other thing is when I do videos,
Prot: I don't use consult actually, even though I like it,
Prot: because of the preview functionality.
Prot: I don't want to be switching between files
Prot: and then consult shows us something which is private.
Prot: Right. So. So the private VertiCo, it's a small extension
Prot: that I have with a few functions for Vertico.
Sacha: I've been thinking about modifying the console preview
Sacha: states so that I can elide more, I can skip over things that
Sacha: might be private. And things like, I already have a filter
Sacha: function for marginalia so that it doesn't show me the
Sacha: values of variables that might be private. But yeah, just
Sacha: turning off all these things makes it a little bit easier to
Sacha: say, okay, I'm just going to jump on the live stream and do
Sacha: this thing.
Sacha: Some of the other fun stuff that I've been doing along the
Prot: So there is that. And for private, of course, the other thing
Prot: with privacy is that you want to have a generally good sense
Prot: of where you put your files. So for example, in my pictures
Prot: folder, I know that I don't have anything private there. But
Prot: there are some sub folders which are like personal. So I know
Prot: not to go there.
Prot: So it might happen, I need to show a picture,
Prot: okay, I just go to the pictures folder, and I show it,
Prot: no problem.
Sacha: lines of keeping things organized is if I have a stream tag on
Sacha: a task, I know that's safe to show on screen.
Sacha: And then I modified my Org jump stuff.
Sacha: There's a hook that you can use to
Sacha: narrow things to just that subtree.
Sacha: So at least I can jump to it
Sacha: and not have to worry about
Sacha: the rest of the context in my inbox.
Sacha: Trying to slowly slowly get the hang of this
Sacha: Okay. So it's live stream. Do you like to
Sacha: live stream and record at the same time locally
Sacha: or just live stream and then go into
Sacha: the YouTube thing afterwards to download?
Prot: I just do the latter.
Sacha: It takes a little bit of a while,
Prot: I just download it from Youtube afterwards
Sacha: so I'm like... I could get started on the transcription.
Sacha: Do you have anything to keep track of interesting moments
Sacha: that you want to revisit, or do you just, I don't know, skip
Sacha: around in the video, look at the transcript, whatever?
Prot: I remember, I know this sounds bad, but I remember.
Sacha: People with good memories, boo!
Prot: And generally I try to also sharpen my memory.
Prot: So whenever I can practice something, I will do it like that.
Prot: But otherwise, if you really need to take a note of something,
Prot: you can always have a small function
Prot: that just records the timestamp.
Prot: Like, what is the current time? And then you know
Prot: when you started, so you will know where you are in the video.
Prot: Like, it would be a very simple function that simply prints
Prot: the current time, you know, format-time-string,
Sacha: Yeah. I just have to write something that gets the time
Prot: in a buffer at the bottom of a buffer.
Prot: And that buffer is like your interesting moments kind of thing.
Prot: And if you really want, you can make that prompt you
Prot: for some text, like here is the timestamp
Prot: and here is like, you know Prot said a joke
Prot: or whatever, you know, like...
Sacha: started from YouTube
Sacha: and then calculates the offset automatically,
Sacha: so that I can say okay, here are my chapters roughly.
Prot: Yeah, that's even more fancy.
Prot: Or you could do the other thing, which is all local,
Prot: which is the moment the stream starts,
Prot: you hit this command, like you invoke it,
Prot: so it resets the time
Prot: and then it performs the calculation locally.
Prot: So you can do calculations with time in Emacs.
Prot: So you can perform that as well.
Sacha: Yeah, that's really straightforward.
Sacha: Okay, so that's definitely something that I'm going to want
Sacha: to think about, because video is great for enthusiasm
Sacha: and showing cool stuff that you might otherwise
Sacha: forget to mention, but it's just so slow to review afterwards.
Prot: Yeah, of course, of course, of course.
Prot: Just to say another thing with video,
Prot: what I have found that is really helpful is
Prot: to display line numbers.
Sacha: Oh yeah? Huh.
Prot: Me personally, I don't use line numbers,
Prot: but I have found that when I am displaying
Prot: something that others need to follow,
Prot: line numbers help them. Because for example,
Prot: earlier you were jumping around trying to find that hook, you were...
Sacha: Oh yeah, yeah, yeah. Okay. Display now.
Prot: And of course, me, I have experience,
Prot: so I kind of know what you are doing,
Prot: but somebody who is not really into it will be like,
Prot: what is happening?
Prot: Why are things moving up and down so quickly, right?
Sacha: Okay. And they can mention it, too, in the comments,
Prot: And they cannot track where you are.
Sacha: which is nice.
Prot: Yes, yes, of course. And also, when you are displaying
Prot: something, you can say, look, on line 100,
Prot: what I am doing, for example.
Sacha: I have to steal your config for the highlight line
Prot: And it's easy for everybody. Yeah.
Sacha: priority because I've been using the highlight line for
Sacha: that. But sometimes it overwrites things. I'm like, OK.
Sacha: Today it is well-behaved, so I'm glad for that.
Sacha: Making videos, all right. Just go ahead and make the videos,
Sacha: you just do it pretty straight, you don't do a lot of editing
Sacha: afterwards, I'm hearing,
Sacha: following the same kind of philosophy
Sacha: that you use for your blog posts?
Prot: That's the idea.
Sacha: All right, I should just go do things and not worry about
Sacha: whether the live stream demo that I just made
Sacha: of how I can highlight the PDF of your literate config
Sacha: and extract the stuff into whatever has a bug in it.
Sacha: And I'm like, oh, I just demonstrated that.
Sacha: It's okay, I can update it in the show notes.
Sacha: Oh, that's true, especially since
Prot: Or even better, you do a second video
Prot: afterwards, a follow up.
Sacha: now I figured out that you can use org-pdfview view
Sacha: to link to pages in the PDF.
Sacha: So now my index.org has the highlights from your config,
Sacha: and it takes me back to the page that it was on.
Sacha: Very very cool stuff.
Prot: That's nice.
Sacha: Okay, so I just gotta do it.
Prot: I think Org-noter also is another package
Prot: you could use for that.
Sacha: Yeah, probably. and then I just need to get...
Sacha: I think I've got PDF tools or PDF view set up.
Sacha: And then reader of course looks very interesting also.
Sacha: So I've got to tweak my config a little bit more
Sacha: to get it running because it has an
Sacha: external dependency.
Sacha: Anyway, so just got to do the live streaming.
Sacha: I was delighted. People have actually been
Sacha: dropping by and commenting or chatting during the live
Sacha: streams, which is great because I get to remember,
Sacha: oh yeah, I should explain that part, taking it for granted.
Prot: The thing with a live stream,
Sacha: So all of that is good stuff.
Prot: because it's something you also wrote,
Prot: like getting used to talking to yourself, right?
Prot: So, of course, that takes some practice,
Prot: but I think, yeah, you have the hang of it already.
Sacha: Something is ringing. Hang on, sorry.
Sacha: I forgot. That was just my reminder that the kiddo is back to
Sacha: school. Virtual school is fine.
Sacha: Anyways, OK, so so just got to do it.
Sacha: Thank you for the tips. This is very helpful for
Prot: You're welcome.
Sacha: writing. I'm getting better at actually remembering to
Sacha: include more bits and pieces from my config, and I'm sure
Sacha: that now that I have them in different files, it'll be easier
Sacha: for me to then write the post that links to, oh yeah, here's
Sacha: the five other functions you need in order to make this
Sacha: little snippet work. But do you happen to, knowing the kinds
Sacha: of stuff that we like to write about, do you have any other
Sacha: tips from your workflow?
Prot: When it comes to sharing code like that, I already noticed
Prot: while you were moving around that you have many things like
Prot: my-consult, my-org, etc.
Prot: What helps there is to just make those
Prot: their own module right away. And from there, you know
Prot: that, okay, this is either self-contained or it has an
Prot: explicit require, so I can already know where I need to
Prot: search for dependencies.
Prot: So it's really that. It's because, for example, if you take
Prot: just a my-consult function, right, of course, you know by the
Prot: name that it depends on consult, but you don't know if it
Prot: depends on my- common functions, for example. Right.
Prot: Whereas if you have it in its own file,
Prot: there will be a require at the top.
Prot: So, you know, OK, require my-common-functions.
Prot: And that way you can tell, okay, there is a dependency here.
Prot: So then when you are to share this function, you can search
Prot: for, okay, my-common-functions, is it mentioned here?
Prot: Yes or no. And then you know what the dependency is.
Sacha: And I think this process of moving things into those
Sacha: separate files will make it easier for then, for people to
Sacha: say, okay, yes, I do want to try that thing. Let me check out
Sacha: the repository required, just load-file that
Sacha: particular file and then be off to the races.
Sacha: So we'll see how it works.
Sacha: I don't know if people actually...
Sacha: Sometimes people mention borrowing stuff from my blog.
Sacha: So maybe people are actually reading
Sacha: the non-Emacs News posts. We'll get to see that.
Sacha: Sometimes I feel like a lot of my tweaks
Sacha: are very idiosyncratic, right?
Prot: Yes, what I found that has helped me is I implement the
Sacha: They're very suited to the particular need that I have.
Sacha: And then it's difficult to say,
Sacha: OK, if I were going to generalize this for other people, what
Sacha: kind of defcustoms will I need? What kind of options?
Sacha: And there's always that trade-off between, yeah, but I just
Sacha: want to implement the next little thing that I want to make
Sacha: for myself versus, well, if I put in the
Sacha: polishing effort, then possibly other people could use it,
Sacha: and learn from it, and then contribute their own ideas,
Sacha: and then everything gets better without me having to do the work
Sacha: myself. So it's a bit of a balance.
Prot: package that I want. So for example with denote, but this
Prot: applies to everything, denote version 0.1 is the package
Prot: that I wanted. So basically, it works for me. Ever since, I
Prot: have been adding other things that people want, which are,
Prot: of course, good things to have. They improve the package,
Prot: but I have already been using the package that I want since
Prot: the beginning. So ever since, it's just adding stuff and
Prot: learning about how people use it and refining the code,
Prot: which everybody benefits from. So whenever you have an idea
Prot: that you are like, okay, this may be too idiosyncratic,
Prot: don't worry about it. Make it into a package, and then what
Prot: other people need will become apparent, and then over time
Prot: it will change, but the core package is still what you want.
Sacha: Although it is interesting to see, for example, with the
Sacha: university calendar, institution-calendar thing, it's
Sacha: like, okay, you can get it to work for a small number of
Sacha: institutions, ELPA wants... they want it to work for
Sacha: everyone, everywhere, all the time.
Sacha: Okay, that might be too general.
Sacha: You might need to actually have lots of other people
Sacha: saying what they need in order to make that
Sacha: happen in the first place, right?
Prot: Which at that point, of course, what you want
Prot: is to write the documentation. So for example, with the
Prot: institution calendar, I wrote a couple of examples. Okay,
Prot: how do you extend this? And yeah, I think that helps. But then
Prot: of course, you cannot cover every use case like people have
Prot: to also make contributions if they really care about.
Sacha: Yeah, so I think at the moment,
Sacha: I've been writing for n equals one,
Sacha: the audience is really just me.
Sacha: And occasionally I hear from people who are like,
Sacha: oh, that's an interesting idea, let me adapt it.
Sacha: Sometimes if I'm really lucky,
Sacha: they will go and write their own package
Sacha: on top of the stuff that I shared,
Sacha: which is the ideal situation,
Sacha: because then I can just like, oh, yeah,
Sacha: I'm going to borrow that and use it.
Sacha: It'll have more features
Sacha: and they're in charge of dealing with that.
Sacha: But I suppose at some point it behooves me to practice.
Sacha: OK, I'm just going to write it as a package,
Sacha: pretending that this is something,
Sacha: as you said, this is something that I want to be able to
Sacha: install and use myself. Then if other people find it
Sacha: useful, it's a lot easier for them to experiment with and
Sacha: then add on to.
Sacha: Which goes to my second thing. Doing this and
Sacha: making things open to other people probably means being
Sacha: more responsive to email. And this is, for me, this is a bit of
Sacha: a challenge. I'm starting to feel less time-starved,
Sacha: which is good. I'm starting to actually be able to schedule
Sacha: things.
Sacha: One of these days, we should probably see if
Sacha: we can schedule a Prot Asks thing.
Sacha: I don't know if I can do two hours,
Sacha: but maybe I can do one hour or whatever.
Sacha: Anyway, the rest of it involves actually doing
Prot: For sure.
Sacha: the responsible thing and responding to issues
Sacha: and emails and whatever.
Sacha: It's always a bit of a trade-off, like, oh, do I implement
Sacha: this other crazy idea I have, or do I answer my email?
Prot: For that, of course, it's a challenge. I must say that a lot of
Prot: the maintenance work I do is via email. Or email or Signal or
Prot: Telegram. People will ask me, hey, Prat, what is this? And
Prot: many of the issues are not with my package. I had an issue
Prot: earlier with the modus themes, no, the ef-themes, and
Prot: eventually it was something to do with the user's
Prot: configuration of some function of center tabs. But I had to
Prot: go into it and check. So, of course, there will be that. But I
Prot: must say, it's not too bad. It's not a big issue. You can
Prot: always have in your email, like, hey, please don't use this
Prot: for issues. And it's not a replacement for that.
Prot: Just use the issue tracker.
Sacha: I know I just have to...
Sacha: I think I just have to like reframe my perspective.
Sacha: This is a gift. Other people are taking their
Sacha: time and effort to do this.
Sacha: It's wonderful that they're trying things out
Sacha: and putting their...
Sacha: actually doing things themselves
Sacha: and then reaching out in case...
Sacha: 'cause it would be nice to get things working on more
Sacha: people's computers. I think that the stuff that I've
Sacha: been building around learning languages and doing voice
Sacha: input into Emacs probably...
Sacha: There are a lot of these things already,
Sacha: but they tend to also be very individual workflows
Sacha: and individual setups.
Sacha: So it'll be interesting to get to the point
Sacha: where we can start to even have a conversation with shared code.
Prot: About the individual workflow, again, it's not a
Prot: problem because what is individual now will eventually
Prot: become kind of a standard workflow. Think about org, the
Prot: beginning of org. You have Carsten Dominik, who is like, you
Prot: know what, this outline mode isn't enough. I need more stuff
Prot: on top. And eventually we have Org. In the beginning, I
Prot: imagine org was basically Carsten's org, and it became this uh
Prot: this package that everybody can use however they feel like.
Sacha: I used to maintain Planner Mode before Org Mode got super popular
Sacha: and I remember feeling very embarrassed when someone very,
Sacha: very kindly said "I appreciate the work that
Sacha: you do; incidentally, the latest update kind of
Sacha: deleted a lot of my notes." So this is like,
Sacha: when you make something that other people use,
Sacha: sometimes your mistakes will affect more people
Sacha: than just you. But I'm hoping now that
Sacha: now that the disks are in the spaces of terabytes
Sacha: instead of whatever, people are just backing up everything
Sacha: and version controlling everything
Sacha: and everything will be fine.
Prot: Yeah, of course, of course.
Prot: Writing packages, of course, is a responsibility. The
Prot: upside, though, is that because you know that it is a
Prot: responsibility, you try to write cleaner code at the outset.
Prot: Whereas if it's just for your own configuration,
Prot: you're like, okay, this will work and I will fix it later.
Sacha: Yeah, and that actually brings me back to this Emacs Lisp
Sacha: development workflow thing. So I think one of the things
Sacha: that I just need to do is I just need to set up the Makefiles and
Sacha: the snippets and the shortcuts to say that if I'm
Sacha: starting a new proto-package, the thing to run the tests
Sacha: is there, and whatever it is that maybe even continuously
Sacha: runs the test when I make a change, and lets me mock up
Sacha: functions so that I can test some of the things that might be
Sacha: more interactive or might require deleting files or
Sacha: whatever. It's just changing my buffer configuration and
Sacha: whatever.
Sacha: So I occasionally write ERT tests when I feel diligent.
Sacha: Sometimes I'm starting to write the test first
Sacha: and then write the code that makes a thing,
Sacha: but if you happen to have any parts of your workflow
Sacha: that you particularly like
Sacha: when it comes to testing things,
Sacha: I would love to hear about them
Sacha: because I haven't gotten to
Sacha: that part of your config yet
Prot: Yeah, so I don't have a lot going on for that. So it's simply
Prot: ERT. But what I do with the tests is really basic. So ERT,
Prot: M-x ert, and then I pick the test that I want. And I must say that
Prot: when it comes to tests, I can be better myself. So there are
Prot: some packages I write where they have good tests, but there
Prot: are others that have zero tests. So I want to reach a point
Prot: where everything has tests, but it takes a lot of work.
Sacha: Yeah. I mean, like every so often
Sacha: I feel like very, very diligent
Sacha: and I'm like, okay, let's do code coverage.
Sacha: So I can see things with undercover.
Sacha: Let's write a function and make sure there's a test
Sacha: associated with it. And let's write a keyboard shortcut that
Sacha: lets me jump from the thing to the test
Sacha: that's associated with it or to run it.
Sacha: And in fact, I still need to
Sacha: get embark to do all these things for me so I can
Sacha: be looking at a function and say
Sacha: just rerun the test for this, please.
Prot: Just to say one low-tech feature that has helped me a lot,
Prot: low-tech, Is i use the docstring as a declaration of intent.
Prot: So in the docstring, I say what is the function or the variable
Prot: meant to do, like what is it meant to provide. And then if I look
Prot: at the code and I'm like, ah, this doesn't work, I know that
Prot: the doc string is what I wanted. It's never the code. So there
Prot: is this idea that the code is a source of truth. For me, it's
Prot: the opposite. It's like the doc. It's the specification.
Prot: And then the code is... I was wrong. I was sloppy. I
Prot: wasn't paying attention. I missed something or whatever.
Prot: And the reason for that is the following. It's because with
Prot: the code, you may have used the symbol wrongly, or you may be
Prot: calling something that you don't mean to call, or there is
Prot: another function. Or, for example, you use mapc instead of
Prot: mapcar, so you don't get the return value you expect, that
Prot: sort of thing. So something, basically you don't deal with
Prot: sloppy problems. So you don't have confusion there. You
Prot: know that, okay, the source of truth is the docstring.
Prot: This is my intention.
Sacha: I should do that more often. Now that I've changed my
Sacha: yasnippet for inserting functions to automatically have the
Sacha: docstring, I feel a little guiltier when I delete the
Sacha: docstring, so I am compelled to instead fill it out. But if I
Sacha: specify it in more detail, as you do with it becoming the
Sacha: statement of intent, then I can be like, OK, let's try that.
Sacha: It's a good practice.
Sacha: And then I can write the test.
Prot: And the thing with docstrings is that, of course, you are
Sacha: Yeah? This is me.
Prot: motivated to just write the minimum necessary so that you
Prot: don't get the warnings, right, from checkdoc.
Prot: But if you write more, then you are rewarded yourself.
Prot: It's something that helps you, future you,
Prot: and of course other users, because you always have to
Prot: consider yourself as basically a user.
Prot: I don't remember why I wrote this six months ago,
Prot: so of course having the docstring there,
Prot: actually spell it out, helps me.
Sacha: I definitely have problems with working memory
Sacha: and long-term attention. Which actually touches on this
Sacha: other thing that I mentioned in my post, which is, in your
Sacha: experience coaching other people and also in your personal
Sacha: practice, what are you finding as good ways to keep
Sacha: reminding yourself, okay, these are the keyboard
Sacha: shortcuts I want to internalize, or this is the the workflow
Sacha: tweak that I wanted to try naturally. I was
Sacha: thinking, maybe I make an Org file or maybe I make a
Sacha: quick help thing or whatever. But it's always interesting
Sacha: to hear about other people's workflows.
Prot: What I find most useful is to not try to memorize too many
Prot: things, but whenever you are in the flow of, oh, this is a
Prot: process that I want to be doing, to actually implement it as a
Prot: command or whatever, as a package or whatever, like
Prot: basically don't try to memorize the steps and of course the
Prot: key bindings.
Prot: Try to build a function that does those for you.
Prot: A command basically that does those for you.
Prot: So for example, to be concrete,
Prot: I mentioned earlier that for video purposes,
Prot: I will enable line numbers.
Prot: And I will also enable the line highlight.
Prot: And I have another thing where I disable spacious padding.
Prot: So the package I have. And all this, of course,
Prot: I know the key binding. So it's F7 and F8 and F6 or
Prot: whatever, right? But I'm like, I cannot remember all that.
Prot: I will just write a function, and it will be
Prot: prot-streaming-mode. And I enable prot-streaming-mode, and
Prot: it does what I want it to do, and then I disable
Prot: prot-streaming-mode, and I'm back to where I need to be.
Sacha: Yeah, I have a prepare-for-screencast that does
Sacha: something similar, changes font size, etc, etc.
Sacha: Tt's so wonderful that in Emacs, you can
Prot: Exactly.
Sacha: just keep collapsing things into functions that do the
Sacha: thing that you wanted,
Sacha: and it has access to pretty much everything.
Sacha: I just need to remember to actually call the
Sacha: thing and remember what the thing was actually called.
Sacha: Aliases are very helpful, so it's orderless, but it's like...
Prot: Another thing that might help is long names. Because with long
Prot: names, you have more chances to match it. For example, in
Prot: this case, it could be called prot-streaming-mode, but you
Prot: could also call it prot-streaming-and-video-demonstrations-mode.
Prot: And of course it sounds ridiculous,
Prot: but if you think about it, I might search for,
Prot: I do M-x and I search stream. I find it. I search video.
Prot: I find it, right. I search demo. I find it.
Prot: So, if you care about something, you can name it that way,
Prot: and then you find it more easily. Or, of course, with
Prot: aliases, you do the same, right? prot-streaming-mode,
Prot: alias, prot-video-mode, alias, you know how it is. But, yeah,
Prot: either of those would work. Basically, benefit from the
Prot: fact that you have completion, and I imagine you also have
Prot: orderless.
Sacha: So definitely that. And then
Prot: So, yeah.
Sacha: for the free form notes thing, it just occurred to me.
Sacha: So in addition to your posframe stuff in your config for
Sacha: quickly popping up an Emacs posframe for some
Sacha: commands, like, do you have some things?
Sacha: I suppose I could just use that directly for my notes
Sacha: and for the chat. Do you have any other of those "quickly pop up
Sacha: something so that you can do something with it and then make
Sacha: it disappear?"
Prot: No, I haven't built a lot on that. So I have some functions I do
Sacha: That's your main thing.
Prot: with that. Specifically, I have it for the timers. For me,
Prot: that's very useful. And for org-capture, but I haven't
Prot: elaborated on it. Of course, I could do that more. Another
Prot: that I... By the way, it's not a poframe.
Prot: Technically, what I have is just a new frame.
Prot: But the idea is the same, right?
Prot: It pops up and it disappears.
Prot: And I can share the code for that.
Prot: It's in the prot-window package, actually.
Sacha: I have it highlighted here in my...
Prot: So it's a small macro there.
Sacha: So this is the thing that I was telling you about earlier
Sacha: where it just extracts all the things that I've
Sacha: highlighted. It's very, very cool.
Sacha: It's in one of these, I'll grab it eventually.
Sacha: Which is good because I have to go over
Sacha: my config at some point.
Sacha: There's so much in there that
Sacha: I've completely forgotten writing about.
Sacha: And so I'm like
Sacha: reading this now as I'm splitting it into different modules
Sacha: and saying, oh yeah, I automated that.
Sacha: I'm doing it manually again.
Prot: The other thing that might help is a prefix key.
Prot: So I have done that with C-z. So it's a prefix key,
Prot: and then either with which-key or with Embark,
Prot: you know, the Embark... When Embark replaces C-h.
Prot: I forget how it's called now.
Prot: You can always see, OK, what do I have? Like, what are the groups?
Prot: And then you can cluster things there. And it's very easy.
Prot: Ever since defvar-keymap, ever since that became a thing,
Prot: it's very easy to write prefix keymaps, because it has a
Prot: keyword called prefix, and then with that prefix you define
Prot: how the keymap should be called as a command.
Sacha: That's interesting. I should definitely look into that.
Sacha: Finds how it should be called. That's a command.
Sacha: So you can just add it to other key maps as needed.
Sacha: That sounds cool.
Prot: So consider this difference, like right now, you can take a
Prot: defvar, which is a keymap, right? And you can bind it to a key,
Prot: the keymap itself, without the quote,
Prot: you can bind it to a key. So you will do define key
Prot: in the global map, like whatever you want, and then bind it.
Prot: What happens though with that
Prot: is that you're binding the value of the keymap to the key,
Prot: which means if you make changes to the keymap,
Prot: your key doesn't know about them.
Sacha: I've been running into that. I get annoyed and I have to keep
Sacha: re-evaluating my definitions.
Sacha: So yeah, okay, that's what I do.
Prot: Whereas if you have the prefix, which is now a command, you
Prot: have created an indirection. So now you define key to the
Prot: symbol that you have specified.
Prot: And that, of course, is that indirection,
Prot: which now gets the up-to-date value of the keymap.
Sacha: So this is Emacs stuff that I have been missing out on,
Sacha: because for the past 10 years
Sacha: I've just been squeezing things
Sacha: into whatever moments I can have
Sacha: before somebody comes and says hello
Sacha: and says mom mom mom mom,
Sacha: and now that I have a little bit more focus time,
Sacha: I'm looking forward to finding out about all the cool stuff
Sacha: that has gone into Emacs and that I'm not currently taking
Sacha: advantage of.
Sacha: So things like, for example, I only scratch the
Sacha: surface of using Lispy, and I want to do other things as
Sacha: expressions because it's all magical. And if you have
Sacha: similar, like, oh yeah, this is a new thing in Emacs 30 or 31
Sacha: that is super helpful and not everyone knows about it, I'd
Sacha: love to know about it. I mean, I know it's on Emacs News,
Sacha: but sometimes I'm like, whoosh, it goes past my radar
Sacha: and I don't have the time to dig in.
Prot: Yeah, right now I cannot think of something.
Prot: But yeah, I will.
Prot: Oh, a very small thing that helps me a lot when I make any
Prot: kind of edit. You know, there is this function diff buffer
Prot: with file. So that's good. For me, what I always want is
Sacha: that sounds like a little tweak
Prot: diff-buffer with a current file.
Prot: I don't want to diff a buffer
Prot: with some random file. So what I have is a very small
Prot: extension, a very small function,
Prot: which is diff-buffer-buffer-file-name.
Prot: So buffer-file-name is the variable for the
Prot: current buffer's file. And then I do the buffer file name.
Prot: And for me, that's very useful. Whenever I make an edit or I'm
Prot: not sure what happened, I do that and I already see the diff. I
Prot: use that a lot.
Sacha: that I would love to to pick up as well.
Sacha: There's all sorts of interesting workflow things
Sacha: that I am looking forward to discovering
Sacha: as I figure out the better way to watch videos
Sacha: and then also make videos,
Sacha: because one of the things I find
Sacha: is whenever you demonstrate something, sometimes,
Sacha: if you're really lucky, someone will say,
Sacha: oh yeah do you know about this thing
Sacha: that does the whole thing,
Sacha: which is great.
Sacha: One of my favorite reasons for sharing things
Sacha: is learning from other people.
Sacha: All right.
Sacha: You write this really long blog
Prot: Same. Like you put it out there and somebody will be like,
Prot: hey, you could do it this way instead.
Sacha: post about this clever thing that you just figured out and
Sacha: then five minutes later, oh yeah,
Sacha: that's been built into Org since, you know, version 9.7.
Prot: Exactly, exactly.
Sacha: Which actually leads me to: what can we do?
Sacha: We've got about 20, 15 minutes left in this hour.
Sacha: Taking advantage of your very large context window for all things
Sacha: Emacs community, you know, those kinds of stuff that we are
Sacha: interested in, what are some of the things that we could do to
Sacha: make things even better? This is a very open question, of
Sacha: course, but yeah.
Prot: Even better, you mean Emacs in general or Org in particular?
Prot: Because Org got a very nice feature lately, Org 9.8, which is
Prot: the ability to preview images for any link type.
Prot: So that's very useful.
Prot: Before it was like the file type. Now it's any
Prot: link type. And of course, if you ever want to do something
Prot: with a custom link type, there you have it.
Sacha: Which is good because I, in fact, have an override for a
Sacha: custom link type where I had done it before. So I just
Sacha: basically copied and pasted the image preview link so that I
Sacha: could have my SVGs either included in it as a whole or just
Sacha: preview.
Sacha: Anyway, so yes, I'm going to switch over to the new one.
Sacha: Link preview, update my code for SVGs.
Prot: Yeah, for example, now imagine this. Imagine you have a
Prot: custom link type, which is called image or something, and
Prot: you just give the image a name, nothing else. And
Prot: internally, this link type knows to go in a specific
Prot: directory and get the image from there, maybe even have
Prot: copies of the image, so it can give you a copy that matches
Prot: some parameter or whatever, like some user option maybe.
Prot: You could have fancy things like this. I have been thinking
Prot: about it, but I haven't written anything yet.
Sacha: I would probably like... Things like my audio waveforms could
Sacha: go in there very easily and things like that.
Sacha: I'm very curious about this idea of mixing more things into other
Sacha: places in Emacs. And one of the things that I've been meaning
Sacha: to dig into is how LECDraw does SVG interaction, because it
Sacha: uses mouse events to be able to drag things around and
Sacha: whatever. Because I think if we can get richer
Sacha: interactivity and more graphical elements, that could be
Sacha: really fun.
Sacha: Anyway, but yes, so I've got basically three
Sacha: months of focus time before the kid goes on summer vacation
Sacha: and wants my attention at probably the majority of the day
Sacha: at an irregular interval. So it'll be a lot harder for me to
Sacha: schedule things then. I can set aside maybe 10
Sacha: hours a week to work on Emacs-y things, including possibly
Sacha: working on infrastructure for the upcoming EmacsConf,
Sacha: or tweaking Emacs News or hosting meetups or whatever.
Sacha: Taking advantage of you as an external perspective,
Sacha: are there things that would be a good idea for
Sacha: me to particularly focus on? Things that you've been
Sacha: wishing you could say, Sacha, hey,
Sacha: just do this thing and it'll be awesome.
Prot: I think you already have a very good setup, actually.
Prot: So I don't think there is much to be done
Prot: in terms of adding things.
Prot: Maybe the work here is to be removing things, and
Prot: that's the more difficult part.
Sacha: No!
Sacha: Delegating things. Passing things to other people, maybe.
Sacha: Making it possible for other people to help.
Prot: There is a very small thing which maybe is useful,
Prot: maybe it isn't. I don't know how much you use the mode line,
Prot: how much you rely on that, but the newer version of Emacs makes it
Prot: possible to shrink the lighters for the minor modes.
Sacha: Yeah, I don't use the mode-line as much.
Sacha: I ended up moving keycast to the header line
Sacha: because it's a little bit more visible in videos.
Sacha: Sometimes when closed captioning is on, it obscures the mode line.
Sacha: So I don't tend to look at the mode line for much,
Sacha: and I'm wondering what I'm missing out on.
Sacha: And I'll probably also want to add: am I streaming?
Prot: Yeah, not much. Not much is the answer, but maybe you could
Prot: declutter it in that regard so that then it is useful. For me,
Prot: where it really is useful is to know some things such as, of
Prot: course, what is the buffer name? Is the view narrowed?
Prot: That's, for me, really important.
Prot: Maybe is it a read-only file?
Prot: And am I running a keyboard macro?
Sacha: Is my microphone on?
Prot: Yes. Good, good.
Prot: You see, there are all sorts of good ideas.
Prot: And you can think of those as just one character, right?
Prot: And you can have that one character with a face, which has,
Prot: for example, a background. So is my microphone on?
Prot: That's a green background. Am I streaming?
Prot: That's a red background or whatever.
Prot: And you just see the colors there and you know
Prot: everything is all right.
Sacha: Although, actually, now that we're talking about it,
Sacha: I'm thinking maybe I should just revive websockets.
Sacha: So I made an obs-websocket.el thing before, and someone has...
Sacha: The benefits of making a package:
Sacha: someone has actually updated it
Sacha: to work with the new WebSocket protocols.
Sacha: I just have to get the whole thing set up again
Sacha: so I can communicate with OBS.
Sacha: I can use a different theme, most likely
Sacha: another Modus theme, when I'm streaming,
Sacha: so that it's a little bit more in my face:
Sacha: okay I'm looking at the correct colors, I am public.
Prot: That's the other thing. Yeah, that's good. That's good.
Prot: With themes, unfortunately, that's
Prot: actually something I would like to have. We cannot have them
Prot: per frame, which is strange because if you do
Prot: set-face-attribute, you can specify a frame argument.
Prot: But if you do something like custom-set-faces, you cannot.
Sacha: I'm sure that once you start messing around with Emacs
Sacha: internals, you might be able to figure out the way to do that.
Prot: Yeah, now that I say it, it shouldn't be too difficult. Yeah.
Prot: Famous last words.
Sacha: Yeah, yeah, yeah. That's really fun.
Sacha: Okay, so that gives me stuff to work on.
Sacha: I brought up briefly the idea of possibly
Sacha: setting up some kind of streaming things because I think,
Sacha: for example, this conversation that we have...
Sacha: I have so far managed to not share anything
Sacha: that is too private, except for, of course,
Sacha: the time when the kid is like, hello, mom,
Sacha: I need your attention and I want to be on stream.
Sacha: She likes to make cameos.
Sacha: So we could share this,
Sacha: and we could potentially think about
Sacha: having these kinds of conversations
Sacha: as something that other people could join in on,
Sacha: because it causes more questions,
Sacha: it's more interesting, and it also gets stuff out there
Sacha: without me having to type the lessons learned.
Sacha: So is that maybe something we can consider doing,
Sacha: I don't know, once a month for the next three months?
Prot: For me, yes. Even more frequently than once a month.
Prot: Whatever works for you. For me, it works. That's the point.
Prot: And also not in the context of coaching or whatever, but
Prot: generally as a collaboration, I'm totally okay with that.
Prot: Basically, more events for the community. I'm all for it.
Sacha: Yeah, because it is different.
Sacha: I very much had missed doing Emacs chats,
Sacha: and I'm so delighted that you've got Prot Asks.
Sacha: I'm looking forward to watching
Sacha: the one that you just released,
Sacha: because it's a community event, right?
Sacha: You get to know about interesting things about people.
Sacha: And there are a lot of things
Sacha: that come up through conversations
Sacha: that don't come up when you're just
Sacha: writing by yourself.
Prot: Yes, yes, yes. It's really that. It's really that. And for
Prot: me, it's also another thing, which is it's more inviting.
Prot: Like, it's like you are telling people, hey, show up like you
Prot: can participate. Actually, we are friendly. Like, here we
Prot: are. You see us.
Prot: I think that kind of encouragement helps.
Sacha: So if you want to do, like, Emacs office hours
Sacha: on a regular basis,
Sacha: either something that you schedule in yours...
Sacha: Is it a YouTube thing where we can both schedule a live
Sacha: and then both have it, or not?
Sacha: I think they've got a collab thing now. I don't know.
Prot: I haven't explored it. So on the technical side, I really
Prot: don't know. But in terms of intention, I'm all for it. So we
Prot: can of course figure out the technicality.
Sacha: You have the bigger channel.
Prot: But I really don't know.
Prot: We can do it twice a month, or even if you want, if you are really
Sacha: If you want to set it up, then Thursdays are probably good.
Sacha: Or if you want me to set it up, then I can do that.
Sacha: And then we can figure out the platform details
Sacha: and the non-YouTube way for people to join...
Sacha: probably IRC. We've got all this lovely
Sacha: infrastructure for EmacsConf,
Sacha: which I dust off every month for meetups.
Sacha: So that's certainly something
Sacha: we can slide right in there too.
Sacha: Okay, so if we do it once a month,
Sacha: that just gives me three sessions of practice,
Sacha: but if we do it like twice a month or more,
Sacha: I am also okay with that.
Sacha: I think we can squeeze that in and make that happen.
Prot: into it, once a week, a live stream once a week. And yeah,
Prot: people can join, and we can always have a topic and talk about
Prot: it and take it from there. We could also do it.
Prot: Now, I don't know whatever makes more sense,
Prot: but we could do it on my channel. And then, of course,
Prot: with a prominent link to your channel,
Prot: or we can do it one on your channel,
Prot: one on my channel or always on your channel.
Prot: Me, I don't mind at all. Like me,
Prot: I'm in for the fun.
Sacha: We'll figure out the technical details
Sacha: and whatever off-stream.
Sacha: It could be interesting because then
Sacha: that gives people a friendly place to drop by and chat.
Sacha: And also because I know you're there and I'm there,
Sacha: it gets away from the talking to myself.
Sacha: When it's just me talking
Sacha: and then it's just like chat is silent,
Sacha: it just feels like I have this unfairly privileged position.
Sacha: So yeah, that's definitely something
Sacha: we're going to look into.
Sacha: We can structure that as one of these coaching thingies
Sacha: if I'm looking for excuses to use
Sacha: the Google Open Source Peer Bonus.
Sacha: I still haven't really made a justifiably good plan for it.
Sacha: So yes. Okay.
Sacha: Oh, this has been very helpful.
Sacha: I've got like all these tips.
Sacha: If you're okay with it, I am totally fine with posting
Sacha: this recording online.
Sacha: If you want, you can also post it.
Sacha: I think there's some kind of collab thing.
Prot: Me, I don't have a recording. So you can do whatever you want.
Prot: So it's really up to you. Me, I don't mind. The reason I don't
Prot: have recordings of my meetings is because I really have this
Prot: policy of, you know, it's private. Your name is never known.
Prot: Nobody has seen this. That's the idea. Of course, in your
Prot: case, you're making it public. So, of course, that's fine.
Sacha: Yeah, my stance is always, well,
Sacha: I'm going to learn stuff, but A, I'm very forgetful,
Sacha: so I need to be able to search it and find it again.
Sacha: And B, other people can pick up stuff too.
Sacha: I might as well expand the learning
Sacha: and do the learning out loud.
Sacha: So all that is good.
Sacha: And then for next time,
Sacha: which will probably be in two weeks,
Sacha: or maybe earlier if I manage to get my act together,
Sacha: I'd like to see if I can get my stuff
Sacha: properly split up into different modules
Sacha: that have the different namespace.
Sacha: I really think I'm going to end up shifting to
Sacha: the sacha- namespace instead of all the my- stuff.
Sacha: I used to use the my- namespace prefix
Sacha: so that people could copy and paste things
Sacha: more easily into their code.
Sacha: But now I'm like, well, if I put it in sacha-,
Sacha: then I'm not polluting their namespace
Sacha: if they're loading the whole library.
Prot: Yes, yes, exactly. Exactly, exactly. That's a good thing.
Sacha: So that's on my to-do list.
Prot: And with naming things, of course, I also hinted that in the
Prot: article I wrote in response to your blog post. It really
Prot: helps to think about the names. Also, with what we said
Prot: earlier about finding things like so don't try to be too
Prot: terse, too economical with the names like make the most of it.
Sacha: I'm using nameless anyway to hide the prefixes.
Sacha: Got to get the hang of using the keyboard shortcuts
Sacha: to insert things.
Sacha: Yeah, so I do like having very verbose function names
Sacha: and just practically full sentences in the thing.
Sacha: All that is very good. So that's my main thing.
Sacha: Aand then of course, getting into more ERT...
Sacha: I have this function that now that lets me try to
Sacha: jump to the test or the file that's related to this thing.
Sacha: So we'll see how it goes,
Sacha: especially as I move things into
Prot: Okay, okay I'm not sure how you are doing that, but if I were to
Sacha: these different functions.
Prot: implement something like that myself, what I do with the ERT
Prot: tests, it's always the prefix of the ERT file and then the
Prot: name of the original function, double dash and then the name
Prot: of the original function. So, for example, let's say,
Prot: modus-themes-tests, right? So then it's
Prot: modus-themes-tests--modus-themes-load-theme, for example.
Sacha: Okay, so that's your naming convention.
Prot: That's a convention. That's a convention, yes.
Sacha: I should try that.
Sacha: I've just been basically naming things as function-name.
Sacha: And then I was, like, maybe I should be calling them
Sacha: function-name-test.
Sacha: Or in this case, you know, package.
Prot: Just to add something to this, because you also named this,
Prot: so the nameless user. So there is built into Emacs this thing
Prot: called shorthands.
Sacha: Yeah, I read about that, but you did mention that some people
Sacha: have been going back and forth about whether it's worth
Sacha: using it or whether it confuses things more.
Sacha: I think just leaving the names as is
Sacha: and then just displaying it differently
Sacha: seems to be like an in-between step.
Prot: So that's what shorthand does. The name is, for example,
Prot: modus-themes-test. And shorthand, effectively, is a buffer
Prot: local variable which takes the small prefix and maps it to
Prot: the larger prefix. So modus-themes-test can be mtt,
Sacha: Okay.
Prot: for example.
Sacha: Okay. All right.
Sacha: So basically it's a more powerful nameless,
Sacha: more configurable, and it's built in.
Sacha: So I should check that out also.
Prot: Yeah, you can check it. It's not configurable, like it
Prot: doesn't give you too many options. But the point is that for
Prot: this simple case, at least for the tests, I find it useful
Prot: because I don't want to have like a railroad of a function
Prot: name, right? So I just want to be looking at something that I
Prot: can understand. And basically, the prefix of the test is
Prot: just there for it to have a prefix. And then I know what the
Prot: function I am testing is.
Sacha: I had a quick question about the config. So you
Sacha: have, in addition to your modules, you also have...
Sacha: Your Emacs's configuration is also split up
Sacha: into multiple files.
Sacha: How do you bisect these things when you're tracking down the bug?
Prot: I don't write bugs. No, no, no, of course, I'm kidding.
Sacha: That's going to go in the quotes.
Sacha: Okay, I don't write bugs.
Sacha: I write a lot of bugs.
Sacha: That's going to go to the blog post.
Sacha: It's going to be very large.
Sacha: So you never have to use bug-hunter because you just
Sacha: don't write bugs in the first place. Bravo. Good for you.
Prot: Why didn't people think about that?
Prot: Now, of course, I'm kidding.
Prot: So the way it works is that they are actually
Prot: standalone packages. So there is a distinction, actually,
Prot: in my configuration. So there are the modules, which is the
Prot: configuration blocks, what would be done with. And then
Prot: there are the libraries, which are actually packages, like
Prot: I could just publish them right now. For example, for the
Prot: mode line, there is prot-mode-line. That could be a package
Prot: tomorrow, no problem. So if there is a bug there, I will go and
Prot: deal with it the way I would deal with any package, like
Prot: edebug, toggle-debug-on-error, whatever it is that I am
Prot: doing. So there never is a scenario where the code is in all
Prot: sorts of places, scattered across the file, and then, of
Prot: course, it's very difficult to track it.
Sacha: But for your config, if it's in multiple files
Sacha: and you need to bisect it... Bisecting can get you to
Sacha: this load-file over here, this require over here
Sacha: is where things break down, but then you have to...
Sacha: okay, I want to load everything above that point and then
Sacha: bisect into the thing, which is slightly more annoying.
Prot: In practice, it's not difficult, because the way I
Sacha: I don't know. How does that work?
Prot: load my packages, so in the modules themselves. So I have
Prot: this macro, which has a condition case in it. Of course,
Prot: usePackage has the same, but with usePackage, you have to
Prot: have everything as a package, whereas what I have here is
Prot: even if it's not a package. So condition case, and basically
Prot: if there is an error, it tells me where the error is, and then I
Prot: can find it very easily. I have never had a scenario (of course I was joking,
Prot: but actually I'm serious)... I've never had a scenario where
Prot: I was confused as to what was happening. It was always very
Prot: easy to find the error. If it's a bug... Yeah.
Sacha: Errors are fairly straightforward
Sacha: because it complains about it,
Sacha: but when it runs but it just produces
Sacha: the wrong behavior eventually,
Sacha: then that's the annoying part
Sacha: that I've been using bug hunter for.
Prot: The only scenario I think now that I had an
Prot: issue like that was with the mode line, actually. Because
Prot: with the mode line, if you give it like a wrong face or
Prot: something, I don't remember, it will print like several
Prot: messages for everything that changes on the mode line. So
Prot: you will get like, well, invalid face, and there will be
Prot: like, in square brackets, 100 times of this message. So
Prot: That's the sort of thing that indeed is more tricky, but that
Prot: was not because of my code. It was because of one small tweak
Prot: that affects the mode line, and then it was about figuring
Prot: out what the error is there, what's the bug there. But if you
Prot: have the configuration split up in ways that are logical or
Prot: thematic, if you want, whatever bug is always in one spot. It
Prot: won't cut between files. So for example i have a module
Prot: which is theme in the wider set but the theme also includes
Prot: fonts. because fonts are, in Emacs terms, part of faces,
Prot: themes deal with faces, that sort of thing. So whenever it's
Prot: something related to appearance, I know that it's in the
Prot: theme. It cannot be somewhere else because of how I have
Prot: written it. Of course, depending on how you split things up,
Prot: you will end up in a scenario where you have bugs that go
Prot: across files. For example, a common one is where people will
Prot: have, for example, evil mode, right? And then they will load
Prot: everything, and then they will have a separate
Prot: configuration module, which is for key bindings. And
Prot: basically, that's a disaster, because whenever there is
Prot: some problem, you don't know which key binding relates to
Prot: which package, and you are always in a state that it's hard to
Prot: predict.
Prot: And basically, you have to do every key binding with eval
Prot: after load, this package, this key binding kind of thing.
Sacha: Oh, that's going to be fun.
Sacha: I do have a bunch of key bindings in my file,
Sacha: so I'll just have to see how that all gets organized.
Prot: If you have them, organize them by package. Define them
Sacha: That's actually mostly what I've been doing,
Prot: close to the context. Okay.
Sacha: mostly because I think of it,
Sacha: I think of the key binding
Sacha: when I'm adding the package to my config,
Sacha: so it's right there.
Sacha: I just realized I could probably just copy
Sacha: the top of my config file with requires or whatever
Sacha: to a setup file,
Sacha: which bug-hunter can then load. So I can still probably use
Prot: Okay, good.
Sacha: bug-hunter with that. Anyway, thank you so much.
Prot: Yeah, sure. I just wanted to ask the last thing.
Prot: What is the kind of bug that you have encountered?
Prot: What kind of bugs are we talking about here?
Sacha: Recently, in my shifting of everything to the new system,
Sacha: I also happened to realize that I had updated my Emacs
Sacha: and then stuff wasn't highlighting in the mini buffer.
Sacha: I eventually found out that it was because I needed
Sacha: to upgrade certain packages.
Sacha: But in the meantime, I was like, what do you mean?
Sacha: Okay, emacs -Q, sometimes it's working,
Sacha: sometimes it's not working.
Sacha: Okay, let's start narrowing it down.
Sacha: And that was fun.
Sacha: The other thing that I recently had to bisect was:
Sacha: I was exporting my really large config
Sacha: after having split things up into different modules.
Sacha: One of the lines was causing it to go into like a
Sacha: debugging thing, but it would not tell me what
Sacha: it actually debugged. You know, the backtrace would just
Sacha: not happen. So then I actually had to narrow to region
Sacha: and then export the specific sections of my file until I
Sacha: narrowed it down to, okay, my defvar custom link needs
Sacha: fixing. So I do this kind of bisection a lot.
Sacha: Ideally, whenever I can, I like to be able to
Sacha: just write an assertion
Sacha: so that Emacs can do the work of narrowing down
Sacha: when this happens but sometimes it's just,
Sacha: you know, you gotta pick your range
Sacha: and then execute the thing and see what happens.
Sacha: So I'm always looking for tools
Sacha: because I write a lot of bugs.
Sacha: I'm sure by the time I see you again,
Sacha: it may be either next week or next next week,
Sacha: I will have more bugs to share
Sacha: and more things to learn from.
Sacha: But this is very helpful
Sacha: and I am looking forward to updating you
Sacha: once I get all of the stuff checked off my to-do list.
Prot: Very good. Let me know how it goes.
Sacha: Yeah, yeah, awesome. Thank you so much.
Prot: And for the live streams, we see how it goes. Yeah.
Prot: You will tell me. Yeah.
Sacha: And it's okay to post this recording if you want to?
Prot: Whatever you want. Whatever you want.
Sacha: Awesome, all right, see you around.
Prot: Take care, Sacha. Bye bye.