Categories: geek » emacs » yay-emacs

RSS - Atom - Subscribe via email

#YayEmacs 10: Emacs coaching with Prot: Emacs workflows and streaming

| emacs, yay-emacs

I realized that one of the mistakes I often make with Emacs is not asking other people for help, so I experimented with a coaching session with Prot. With his permission, here's a recording of our conversation.

View in the Internet Archive, watch/comment on YouTube, download the captions, or e-mail me your thoughts.

Chapters

  • 00:00 Intro
  • 00:50 Organizing my config into multiple modules and org-babel-post-tangle-hook
  • 04:45 Changing namespace, renaming functions
  • 07:11 Defining aliases for old functions
  • 08:30 Improving my streaming setup
  • 12:09 Keeping things from accidentally airing
  • 14:50 Livestreaming and recording
  • 15:09 Keeping track of interesting moments
  • 18:19 Editing
  • 20:26 Writing
  • 22:34 Packaging
  • 25:40 Responding to email
  • 29:21 Development workflow
  • 29:59 Testing
  • 33:46 Learning and reminders
  • 35:31 Encapsulating workflows into functions
  • 37:05 Popping up notes
  • 38:21 Rediscovering things in my config
  • 40:31 Catching up on Emacs developments
  • 41:29 diffs
  • 43:08 Thinking about the community
  • 44:00 org-link-preview
  • 45:31 Prioritizing things to work on
  • 46:39 Modelines
  • 48:50 Themes would be nice to have per-frame
  • 49:27 Livestreaming conversations with Prot
  • 50:11 Getting together
  • 54:44 Namespaces
  • 55:46 Verbose function names
  • 56:45 Naming conventions for ERT tests
  • 57:14 shorthands
  • 58:27 Bisecting config in multiple files
  • 58:46 "I don't write bugs."

Rough notes to clean up over the next little while

  • Meta: learning things
    • Don't try to remember too many things
    • Build a command that does those for you
    • Ex: preparing for videos, prot-streaming-mode
      • line numbers
      • disable spacious padding
    • long names: more chances to match it
    • new frame and then making it disappear: org-capture, timer; I can use that for notes
    • Tip: prefix keys are also helpful; for example, replace C-z, no one needs to suspend Emacs anyway defvar-keymap :prefix defines how it should be called as a command, which is good for handling updates to keymaps as well
  • Emacs Lisp development workflow
    • diff-buffer-with-file buffer-file-name - diff current buffer
    • Renaming a symbol
      • single file
        • substitute
          • also noting function aliases, obsolete
      • multiple files? -wgrep
        • keyboard macros from dired and substitute
    • Bisecting config in modules?
      • "I don't write bugs… Of course I'm kidding."
      • Ah, I can probably use bug-hunter with a setup file
    • Testing
      • I think I just need to get the hang of:
        • ERT, modus-themes-test–modus-themes-load-theme
        • nameless -> shorthands
        • Tip: Docstring as a declaration of intent; the docstring is the source of truth, not the code. If you write more than the minimum, then you are helping future you.
        • setting things up at the beginning (Makefiles, continuously running batch mode tests, etc.)
        • navigating to where I want to write the tests
        • mocking functions
  • Making more of my config reusable
    • "I implement the package that I want."
  • Workflows for writing, making videos, livestreaming
    • wide monitor is awesome
    • different font configuration with fontaine
    • private stuff:
      • private vertico
      • turning off preview for consult
      • keeping files organized
    • marking chapters and highlights: using his memory for this
    • just capture a timestamp and possibly a note
    • could also just do the offsets manually by saving the time
    • display line numbers to help people orient themselves and so they can mention it in the chat
    • writing: splitting it into modules helps
    • Ooh, idea, theme for streaming
  • Other stuff I forgot to mention
    • TODO: link preview - update my code for svgs
    • Emacs modeline? Smaller lighters, buffer name, view narrowed, read-only, keyboard macro;
      • streaming, microphone

Transcript

Transcript
  • 0:01: Intro: Sacha: Fantastic, this is great, I finally get to talk to you. I appreciate that you blogged so quickly about some of the things that I mentioned, and we can certainly dive right into that, or you have a lot more experience with how these conversations go, so I can let you take the lead.

    Prot: Since you put in the effort to write, we already have a very good structure. The idea is, let's have your screen, so 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. So if you hover over… Okay, yeah, you have it.

    Sacha: yeah oh you know if if at some point I should be really like 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.

  • 0:50: Organizing my config into multiple modules and org-babel-post-tangle-hook: Sacha: So I've been making good progress in splitting up my config into multiple modules. I just have to iron out a couple of things like do I actually have to load the autoloads from the user list directory or does it automatically take care of that? Because sometimes it doesn't seem like it's doing the thing. Anyway. It's making good progress. And in fact, I came across something that I'm not sure you know about yet, or maybe you know about it and you decided not to do it. I found out that, so, okay, so here's the context. You know, when you do your literate config, you have your modules and they're actually just one big file, like one big source block with a commentary and everything in it. Yeah, yeah. So I found out that you can use a hook if you want to, to add stuff to the tangled files afterwards. So the way I set it up with my config is I still want all the different functions scattered all over the place because I'm not yet as organized as you in terms of the modules. So the 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 it's what this does is when it tangles it it then goes back into the file and it inserts all that extra text and the 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 the section where it comes from but I also have all the extra lovely commentary and stuff so I'm like…

    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 guess if you really wanted to repeat things you could you could theoretically have the license just as a no web reference and then have it go in there automatically. anyway so I thought that was really cool so I'm making progress on the things that I had mentioned in the in the blog post about organizing my config into multiple modules and other yeah…

    Prot: And how far are you in that project? How far are you?

    Sacha: Let me see. I can look at the sacha.el here and I can do an occur on the files that have the lines that have the defun. I only have 482 defuns to get rid of. This is already a lot less than what I started with because like you, 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 know that people still rely on your published modules instead of actually, like, do people take your config? I know you've got stuff in the config that makes it possible for people to just load it and add their customizations on 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 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 package, but now I disabled it on purpose and I have my own macros, so that somebody doesn't just copy-paste. And I don't do this to be mean, but I do it because this way somebody will have to think about, like, okay, what is this? What am I doing here?

    Sacha: yeah I figure making making them still do that okay what am I doing here while still being able to automatically load all the function definitions will probably get them over that you know like make it a little bit easier for them so at least that way like right now it is difficult to copy things from my config like like you're so like okay maybe this is a feature but you know, maybe changing it will be nice.

  • 4:45: Changing namespace, renaming functions: Sacha: The other big thing that I need to do with my config is I'm thinking about shifting everything to the sacha- namespace instead of the my- namespace, which is going to be a lot of renaming, which is actually, it was actually the question that I had about renaming things, not necessarily coming up with clever names that have good acronyms like you do. And I love that the humor that you have in there, but like, like just mechanically, are we talking wgrep is like, is there a more modern, emacs 31 way to rename things? Am I just using erefactor or like replace-regexp? What do you do when you need to rename a symbol in possibly multiple files?

    Prot: If it's in multiple files, I do the grep approach. So it's not that sophisticated, but it works. Because the thing with the multiple files is, and it goes also to what you were telling me in that article, is first you organize, and then you refactor. It's that idea. The multiple files will not have a lot of extraneous information. You will not be matching, at least in theory, you will not be matching too 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. One of the ways I do it is just substitute the symbol at point. But of course, this is just a minor convenience. You can do that with a query-replace. I'm not saying that you really need the package. But the idea is that you do it and you know that it works. Like, for me… I know that it works in the file. So for me, that's very reliable. But the other thing I should mention is keyboard macros from dired combined with substitute. So you start from a dired buffer, and you go file by file. That's the general idea. And in each file, you will perform, for example, a search to the symbol. Once you are on the symbol, you do the substitute-replace command, and then you move to the next file. So that is the workflow. And I do that a lot, for example, with my themes, because they have a lot of repetitive code, like each theme.

  • 7:11: Defining aliases for old functions: Sacha: Okay, the other thing that I was thinking of as a workflow improvement here, because I'm sure that I'm going to keep calling them by their old names, especially interactively, like have a lot of commands that go off the meta x, my do this and this and this is I might also need to think about adding a function alias automatically. And one way I was thinking of doing that was just, you know, iterating over our array and bulk defining aliases so that all the sacha- stuff is now named my- stuff but I was wondering if that was a or actually also manually inserting the like well not of course manually but but creating forms for like defining the aliases somewhere but I was wondering if this was something that you already did as part of your workflow like do you when you rename things okay

    Prot: No, I haven't. When I rename things for my packages, I do use 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. Because I eventually use a similar name, 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 that's me oh okay okay I can

  • 8:30: Improving my streaming setup: Sacha: I can do my jitsi thing so I can see everyone and the screen at the same time the screen is very 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 B-frame things. And in fact, in the minutes before I called, I figured out how to use MasterChat CLI to get the YouTube live chat into a command line program, which means that it can be run from call-process or make-process or other such wonderful things. So now it's an Emacs buffer. And then I was thinking, okay, maybe I'll make a pause frame or like a B-framed like dedicated frame for it so that I can have the chat of a live stream displayed within Emacs because you know, it's Emacs. We should do that. Yeah, yeah, yeah.

    Prot: Nice. Yes, of course. And you can have it in a side window dedicated buffer.

    Sacha: Although I might actually have to write my own like Node.js program so that I can also send text from it, from Emacs. I think the masterchat CLI, it only displays, but the library that it uses, if you pass it your browser cookie, you can use it to send messages back to chat as well. The reason I had liked Twitch before was because Twitch had some kind of IRC type thing that you could connect to. And then that meant, of course, that you can use ERC from within Emacs in order to send stuff to it. Anyway, live streaming and chatting, I've also been getting into that lately. And I was going to pick your brain about this whole like workflow for making videos or live streaming them. And more importantly, going back afterwards and remembering to post them or edit it, in case you forgot something or whatever. So if you happen to have any tips or the things that you like about your setup, I would love to hear about that.

    Prot: Though in my case, the setup is really simple, and I admit that I could improve it. But it's really simple right now, where I have a wide monitor. So it's one display, I don't have two, but it's like 2500 pixels instead of 920. So I have a little sidebar on the side, and there on the sidebar I put OBS, for example, and I put everything I need there on the sidebar. And then I have enough space to have whatever it is I am displaying and maybe another widget on the side. So that is in terms of the physical layout of the monitor here. And then in terms of the Emacs side, I don't have a lot going on. I have one package to load the different font configuration. So when I do streaming or videos, I will load basically the presentation setup.

    Sacha: It is a spontaneous.

    Prot: That's Fontaine, exactly. But again, it's not a matter of the package. You could have a function that just changes the default phase, the height attribute.

    Sacha: I have this monitor and then laptop, so this is my workaround for not having enough space in this desk for a super wide monitor. My husband has a super wide monitor which I like to borrow during EmacsConf. Hello child who is wonderful and likes to 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 hop on the stream and talk about stuff.

  • 12:09: Keeping things from accidentally airing: Sacha: I know you've mentioned things like just starting Emacs with your Scratch buffer, but yeah, how about the interesting workflows for not accidentally spilling secret stuff online?

    Prot: Part of that is… so I use Vertico normally for my completions. I have some configurations for private Vertico, where by default, it doesn't display what Vertico normally displays. It's just a blank minibuffer, the way it is with the default Emacs minibuffer UI, right? But what happens is as soon as you do TAB or as soon as you move up and down, then it displays Vertico. So that, that is one way for me to make sure that I'm not showing anything I didn't want to show. The other thing is when I do videos, I don't use consult actually, even though I like it, because of the preview functionality. I don't want to be switching between files and then consult shows us something which is private. Right. So. So the private VertiCo, it's a small extension that I have with a few functions for Vertico.

    Sacha: I've been thinking about modifying the console preview states so that I can elide more, I can skip over things that might be private. And things like, I already have a filter function for marginalia so that it doesn't show me the values of variables that might be private. But yeah, just turning off all these things makes it a little bit easier to say, okay, I'm just going to jump on the live stream and do this thing. 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 with privacy is that you want to have a generally good sense of where you put your files. So for example, in my pictures folder, I know that I don't have anything private there. But there are some sub folders which are like personal. So I know not to go there. So it might happen, I need to show a picture, okay, I just go to the pictures folder, and I show it, no problem.

    Sacha: lines of keeping things organized is if I have a stream tag on a task, I know that's safe to show on screen. And then I modified my Org jump stuff. There's a hook that you can use to narrow things to just that subtree. So at least I can jump to it and not have to worry about the rest of the context in my inbox. Trying to slowly slowly get the hang of this

  • 14:50: Livestreaming and recording: Sacha: Okay. So it's live stream. Do you like to live stream and record at the same time locally or just live stream and then go into 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.

  • 15:09: Keeping track of interesting moments: Sacha: Do you have anything to keep track of interesting moments that you want to revisit, or do you just, I don't know, skip 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. So whenever I can practice something, I will do it like that. But otherwise, if you really need to take a note of something, you can always have a small function that just records the timestamp. Like, what is the current time? And then you know when you started, so you will know where you are in the video. Like, it would be a very simple function that simply prints 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. And that buffer is like your interesting moments kind of thing. And if you really want, you can make that prompt you for some text, like here is the timestamp and here is like, you know Prot said a joke or whatever, you know, like…

    Sacha: started from YouTube and then calculates the offset automatically, so that I can say okay, here are my chapters roughly.

    Prot: Yeah, that's even more fancy. Or you could do the other thing, which is all local, which is the moment the stream starts, you hit this command, like you invoke it, so it resets the time and then it performs the calculation locally. So you can do calculations with time in Emacs. So you can perform that as well.

    Sacha: Yeah, that's really straightforward. Okay, so that's definitely something that I'm going to want to think about, because video is great for enthusiasm and showing cool stuff that you might otherwise forget to mention, but it's just so slow to review afterwards.

    Prot: Yeah, of course, of course, of course. Just to say another thing with video, what I have found that is really helpful is to display line numbers.

    Sacha: Oh yeah? Huh.

    Prot: Me personally, I don't use line numbers, but I have found that when I am displaying something that others need to follow, line numbers help them. Because for example, 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, so I kind of know what you are doing, but somebody who is not really into it will be like, what is happening? 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 something, you can say, look, on line 100, 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 that. But sometimes it overwrites things. I'm like, OK. Today it is well-behaved, so I'm glad for that.

  • 18:19: Editing: Sacha: Making videos, all right. Just go ahead and make the videos, you just do it pretty straight, you don't do a lot of editing afterwards, I'm hearing, following the same kind of philosophy 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 whether the live stream demo that I just made of how I can highlight the PDF of your literate config and extract the stuff into whatever has a bug in it. And I'm like, oh, I just demonstrated that. It's okay, I can update it in the show notes. Oh, that's true, especially since

    Prot: Or even better, you do a second video afterwards, a follow up.

    Sacha: now I figured out that you can use org-pdfview view to link to pages in the PDF. So now my index.org has the highlights from your config, and it takes me back to the page that it was on. 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 you could use for that.

    Sacha: Yeah, probably. and then I just need to get… I think I've got PDF tools or PDF view set up. And then reader of course looks very interesting also. So I've got to tweak my config a little bit more to get it running because it has an external dependency. Anyway, so just got to do the live streaming. I was delighted. People have actually been dropping by and commenting or chatting during the live streams, which is great because I get to remember, 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, like getting used to talking to yourself, right? So, of course, that takes some practice, but I think, yeah, you have the hang of it already.

    Sacha: Something is ringing. Hang on, sorry. I forgot. That was just my reminder that the kiddo is back to school. Virtual school is fine. Anyways, OK, so so just got to do it.

  • 20:26: Writing: 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 include more bits and pieces from my config, and I'm sure that now that I have them in different files, it'll be easier for me to then write the post that links to, oh yeah, here's the five other functions you need in order to make this little snippet work. But do you happen to, knowing the kinds of stuff that we like to write about, do you have any other tips from your workflow?

    Prot: When it comes to sharing code like that, I already noticed while you were moving around that you have many things like my-consult, my-org, etc. What helps there is to just make those their own module right away. And from there, you know that, okay, this is either self-contained or it has an explicit require, so I can already know where I need to search for dependencies. So it's really that. It's because, for example, if you take just a my-consult function, right, of course, you know by the name that it depends on consult, but you don't know if it depends on my- common functions, for example. Right. Whereas if you have it in its own file, there will be a require at the top. So, you know, OK, require my-common-functions. And that way you can tell, okay, there is a dependency here. So then when you are to share this function, you can search for, okay, my-common-functions, is it mentioned here? Yes or no. And then you know what the dependency is.

    Sacha: And I think this process of moving things into those separate files will make it easier for then, for people to say, okay, yes, I do want to try that thing. Let me check out the repository required, just load-file that particular file and then be off to the races. So we'll see how it works. I don't know if people actually… Sometimes people mention borrowing stuff from my blog. So maybe people are actually reading the non-Emacs News posts. We'll get to see that.

  • 22:34: Packaging: Sacha: Sometimes I feel like a lot of my tweaks 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. And then it's difficult to say, OK, if I were going to generalize this for other people, what kind of defcustoms will I need? What kind of options? And there's always that trade-off between, yeah, but I just want to implement the next little thing that I want to make for myself versus, well, if I put in the polishing effort, then possibly other people could use it, and learn from it, and then contribute their own ideas, and then everything gets better without me having to do the work myself. So it's a bit of a balance.

    Prot: package that I want. So for example with denote, but this applies to everything, denote version 0.1 is the package that I wanted. So basically, it works for me. Ever since, I have been adding other things that people want, which are, of course, good things to have. They improve the package, but I have already been using the package that I want since the beginning. So ever since, it's just adding stuff and learning about how people use it and refining the code, which everybody benefits from. So whenever you have an idea that you are like, okay, this may be too idiosyncratic, don't worry about it. Make it into a package, and then what other people need will become apparent, and then over time it will change, but the core package is still what you want.

    Sacha: Although it is interesting to see, for example, with the university calendar, institution-calendar thing, it's like, okay, you can get it to work for a small number of institutions, ELPA wants… they want it to work for everyone, everywhere, all the time. Okay, that might be too general. You might need to actually have lots of other people saying what they need in order to make that happen in the first place, right?

    Prot: Which at that point, of course, what you want is to write the documentation. So for example, with the institution calendar, I wrote a couple of examples. Okay, how do you extend this? And yeah, I think that helps. But then of course, you cannot cover every use case like people have to also make contributions if they really care about.

    Sacha: Yeah, so I think at the moment, I've been writing for n equals one, the audience is really just me. And occasionally I hear from people who are like, oh, that's an interesting idea, let me adapt it. Sometimes if I'm really lucky, they will go and write their own package on top of the stuff that I shared, which is the ideal situation, because then I can just like, oh, yeah, I'm going to borrow that and use it. It'll have more features and they're in charge of dealing with that. But I suppose at some point it behooves me to practice. OK, I'm just going to write it as a package, pretending that this is something, as you said, this is something that I want to be able to install and use myself. Then if other people find it useful, it's a lot easier for them to experiment with and then add on to.

  • 25:40: Responding to email: Sacha: Which goes to my second thing. Doing this and making things open to other people probably means being more responsive to email. And this is, for me, this is a bit of a challenge. I'm starting to feel less time-starved, which is good. I'm starting to actually be able to schedule things. One of these days, we should probably see if we can schedule a Prot Asks thing. I don't know if I can do two hours, but maybe I can do one hour or whatever. Anyway, the rest of it involves actually doing

    Prot: For sure.

    Sacha: the responsible thing and responding to issues and emails and whatever. It's always a bit of a trade-off, like, oh, do I implement 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 the maintenance work I do is via email. Or email or Signal or Telegram. People will ask me, hey, Prat, what is this? And many of the issues are not with my package. I had an issue earlier with the modus themes, no, the ef-themes, and eventually it was something to do with the user's configuration of some function of center tabs. But I had to go into it and check. So, of course, there will be that. But I must say, it's not too bad. It's not a big issue. You can always have in your email, like, hey, please don't use this for issues. And it's not a replacement for that. Just use the issue tracker.

    Sacha: I know I just have to… I think I just have to like reframe my perspective. This is a gift. Other people are taking their time and effort to do this. It's wonderful that they're trying things out and putting their… actually doing things themselves and then reaching out in case… 'cause it would be nice to get things working on more people's computers. I think that the stuff that I've been building around learning languages and doing voice input into Emacs probably… There are a lot of these things already, but they tend to also be very individual workflows and individual setups. So it'll be interesting to get to the point where we can start to even have a conversation with shared code.

    Prot: About the individual workflow, again, it's not a problem because what is individual now will eventually become kind of a standard workflow. Think about org, the beginning of org. You have Carsten Dominik, who is like, you know what, this outline mode isn't enough. I need more stuff on top. And eventually we have Org. In the beginning, I imagine org was basically Carsten's org, and it became this uh this package that everybody can use however they feel like.

    Sacha: I used to maintain Planner Mode before Org Mode got super popular and I remember feeling very embarrassed when someone very, very kindly said "I appreciate the work that you do; incidentally, the latest update kind of deleted a lot of my notes." So this is like, when you make something that other people use, sometimes your mistakes will affect more people than just you. But I'm hoping now that now that the disks are in the spaces of terabytes instead of whatever, people are just backing up everything and version controlling everything and everything will be fine.

    Prot: Yeah, of course, of course. Writing packages, of course, is a responsibility. The upside, though, is that because you know that it is a responsibility, you try to write cleaner code at the outset. Whereas if it's just for your own configuration, you're like, okay, this will work and I will fix it later.

  • 29:21: Development workflow: Sacha: Yeah, and that actually brings me back to this Emacs Lisp development workflow thing. So I think one of the things that I just need to do is I just need to set up the Makefiles and the snippets and the shortcuts to say that if I'm starting a new proto-package, the thing to run the tests is there, and whatever it is that maybe even continuously runs the test when I make a change, and lets me mock up functions so that I can test some of the things that might be more interactive or might require deleting files or whatever. It's just changing my buffer configuration and whatever.
  • 29:59: Testing: Sacha: So I occasionally write ERT tests when I feel diligent. Sometimes I'm starting to write the test first and then write the code that makes a thing, but if you happen to have any parts of your workflow that you particularly like when it comes to testing things, I would love to hear about them because I haven't gotten to that part of your config yet

    Prot: Yeah, so I don't have a lot going on for that. So it's simply ERT. But what I do with the tests is really basic. So ERT, M-x ert, and then I pick the test that I want. And I must say that when it comes to tests, I can be better myself. So there are some packages I write where they have good tests, but there are others that have zero tests. So I want to reach a point where everything has tests, but it takes a lot of work.

    Sacha: Yeah. I mean, like every so often I feel like very, very diligent and I'm like, okay, let's do code coverage. So I can see things with undercover. Let's write a function and make sure there's a test associated with it. And let's write a keyboard shortcut that lets me jump from the thing to the test that's associated with it or to run it. And in fact, I still need to get embark to do all these things for me so I can be looking at a function and say just rerun the test for this, please.

    Prot: Just to say one low-tech feature that has helped me a lot, low-tech, Is i use the docstring as a declaration of intent. So in the docstring, I say what is the function or the variable meant to do, like what is it meant to provide. And then if I look at the code and I'm like, ah, this doesn't work, I know that the doc string is what I wanted. It's never the code. So there is this idea that the code is a source of truth. For me, it's the opposite. It's like the doc. It's the specification. And then the code is… I was wrong. I was sloppy. I wasn't paying attention. I missed something or whatever. And the reason for that is the following. It's because with the code, you may have used the symbol wrongly, or you may be calling something that you don't mean to call, or there is another function. Or, for example, you use mapc instead of mapcar, so you don't get the return value you expect, that sort of thing. So something, basically you don't deal with sloppy problems. So you don't have confusion there. You know that, okay, the source of truth is the docstring. This is my intention.

    Sacha: I should do that more often. Now that I've changed my yasnippet for inserting functions to automatically have the docstring, I feel a little guiltier when I delete the docstring, so I am compelled to instead fill it out. But if I specify it in more detail, as you do with it becoming the statement of intent, then I can be like, OK, let's try that. It's a good practice. 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 don't get the warnings, right, from checkdoc. But if you write more, then you are rewarded yourself. It's something that helps you, future you, and of course other users, because you always have to consider yourself as basically a user. I don't remember why I wrote this six months ago, so of course having the docstring there, actually spell it out, helps me.

  • 33:46: Learning and reminders: Sacha: I definitely have problems with working memory and long-term attention. Which actually touches on this other thing that I mentioned in my post, which is, in your experience coaching other people and also in your personal practice, what are you finding as good ways to keep reminding yourself, okay, these are the keyboard shortcuts I want to internalize, or this is the the workflow tweak that I wanted to try naturally. I was thinking, maybe I make an Org file or maybe I make a quick help thing or whatever. But it's always interesting to hear about other people's workflows.

    Prot: What I find most useful is to not try to memorize too many things, but whenever you are in the flow of, oh, this is a process that I want to be doing, to actually implement it as a command or whatever, as a package or whatever, like basically don't try to memorize the steps and of course the key bindings. Try to build a function that does those for you. A command basically that does those for you. So for example, to be concrete, I mentioned earlier that for video purposes, I will enable line numbers. And I will also enable the line highlight. And I have another thing where I disable spacious padding. So the package I have. And all this, of course, I know the key binding. So it's F7 and F8 and F6 or whatever, right? But I'm like, I cannot remember all that. I will just write a function, and it will be prot-streaming-mode. And I enable prot-streaming-mode, and it does what I want it to do, and then I disable prot-streaming-mode, and I'm back to where I need to be.

  • 35:31: Encapsulating workflows into functions: Sacha: Yeah, I have a prepare-for-screencast that does something similar, changes font size, etc, etc. Tt's so wonderful that in Emacs, you can

    Prot: Exactly.

    Sacha: just keep collapsing things into functions that do the thing that you wanted, and it has access to pretty much everything. I just need to remember to actually call the thing and remember what the thing was actually called. Aliases are very helpful, so it's orderless, but it's like…

    Prot: Another thing that might help is long names. Because with long names, you have more chances to match it. For example, in this case, it could be called prot-streaming-mode, but you could also call it prot-streaming-and-video-demonstrations-mode. And of course it sounds ridiculous, but if you think about it, I might search for, I do M-x and I search stream. I find it. I search video. I find it, right. I search demo. I find it. So, if you care about something, you can name it that way, and then you find it more easily. Or, of course, with aliases, you do the same, right? prot-streaming-mode, alias, prot-video-mode, alias, you know how it is. But, yeah, either of those would work. Basically, benefit from the fact that you have completion, and I imagine you also have orderless.

    Sacha: So definitely that. And then

    Prot: So, yeah.

    Sacha: for the free form notes thing, it just occurred to me.

  • 37:05: Popping up notes: Sacha: So in addition to your posframe stuff in your config for quickly popping up an Emacs posframe for some commands, like, do you have some things? I suppose I could just use that directly for my notes and for the chat. Do you have any other of those "quickly pop up something so that you can do something with it and then make 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, that's very useful. And for org-capture, but I haven't elaborated on it. Of course, I could do that more. Another that I… By the way, it's not a poframe. Technically, what I have is just a new frame. But the idea is the same, right? It pops up and it disappears. And I can share the code for that. 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 where it just extracts all the things that I've highlighted. It's very, very cool. It's in one of these, I'll grab it eventually. Which is good because I have to go over my config at some point.

  • 38:21: Rediscovering things in my config: Sacha: There's so much in there that I've completely forgotten writing about. And so I'm like reading this now as I'm splitting it into different modules and saying, oh yeah, I automated that. I'm doing it manually again.

    Prot: The other thing that might help is a prefix key. So I have done that with C-z. So it's a prefix key, and then either with which-key or with Embark, you know, the Embark… When Embark replaces C-h. I forget how it's called now. You can always see, OK, what do I have? Like, what are the groups? And then you can cluster things there. And it's very easy. Ever since defvar-keymap, ever since that became a thing, it's very easy to write prefix keymaps, because it has a keyword called prefix, and then with that prefix you define how the keymap should be called as a command.

    Sacha: That's interesting. I should definitely look into that. Finds how it should be called. That's a command. So you can just add it to other key maps as needed. That sounds cool.

    Prot: So consider this difference, like right now, you can take a defvar, which is a keymap, right? And you can bind it to a key, the keymap itself, without the quote, you can bind it to a key. So you will do define key in the global map, like whatever you want, and then bind it. What happens though with that is that you're binding the value of the keymap to the key, which means if you make changes to the keymap, your key doesn't know about them.

    Sacha: I've been running into that. I get annoyed and I have to keep re-evaluating my definitions. So yeah, okay, that's what I do.

    Prot: Whereas if you have the prefix, which is now a command, you have created an indirection. So now you define key to the symbol that you have specified. And that, of course, is that indirection, which now gets the up-to-date value of the keymap.

  • 40:31: Catching up on Emacs developments: Sacha: So this is Emacs stuff that I have been missing out on, because for the past 10 years I've just been squeezing things into whatever moments I can have before somebody comes and says hello and says mom mom mom mom, and now that I have a little bit more focus time, I'm looking forward to finding out about all the cool stuff that has gone into Emacs and that I'm not currently taking advantage of. So things like, for example, I only scratch the surface of using Lispy, and I want to do other things as expressions because it's all magical. And if you have similar, like, oh yeah, this is a new thing in Emacs 30 or 31 that is super helpful and not everyone knows about it, I'd love to know about it. I mean, I know it's on Emacs News, but sometimes I'm like, whoosh, it goes past my radar and I don't have the time to dig in.

    Prot: Yeah, right now I cannot think of something. But yeah, I will.

  • 41:29: diffs: Prot: Oh, a very small thing that helps me a lot when I make any kind of edit. You know, there is this function diff buffer 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. I don't want to diff a buffer with some random file. So what I have is a very small extension, a very small function, which is diff-buffer-buffer-file-name. So buffer-file-name is the variable for the current buffer's file. And then I do the buffer file name. And for me, that's very useful. Whenever I make an edit or I'm not sure what happened, I do that and I already see the diff. I use that a lot.

    Sacha: that I would love to to pick up as well. There's all sorts of interesting workflow things that I am looking forward to discovering as I figure out the better way to watch videos and then also make videos, because one of the things I find is whenever you demonstrate something, sometimes, if you're really lucky, someone will say, oh yeah do you know about this thing that does the whole thing, which is great. One of my favorite reasons for sharing things is learning from other people. All right. You write this really long blog

    Prot: Same. Like you put it out there and somebody will be like, hey, you could do it this way instead.

    Sacha: post about this clever thing that you just figured out and then five minutes later, oh yeah, that's been built into Org since, you know, version 9.7.

    Prot: Exactly, exactly.

  • 43:08: Thinking about the community: Sacha: Which actually leads me to: what can we do? We've got about 20, 15 minutes left in this hour. Taking advantage of your very large context window for all things Emacs community, you know, those kinds of stuff that we are interested in, what are some of the things that we could do to make things even better? This is a very open question, of course, but yeah.

    Prot: Even better, you mean Emacs in general or Org in particular? Because Org got a very nice feature lately, Org 9.8, which is the ability to preview images for any link type. So that's very useful. Before it was like the file type. Now it's any link type. And of course, if you ever want to do something with a custom link type, there you have it.

  • 44:00: org-link-preview: Sacha: Which is good because I, in fact, have an override for a custom link type where I had done it before. So I just basically copied and pasted the image preview link so that I could have my SVGs either included in it as a whole or just preview. Anyway, so yes, I'm going to switch over to the new one. Link preview, update my code for SVGs.

    Prot: Yeah, for example, now imagine this. Imagine you have a custom link type, which is called image or something, and you just give the image a name, nothing else. And internally, this link type knows to go in a specific directory and get the image from there, maybe even have copies of the image, so it can give you a copy that matches some parameter or whatever, like some user option maybe. You could have fancy things like this. I have been thinking about it, but I haven't written anything yet.

    Sacha: I would probably like… Things like my audio waveforms could go in there very easily and things like that. I'm very curious about this idea of mixing more things into other places in Emacs. And one of the things that I've been meaning to dig into is how LECDraw does SVG interaction, because it uses mouse events to be able to drag things around and whatever. Because I think if we can get richer interactivity and more graphical elements, that could be really fun.

  • 45:31: Prioritizing things to work on: Sacha: Anyway, but yes, so I've got basically three months of focus time before the kid goes on summer vacation and wants my attention at probably the majority of the day at an irregular interval. So it'll be a lot harder for me to schedule things then. I can set aside maybe 10 hours a week to work on Emacs-y things, including possibly working on infrastructure for the upcoming EmacsConf, or tweaking Emacs News or hosting meetups or whatever. Taking advantage of you as an external perspective, are there things that would be a good idea for me to particularly focus on? Things that you've been wishing you could say, Sacha, hey, just do this thing and it'll be awesome.

    Prot: I think you already have a very good setup, actually. So I don't think there is much to be done in terms of adding things. Maybe the work here is to be removing things, and that's the more difficult part.

    Sacha: No! Delegating things. Passing things to other people, maybe. Making it possible for other people to help.

  • 46:39: Modelines: Prot: There is a very small thing which maybe is useful, maybe it isn't. I don't know how much you use the mode line, how much you rely on that, but the newer version of Emacs makes it possible to shrink the lighters for the minor modes.
  • 46:52: Modelines: Sacha: Yeah, I don't use the mode-line as much. I ended up moving keycast to the header line because it's a little bit more visible in videos. Sometimes when closed captioning is on, it obscures the mode line. So I don't tend to look at the mode line for much, and I'm wondering what I'm missing out on. And I'll probably also want to add: am I streaming?

    Prot: Yeah, not much. Not much is the answer, but maybe you could declutter it in that regard so that then it is useful. For me, where it really is useful is to know some things such as, of course, what is the buffer name? Is the view narrowed? That's, for me, really important. Maybe is it a read-only file? And am I running a keyboard macro?

    Sacha: Is my microphone on?

    Prot: Yes. Good, good. You see, there are all sorts of good ideas. And you can think of those as just one character, right? And you can have that one character with a face, which has, for example, a background. So is my microphone on? That's a green background. Am I streaming? That's a red background or whatever. And you just see the colors there and you know everything is all right.

    Sacha: Although, actually, now that we're talking about it, I'm thinking maybe I should just revive websockets. So I made an obs-websocket.el thing before, and someone has… The benefits of making a package: someone has actually updated it to work with the new WebSocket protocols. I just have to get the whole thing set up again so I can communicate with OBS. I can use a different theme, most likely another Modus theme, when I'm streaming, so that it's a little bit more in my face: okay I'm looking at the correct colors, I am public.

    Prot: That's the other thing. Yeah, that's good. That's good.

  • 48:50: Themes would be nice to have per-frame: Prot: With themes, unfortunately, that's actually something I would like to have. We cannot have them per frame, which is strange because if you do set-face-attribute, you can specify a frame argument. But if you do something like custom-set-faces, you cannot.

    Sacha: I'm sure that once you start messing around with Emacs 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. Famous last words.

    Sacha: Yeah, yeah, yeah. That's really fun. Okay, so that gives me stuff to work on.

  • 49:27: Livestreaming conversations with Prot: Sacha: I brought up briefly the idea of possibly setting up some kind of streaming things because I think, for example, this conversation that we have… I have so far managed to not share anything that is too private, except for, of course, the time when the kid is like, hello, mom, I need your attention and I want to be on stream. She likes to make cameos. So we could share this, and we could potentially think about having these kinds of conversations as something that other people could join in on, because it causes more questions, it's more interesting, and it also gets stuff out there without me having to type the lessons learned. So is that maybe something we can consider doing, I don't know, once a month for the next three months?
  • 50:11: Getting together: Prot: For me, yes. Even more frequently than once a month. Whatever works for you. For me, it works. That's the point. And also not in the context of coaching or whatever, but generally as a collaboration, I'm totally okay with that. Basically, more events for the community. I'm all for it.

    Sacha: Yeah, because it is different. I very much had missed doing Emacs chats, and I'm so delighted that you've got Prot Asks. I'm looking forward to watching the one that you just released, because it's a community event, right? You get to know about interesting things about people. And there are a lot of things that come up through conversations that don't come up when you're just writing by yourself.

    Prot: Yes, yes, yes. It's really that. It's really that. And for me, it's also another thing, which is it's more inviting. Like, it's like you are telling people, hey, show up like you can participate. Actually, we are friendly. Like, here we are. You see us. I think that kind of encouragement helps.

    Sacha: So if you want to do, like, Emacs office hours on a regular basis, either something that you schedule in yours… Is it a YouTube thing where we can both schedule a live and then both have it, or not? 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 don't know. But in terms of intention, I'm all for it. So we can of course figure out the technicality.

    Sacha: You have the bigger channel.

    Prot: But I really don't know. 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. Or if you want me to set it up, then I can do that. And then we can figure out the platform details and the non-YouTube way for people to join… probably IRC. We've got all this lovely infrastructure for EmacsConf, which I dust off every month for meetups. So that's certainly something we can slide right in there too. Okay, so if we do it once a month, that just gives me three sessions of practice, but if we do it like twice a month or more, I am also okay with that. 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, people can join, and we can always have a topic and talk about it and take it from there. We could also do it. Now, I don't know whatever makes more sense, but we could do it on my channel. And then, of course, with a prominent link to your channel, or we can do it one on your channel, one on my channel or always on your channel. Me, I don't mind at all. Like me, I'm in for the fun.

    Sacha: We'll figure out the technical details and whatever off-stream. It could be interesting because then that gives people a friendly place to drop by and chat. And also because I know you're there and I'm there, it gets away from the talking to myself. When it's just me talking and then it's just like chat is silent, it just feels like I have this unfairly privileged position. So yeah, that's definitely something we're going to look into. We can structure that as one of these coaching thingies if I'm looking for excuses to use the Google Open Source Peer Bonus. I still haven't really made a justifiably good plan for it. So yes. Okay. Oh, this has been very helpful. I've got like all these tips. If you're okay with it, I am totally fine with posting this recording online. If you want, you can also post it. I think there's some kind of collab thing.

    Prot: Me, I don't have a recording. So you can do whatever you want. So it's really up to you. Me, I don't mind. The reason I don't have recordings of my meetings is because I really have this policy of, you know, it's private. Your name is never known. Nobody has seen this. That's the idea. Of course, in your case, you're making it public. So, of course, that's fine.

    Sacha: Yeah, my stance is always, well, I'm going to learn stuff, but A, I'm very forgetful, so I need to be able to search it and find it again. And B, other people can pick up stuff too. I might as well expand the learning and do the learning out loud. So all that is good. And then for next time, which will probably be in two weeks, or maybe earlier if I manage to get my act together,

  • 54:44: Namespaces: Sacha: I'd like to see if I can get my stuff properly split up into different modules that have the different namespace. I really think I'm going to end up shifting to the sacha- namespace instead of all the my- stuff. I used to use the my- namespace prefix so that people could copy and paste things more easily into their code. But now I'm like, well, if I put it in sacha-, then I'm not polluting their namespace 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 article I wrote in response to your blog post. It really helps to think about the names. Also, with what we said earlier about finding things like so don't try to be too terse, too economical with the names like make the most of it.

    Sacha: I'm using nameless anyway to hide the prefixes. Got to get the hang of using the keyboard shortcuts to insert things.

  • 55:46: Verbose function names: Sacha: Yeah, so I do like having very verbose function names and just practically full sentences in the thing. All that is very good. So that's my main thing. Aand then of course, getting into more ERT… I have this function that now that lets me try to jump to the test or the file that's related to this thing. So we'll see how it goes, especially as I move things into these different functions.

    Prot: Okay, okay I'm not sure how you are doing that, but if I were to implement something like that myself, what I do with the ERT tests, it's always the prefix of the ERT file and then the name of the original function, double dash and then the name of the original function. So, for example, let's say, modus-themes-tests, right? So then it's modus-themes-tests–modus-themes-load-theme, for example.

  • 56:45: Naming conventions for ERT tests: Sacha: Okay, so that's your naming convention.

    Prot: That's a convention. That's a convention, yes.

    Sacha: I should try that. I've just been basically naming things as function-name. And then I was, like, maybe I should be calling them function-name-test. Or in this case, you know, package.

    Prot: Just to add something to this, because you also named this, so the nameless user. So there is built into Emacs this thing called shorthands.

  • 57:14: shorthands: Sacha: Yeah, I read about that, but you did mention that some people have been going back and forth about whether it's worth using it or whether it confuses things more. I think just leaving the names as is and then just displaying it differently seems to be like an in-between step.

    Prot: So that's what shorthand does. The name is, for example, modus-themes-test. And shorthand, effectively, is a buffer local variable which takes the small prefix and maps it to the larger prefix. So modus-themes-test can be mtt, for example.

    Sacha: Okay. All right. So basically it's a more powerful nameless, more configurable, and it's built in. So I should check that out also.

    Prot: Yeah, you can check it. It's not configurable, like it doesn't give you too many options. But the point is that for this simple case, at least for the tests, I find it useful because I don't want to have like a railroad of a function name, right? So I just want to be looking at something that I can understand. And basically, the prefix of the test is just there for it to have a prefix. And then I know what the function I am testing is.

  • 58:27: Bisecting config in multiple files: Sacha: I had a quick question about the config. So you have, in addition to your modules, you also have… Your Emacs's configuration is also split up into multiple files. How do you bisect these things when you're tracking down the bug?
  • 58:46: "I don't write bugs.": Prot: I don't write bugs. No, no, no, of course, I'm kidding.

    Sacha: That's going to go in the quotes. Okay, I don't write bugs. I write a lot of bugs. That's going to go to the blog post. It's going to be very large. So you never have to use bug-hunter because you just don't write bugs in the first place. Bravo. Good for you.

    Prot: Why didn't people think about that? Now, of course, I'm kidding. So the way it works is that they are actually standalone packages. So there is a distinction, actually, in my configuration. So there are the modules, which is the configuration blocks, what would be done with. And then there are the libraries, which are actually packages, like I could just publish them right now. For example, for the mode line, there is prot-mode-line. That could be a package tomorrow, no problem. So if there is a bug there, I will go and deal with it the way I would deal with any package, like edebug, toggle-debug-on-error, whatever it is that I am doing. So there never is a scenario where the code is in all sorts of places, scattered across the file, and then, of course, it's very difficult to track it.

    Sacha: But for your config, if it's in multiple files and you need to bisect it… Bisecting can get you to this load-file over here, this require over here is where things break down, but then you have to… okay, I want to load everything above that point and then 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 this macro, which has a condition case in it. Of course, usePackage has the same, but with usePackage, you have to have everything as a package, whereas what I have here is even if it's not a package. So condition case, and basically if there is an error, it tells me where the error is, and then I can find it very easily. I have never had a scenario (of course I was joking, but actually I'm serious)… I've never had a scenario where I was confused as to what was happening. It was always very easy to find the error. If it's a bug… Yeah.

    Sacha: Errors are fairly straightforward because it complains about it, but when it runs but it just produces the wrong behavior eventually, then that's the annoying part that I've been using bug hunter for.

    Prot: The only scenario I think now that I had an issue like that was with the mode line, actually. Because with the mode line, if you give it like a wrong face or something, I don't remember, it will print like several messages for everything that changes on the mode line. So you will get like, well, invalid face, and there will be like, in square brackets, 100 times of this message. So That's the sort of thing that indeed is more tricky, but that was not because of my code. It was because of one small tweak that affects the mode line, and then it was about figuring out what the error is there, what's the bug there. But if you have the configuration split up in ways that are logical or thematic, if you want, whatever bug is always in one spot. It won't cut between files. So for example i have a module which is theme in the wider set but the theme also includes fonts. because fonts are, in Emacs terms, part of faces, themes deal with faces, that sort of thing. So whenever it's something related to appearance, I know that it's in the theme. It cannot be somewhere else because of how I have written it. Of course, depending on how you split things up, you will end up in a scenario where you have bugs that go across files. For example, a common one is where people will have, for example, evil mode, right? And then they will load everything, and then they will have a separate configuration module, which is for key bindings. And basically, that's a disaster, because whenever there is some problem, you don't know which key binding relates to which package, and you are always in a state that it's hard to predict. And basically, you have to do every key binding with eval after load, this package, this key binding kind of thing.

    Sacha: Oh, that's going to be fun. I do have a bunch of key bindings in my file, so I'll just have to see how that all gets organized.

    Prot: If you have them, organize them by package. Define them close to the context. Okay.

    Sacha: That's actually mostly what I've been doing, mostly because I think of it, I think of the key binding when I'm adding the package to my config, so it's right there. I just realized I could probably just copy the top of my config file with requires or whatever to a setup file, 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. What is the kind of bug that you have encountered? What kind of bugs are we talking about here?

    Sacha: Recently, in my shifting of everything to the new system, I also happened to realize that I had updated my Emacs and then stuff wasn't highlighting in the mini buffer. I eventually found out that it was because I needed to upgrade certain packages. But in the meantime, I was like, what do you mean? Okay, emacs -Q, sometimes it's working, sometimes it's not working. Okay, let's start narrowing it down. And that was fun. The other thing that I recently had to bisect was: I was exporting my really large config after having split things up into different modules. One of the lines was causing it to go into like a debugging thing, but it would not tell me what it actually debugged. You know, the backtrace would just not happen. So then I actually had to narrow to region and then export the specific sections of my file until I narrowed it down to, okay, my defvar custom link needs fixing. So I do this kind of bisection a lot. Ideally, whenever I can, I like to be able to just write an assertion so that Emacs can do the work of narrowing down when this happens but sometimes it's just, you know, you gotta pick your range and then execute the thing and see what happens. So I'm always looking for tools because I write a lot of bugs. I'm sure by the time I see you again, it may be either next week or next next week, I will have more bugs to share and more things to learn from. But this is very helpful and I am looking forward to updating you 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. 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.

Ideas for next steps

Oh, do I ever have a lot of ideas to follow up on. =) But I'm making myself get used to writing them down so that I can post these notes instead of trying to squeeze in just one more tweak… Anyway, plenty to explore!

  • Add chapters to video
  • Edit transcript - rough
  • combine multiple captions
  • Post the video
  • Post notes
  • Schedule next session and open it up
  • Try Internet Archive
  • Combine transcripts and use speaker tags; style the output
  • [-] Redact part of the video
    • Write about compile-media updates
    • Get my GPU working for ffmpeg
    • Get my GPU working for whisperx
    • Select the coordinates from Emacs
  • Streaming and video
    • Write about two-speaker workflow
    • Make sure vtime link type works with this player
    • Figure out a workflow for adding intros or wrap-ups
    • Display YouTube chat in Emacs
    • Find a command-line way to send text to the YouTube chat
    • Extract part of a video as a clip
    • Make a global minor mode for doing things publicly
      • Change theme
      • Turn on line numbers
      • Turn on keycast
      • Change agenda files and inbox
      • Save narration
      • Consider consult previews, marginalia
    • Make a todo link type that creates the TODO item and publishes a link to it when finished
    • Make public-ish Org files
    • Send a URL to the stream as QR and text chat
    • Send text to the stream
    • Calculate timestamp offsets into a recording
    • Quickly log times and notes to current task and stream log
    • Make a nicer combined transcript PDF for review
  • Reorganize my configuration
    • Finish extracting the rest of my functions
    • Rename my- to sacha-
    • Write about my org-babel-post-tangle-hook
    • Try out substitute, especially with the replace-regexp-as-diff idea
    • Define function aliases
    • Try shorthands
    • Try defvar-keymap :prefix
    • Practise using docstrings to declare intent
    • Convert my custom link preview code
    • Replace C-z
  • Testing
    • Set up a Makefile snippet for tests
    • Settle into a naming convention for tests
    • Practise mocking up functions in order to test things that are more interactive
    • Make code coverage more habitual
  • Finish reading Prot's config and process my notes
  • Set up crdt just in case
  • Play with the idea of XP (experience points) as a reward for postponing a task and then picking it up again
  • Write about deleting windows vertically; consider beframe and shortcuts to arrange frames
  • Pop up and dismiss my notes
    • Make my notes contextual

Want to join us on Thu April 16 10:30 AM America/Toronto, 5:30 PM Europe/Athens? Check out the livestream we've penciled in for April 16 - come join us!

View Org source for this post

#YayEmacs 9: Trimming/adding silences to get to a target; subed-record-sum-time

| audio, subed, yay-emacs, emacs, video

New in this video: subed-record-sum-time, #+PAD_LEFT and #+PAD_RIGHT

I like the constraints of a one-minute video, so I added a subed-record-sum-time command. That way, when I edit the video using Emacs, I can check how long the result will be. First, I split the subtitles, align it with the audio to fix the timestamps, and double check the times. Then I can skip my oopses. Sometimes WhisperX doesn't catch them, so I also look at waveforms and characters per second. I already talk quickly, so I'm not going to speed that up but I can trim the pauses in between phrases which is easy to do with waveforms. Sometimes, after reviewing a draft, I realize I need a little more time. If the original audio has some silence, I can just copy and paste it. If not, I can pad left or pad right to add some silence. I can try the flow of some sections and compile the video when I'm ready. Emacs can do almost anything. Yay Emacs!

You can watch this on YouTube, download the video, or download the audio.

Play by play:

  • I like the constraints of a one-minute video, so I added a subed-record-sum-time command. That way, when I edit the video using Emacs, I can check how long the result will be.
    • subed-record uses subtitles and directives in comments in a VTT subtitle file to edit audio and video. subed-record-sum-time calculates the resulting duration and displays it in the minibuffer.
  • First, I split the subtitles, align it with the audio to fix the timestamps, and double check the times.
    • I'm experimenting with an algorithmic way to combine the breaks from my script with the text from the transcript. subed-align calls the aeneas forced alignment tool to match up the text with the timestamps. I use subed-waveform-show-all to show all the waveforms.
  • Then I can skip my oopses.
    • Adding a NOTE #+SKIP comment before a subtitle makes subed-record-compile-video and subed-record-compile-flow skip that part of the audio.
  • Sometimes WhisperX doesn't catch them,
    • WhisperX sometimes doesn't transcribe my false starts if I repeat things quickly.
  • so I also look at waveforms
    • subed-waveform-show-all adds waveforms for all the subtitles. If I notice there's a pause or a repeated shape in the waveform, or if I listen and notice the repetition, I can confirm by middle-clicking on the waveform to sample part of it.
  • and characters per second.
    • Low characters per second is sometimes a sign that the timestamps are incorrect or there's a repetition that wasn't transcribed.
  • I already talk quickly, so I'm not going to speed that up
    • Also, I already sound like a chipmunk; mechanically speeding up my recording to fit in a certain time will make that worse =)
  • but I can trim the pauses in between phrases which is easy to do with waveforms.
    • left-click to set the start, right-click to set the stop. If I want to adjust the previous/next one at the same time, I would use shift-left-click or shift-right-click, but here I want to skip the gaps between phrases, so I adjust the current subtitle without making the previous/next one longer.
  • Sometimes, after reviewing a draft, I realize I need a little more time.
    • I can specify visuals like a video, animated GIF, or an image by adding a [[file:...]] link in the comment for a subtitle. That visual will be used until the next visual is specified in a comment on a different subtitle. subed-record-compile-video can automatically speed up video clips to fit in the time for the current audio segment, which is the set of subtitles before the next visual is defined. After I compile and review the video, sometimes I notice that something goes by too quickly.
  • If the original audio has some silence, I can just copy and paste it.
    • This can sometimes feel more natural than adding in complete silence.
  • If not, I can pad left or pad right to add some silence.
    • I added a new feature so that I could specify something like #+PAD_RIGHT: 1.5 in a comment to add 1.5 seconds of silence after the audio specified by that subtitle.
  • I can try the flow of some sections
    • I can select a region and then use M-x subed-record-compile-try-flow to play the audio or C-u M-x subed-record-compile-try-flow to play the audio+video for that region.
  • and compile the video when I'm ready.
    • subed-record-compile-video compiles the video to the file specified in #+OUTPUT: filename. ffmpeg is very arcane, so I'm glad I can simplify my use of it with Emacs Lisp.
  • Emacs can do almost anything. Yay Emacs!
    • Non-linear audio and video editing is actually pretty fun in a text editor, especially when I can just use M-x vundo to navigate my undo history.

Links:

Related:

View org source for this post

Yay Emacs 8: which-key-replacement-alist

Posted: - Modified: | yay-emacs, emacs

[2025-01-07 Tue]: I like the way Karthik's blog posts have play-by-plays for the videos (ex: Fringe Matters: Finding the Right Difference), so I've added an experimental play by play at the bottom of this post.

I wish I could memorize all these keyboard shortcuts in Emacs, but I just don't use some commands often enough to build the muscle memory for them, especially since I have so many context-sensitive shortcuts thanks to Embark. That's why which-key is great. It used to be a separate package, but it's now part of Emacs 30. You just have to turn on which-key mode, and then, if you hesitate in the middle of a keyboard shortcut, Emacs will show you what you can do. It turns out that you can customize this menu,so here are some tweaks I'm trying. First, I want to change which-key-sort-order to the one that sorts by description. This groups similar functions together. Then I want to change the labels using which-key-replacement-alist. Let's try it without the dashes between words. Now let's turn on multiple replacements and make things even simpler. I can even use Unicode to make it easier to spot certain commands. And of course there's an Elisp way to customize all of this. I want to see if these little tweaks can help me use Emacs better. If you use which-key, maybe you'll also want to customize your menu. Let me know what you figure out!

You can watch this on YouTube, download the video, or download the audio.

Things I'm trying:

(with-eval-after-load 'which-key
  (setopt which-key-allow-multiple-replacements t
        which-key-sort-order 'which-key-description-order
        which-key-replacement-alist
        (seq-map
         (lambda (rep)
           `((nil . ,(elt rep 0))
             . (nil . ,(elt rep 1))))
         '(("my-subed-set-timestamp-to-mpv-position" "set to MPV")
           ("my-embark-org-copy-exported-url" "⭐🗐🔗 copy exported URL")
           ("my-subed-copy-timestamp-dwim" "copy")
           ("my-sketch-insert-file-as-link" "insert")
           ("my-geeqie-view" "geeqie")
           ("my-journal-edit" "edit")
           ("my-org-link-qr" "qr")
           ("my-image-open-in-" "")
           ("org-babel-" "ob-")
           ("next" "🠆")
           ("previous" "🠄")
           ("my-image-" "")
           ("my-embark-org-blog-" "")
           ("embark-collect" "⇶ collect")
           ("my-embark-org-" "")
           ("my-" "")
           ("embark-" "")
           ("embark-act-all" "all")
           ("embark-become" "become")
           ("embark-collect" "collect")
           ("-" " ")))))

To use which-key as part of Embark, see the Embark wiki's suggested configuration.

Play by play for the video:

  • I wish I could memorize all these keyboard shortcuts in Emacs, but I just don't use some commands often enough to build the muscle memory for them, especially since I have so many context-sensitive shortcuts thanks to Embark.
    • Showing the Embark context menu with C-. (embark-act) and then cycling through them with C-. (embark-cycle). In this case, I showed the Embark menus for a link, so it cycled through embark-url-map, embark-org-link-map, embark-identifier-map, and embark-expression-map. The active keymap and the value that will be passed as the first argument to functions is displayed in the echo area (ex: Act on identifier 'Embark').
  • That's why which-key is great. It used to be a separate package, but it's now part of Emacs 30. You just have to turn on which-key mode,
    • M-x customize-variable which-key-mode - toggle it on and save it.
  • and then, if you hesitate in the middle of a keyboard shortcut, Emacs will show you what you can do.
    • Here I started with C-c and then paused. Emacs displays the keyboard shortcuts that follow C-c.
  • It turns out that you can customize this menu,so here are some tweaks I'm trying. First, I want to change which-key-sort-order to the one that sorts by description.
    • M-x customize-variable which-key-sort-order, change it to which-key-description-order, and save.
  • This groups similar functions together.
    • The which-key screen now shows the embark- functions grouped together, the org- functions grouped together, etc.
  • Then I want to change the labels using which-key-replacement-alist. Let's try it without the dashes between words.
    • M-x customize-variable which-key-replacement-alist. I used INS to add a new entry. I clicked the first Value Menu to change it to nil, set the next value's regexp to "-", clicked the first Value Menu in the second cons cell to change it to nil, and set the next value's string to " ". The which-key menu now replaces most dashes with spaces, making things a little neater to look at.
  • Now let's turn on multiple replacements and make things even simpler.
    • M-x customize-variable which-key-allow-multiple-replacements, toggle it on, and save it.
    • I also added a bunch of other replacements, like removing the "embark " and "org " prefixes.
  • I can even use Unicode to make it easier to spot certain commands.
    • I added a replacement with some Unicode to make "⭐🗐🔗 copy exported URL" stand out in the menu.
  • And of course there's an Elisp way to customize all of this.
    • I showed the code snippet above.
  • I want to see if these little tweaks can help me use Emacs better. If you use which-key, maybe you'll also want to customize your menu. Let me know what you figure out!
    • We end with the screenshot of the which-key menu.
View org source for this post

Yay Emacs 7: Using word timing in caption editing with subed-word-data

Posted: - Modified: | yay-emacs, subed

When I work with video captions, I often want to split long captions using subed-split-subtitle. If my player is somewhere in the current subtitle, it'll use that timestamp. If not, it'll make a reasonable guess based on character position.

I can use subed-word-data.el to load word-level times from WhisperX JSON or from Youtube SRV2 files. This allows me to split a subtitle using the timestamp for that word.

Because subed-word-data colours words based on transcription confidence, I can see where something might need to be closely examined, like when there's no timing information for the words at the start or end.

If I combine that with subed-waveform, I can see silences. Then I can tweak start times by shift-left-clicking on the waveform. This automatically adjusts the end time of the previous subtitle too.

I like how Emacs makes it easy to use word timing data when editing captions. Yay Emacs!

You can watch this on YouTube, download the video, or download the audio.

Note: Sometimes WhisperX gives me overlapping timestamps for captions, so I use M-x subed-align to get the aeneas forced alignment tool to give me subtitle-level timestamps. Then I use the word-level data from WhisperX for further splitting.

Links:

Aside: I was trying to find some kind of value-to-color translator for Emacs Lisp for easier visualization, like the way the d3 Javascript library makes it easy to translate a range of numbers (say, linear 0.0 to 1.0) to colors (ex: red-yellow-green). I found color-hsl-to-rgb and also the range of colours defined by the faces calendar-scale-1 to calendar-scale-10. There's also prism, which colours code by depth and allows people to specify the colour transformations (saturation, lightness, etc.). I wonder if someone's already written a general-purpose data-to-fg/bg-color Elisp library that supports numerical and categorical data…

View org source for this post

Yay Emacs 6: Inserting links with consult-omni

| yay-emacs, emacs

I want to quickly look up and add links. consult-omni lets me search within Emacs instead of switching to a web interface. After I set up consult-omni-google with a Google custom search engine and a JSON API key, I can call it with my shortcut: M-g w. Using M-n for future history pulls in the word at point. Then I can select a site and use Embark to insert with C-. i or copy with C-. w.

My config: https://sachachua.com/dotemacs#consult-omni

You can watch this on YouTube, download the video, or download the audio.

View org source for this post

Yay Emacs 5: Tweaking my video workflow with WhisperX and subed-record

| speechtotext, emacs, subed, yay-emacs

I'm tweaking my video workflow. I use Orgzly Revived on my Android phone to write the text, and I use Easy Voice Recorder to record it. Syncthing automatically copies both to my laptop. I use WhisperX to transcribe my recording, and I use a little bit of Emacs Lisp to figure out timestamps for each word. I edit this to fix errors. I can even rearrange things and get rid of umms or ahs or anything I don't want.Then I use subed-convert to turn it into a VTT file. I can tweak the start and end times by looking at the waveforms. Then I add comments with the visuals I want. I can add images, animated GIFs, or videos, and they're automatically squeezed or stretched to fit. I can also have them play at original speed. Then I set up open captions and use subed-record-compile-video. Tada!

Links:

You can watch this on YouTube, download the video, or download the audio.

View org source for this post

Yay Emacs 4: community plumbing, streaming setup, Emacs News highlights, transcript export

| yay-emacs, emacs

Note: I kept saying cl-flet, but it's actually cl-letf, which is the one that lets you affect functions that are called by the function you're calling. =)

Next livestream will be at [2024-02-11 Sun 07:30] EST: https://yayemacs.com.

  • 0:07: Overview: Hello and thank you for joining me for another episode of Yay Emacs. I'm Sacha Chua and today is February 4, 2024. I'm going to use this as an opportunity to brain dump an upcoming lightning talk for LibrePlanet. I want to talk about community plumbing. If there's time, I'd like to share some of the little snippets that I've added to my Emacs configuration this week. Okay, so community plumbing.

Community plumbing

  • Emacs:
  • Other projects:
  • Sources:
  • 0:34: Community plumbing: I wanted to put together a lightning talk for LibrePlanet, which happens to have the theme of building communities. I'm really interested in the kinds of communities that people build around the things that they care about,: Emacs for me, but also lots of other free software projects out there that people build their communities around. Not just, of course, geek stuff, but also even interest-based things. I want to show people that it doesn't take a lot of effort to do the community plumbing that helps information flow better. Anybody could do it. You could do it too. I want to see if I can make a 5-minute talk that shows what we do with Emacs and encourages people to go try this out for their own communities. If you think about the flow of ideas in a community, there are little things you can do to help things flow better. You don't have to be an expert in order to do them. You don't have to be someone who's really famous in the community, or advanced in their usage, or whatever else. You can just do little things to help make those ideas flow better. If we're going to use this analogy of pipes and flowing, you don't even have to fill the pipes yourself. You don't have to be the one coming up with interesting content regularly or whatever you want to think of it as, you can just help share what's already out there. So I want to share some of the things that we're doing in the Emacs community to help things flow better. I want to convince people (you, specifically, if that's possible!) that doing this kind of community plumbing is fun, it's easy, and it actually has a great effect on making things better. This is fantastic because if you can help things flow better, then that enthusiasm spreads. When people connect with other people who are fascinated by the same things, they can bounce ideas off each other and share what they're working on. All of that is goodness.
  • 2:45: Blog aggregators: In the Emacs community, it actually mostly started with having a blog aggregator. Most blogs will have some kind of RSS feed that lets people subscribe for updates. With a tool like Planet Venus, which is a blog aggregator, you can collect the updates from lots of different blogs in one place to make it easier for people to just scroll through that and see what's new. For us, it's Planet Emacs Life, which is actually the second incarnation of this. It used to be planet.emacsen.org on Tess O'Connor's server, but then that server died and was hard to restore. Anyway, we're back up now on planet.emacslife.com. And this is pretty much automated. I just do a little bit of updating every so often when people say, oh, I have this new blog, lere's my RSS feed. I put it in the configuration file. And then, every hour, that the program just goes and fetches the new updates from all the blogs, giving people one place to go, which is great because it saves people time. They don't have to go to all these different blog posts themselves. So that's fantastic. Blog aggregator: if your community doesn't have one yet, it's very easy to set up and it's very convenient.
  • 4:02: Social media: Of course, there are lots of other things that aren't put on blogs. People post videos on YouTube and PeerTube and other places. They might have posts on Reddit or Hacker News or Lobsters. They might have toots on Mastodon. There are lots of other places where people share things. So if you have a way to go to these places and just keep an eye out for interesting news in those areas, then you can start collecting that as well and help those ideas flow better.
  • 4:32: Newsletter: We have a weekly newsletter which I put together. It really just takes me an hour or two each week to go through this, you know, these updates from Reddit and from Planet Emacs Life and all those other things and select the ones that I want to include. I like putting them into categories, which I think it actually takes takes me the most time, because then I like to read things to get a sense of what they're about, and then I get distracted by all the cool Emacs snippets that I want to put in my configuration. It's a newsletter. Doesn't have to take a lot of time, and it doesn't have to be very fancy. I find that I still don't have the time to write a lot of commentary for it, so my newsletter is really just a categorized list of links and that seems to be all right. It's useful enough for people to subscribe to it and share it with other people and so on.
  • 5:21: User groups: Among the things that I include in this newsletter are upcoming events from different user groups. People sometimes like to meet each other, both online and in person, and talk about the things they're interested in, which is fantastic. Many of these user groups have some kind of calendar that I can subscribe to, to get the event updates. If your community has something like this as well, see if you can use that to automate the updates that might go into your newsletter. Some of them don't have a calendar, but they'll tell me about the regular meetings. Then I can create an entry in my own calendar and incorporate that into the newsletter. I used to check all of these posts manually, but I've since then built a little bit of infrastructure so that all of these things can be included in the Emacs calendar. Then I can use the iCal from that to put them in the newsletter so that I don't have to do the timezone conversions myself.
  • 6:23: Conference: Of course, an extension of the user group idea is to have some kind of conference. It turns out to be fairly inexpensive to organize your own conference for something. So for example, with EmacsConf, we get about maybe 200 people watching it live, and the whole thing can be done on less than $50 US of hosting costs. A whole load of awesome speakers, We get to two tracks, and lots and lots of talks. There are volunteers who come and help with the captioning the talks beforehand, so that's a nice bonus as well because the text makes it easier to search and skim through afterwards. Conferences are a great way to get people who are passionate about something to come together and connect and have those conversations. Then those videos become things that inspire people throughout the rest of the year. So there, just all these very, very small things that can be put together to keep the ideas flowing in a community.
  • 7:26: Pieces working together: The amazing thing about that is that the pieces help each other. For example, I mentioned how the blog aggregator can help with a newsletter, because it gives you stuff to put in the newsletter. It makes it easy to just go through the list. I actually have the RSS feed automatically included in my newsletter, and then I can just categorize it from there, so I'm not even copying the links manually. So you've got a blog aggregator feeding the newsletter. People start looking at the newsletter and writing blog posts about the interesting things that they come across because of the newsletter. Likewise, I've seen a lot of the user groups start to refer to the newsletter as a way to fill in any extra time, so it makes it easier for people who might otherwise be a little nervous about standing there by themselves or with a few other people… There's a lot of dead space and silence because nobody knows what to talk about. Now they can just pull up the newsletter and go through it and see what spikes people's interest. Then all of that again inspires people, brings people together, and turns into ideas for conference talks and so on. This is an example of how a little bit of community plumbing helps ideas go around faster. It helps ideas circulate. I think that this is something that lots of people can do in their own communities, even if you don't feel like an expert, you don't feel like you have much to add, even if you don't feel like you have much time. I have very little computer time. This is basically it. I have maybe 5 minutes here, 10 minutes there. I can scroll through Reddit on my phone and upvote the posts that I want to include in my next newsletter. I can look on Mastodon for toots that I want to share to my Orgzly so that I can take notes and then include that in the newsletter. This is something you can do with very little time.
  • 9:25: Fun: It is a lot of fun. One of the things I really look forward to every week is being able to see, in the process of making Emacs News, all the cool stuff that people have come up with. It's something that's personally very useful for me, and it happens to be useful for other people. That's a nice bonus, but really I'm getting a lot of selfish benefits out of it. I think that if you put together a newsletter for the stuff that you're interested in, then you'll also get a lot of benefits out of that too. So, it'll be fun.
  • 9:55: Building processes and tools: Building processes and tools is a great help, of course, to make it easier for you. Instead of copying things manually, maybe you can automatically get a list of things. Then you can just delete the ones that you don't like. A little bit of automation. Doesn't have to be built all at once. You can do a little bit and then try it out, add more to your newsletter. For example, I've got this section on new packages. I am definitely not keeping track of that by hand. I just have a bit of code that gets all the packages from all the archives and then compares it with a list that it saved last week. So as you get into figuring out what you want your community plumbing to look like, you can build the tools to make it easier for you to do this and to save time so you don't have to do the tedious stuff. You can focus on the fun stuff instead.
  • 10:50: Let people help: The last tip that I want to share in terms of community plumbing is that once you get the ball rolling, sometimes people want to help out. They'll send you interesting links that you can include. In the case of emacs-devel, the mailing list is too hard for me to follow because they're talking about all sorts of things, there's a lot of volume, and I'm just scrolling through things on my phone. But people like Andres Ramirez send me notes on the different threads that have been going on, so that becomes something that can quickly include. People are out there who can help. Might not get things started on their own or might want to just contribute to something that already exists, but once it's out there, then they can come and contribute to it. So it's community plumbing: very easy to do, doesn't take a lot of work, can be a lot of fun, and there are little pieces that you can build that get things flowing faster. Blog aggregator, newsletter, calendars, little things that you can do to help people find stuff. In the show notes I have a list of links to the stuff that we have for the Emacs community such as the blog aggregator, planet.emacslige.com, the Emacs News newsletter, different searches that I like to use to find stuff on YouTube and Reddit and Hacker News and all these other places. Mastodon, there's a lovely little Emacs focused instance [emacs.ch]. People also talk about all sorts of other things, but there's actually like an Emacs instance for Mastodon, which makes it easy to bump into other people. So I think that's awesome too. Emacs News file, different package archives, the emacs-devel mailing list, the [EmacsWiki:]Usergroups page. I actually keep this up to date with upcoming events too. It makes it easy for people to see what's coming up. EmacsConf.org.
  • 12:45: Other projects: In addition to the Emacs stuff, I also have links to other projects, planets, and newsletters, so that you can get an idea of how other people do things. I think it's fantastic that there's such a wide range. A lot of the planets use Planet Venus as well–the same aggregator that we're using. It's pretty old. Hasn't been updated in like more than a decade. But some of them use more recent tools. Newsletters, there are a whole bunch. There are some that are weekly, there are some that are monthly, some with a lot of analysis, and some that are just also a list of links. You can check that out for ideas. Linux Weekly News has a calendar that they keep of conferences, so that's another way to check out what other people are doing conference-wise. And of course, there are lots of user groups. So, if you're involved in some kind of interest community, please consider doing some of that community plumbing because it makes it easy to discover interesting things and connect people to each other. It doesn't take a lot of work, it doesn't take a lot of expertise, and it is a lot of fun. So that's my quick brain dump. I'm going to find a way of condensing the 15 minutes of that brain dump into a five-minute talk.

Other little Emacs tweaks

  • 14:02: Using Yay Emacs for braindumps: One of the things that I want to do with this time for Yay Emacs is start to take some of these sketches and ideas, and flesh out the words around them. Speech recognition is really surprisingly awesome at turning that kind of a brain dump into words that I can then edit. As I mentioned, I don't have a lot of computer time, so I am going to use this to do the writing and the thinking and all of that stuff out loud. Other things I wanted to include here, just in case I have time before the kiddo wakes up, are little things that I tweaked in my Emacs configuration this week.

wdiff: word diff

  • wdiff - word diff
  • https://www.gnu.org/software/wdiff/
  • 14:45: wdiff TODO: So, word diffs. I actually had, for a little time now… When I edit the captions for Emacs Conf docs, sometimes I want to compare them with a script. I added a little thing to subed, which is a major mode for editing subtitles, for using the word diff, wdiff command line tool. It turned out to be super useful, and I wanted to keep using it for other things as well. So normal diff will show you the difference between a file or your buffer in terms of lines. Let's do that with some lorem ipsum text here. So let's say that, yeah, this text here. And I can M-x diff-buffer with-file. Oops, where am I? Diff-buffer-with-file. If we look at this here, it will show you the lines that have changed in green with a plus on them. M-x diff-buffer-with-file will compare your unsaved buffer with a file that's on your hard disk or SSD or whatever–whatever has been saved. But it works with lines. So here, for example, you've got that line over there. If you have another line, you can save that. If I make a change here– let's say, for example, if I put a hello world here– diff-buffer-with-file will show me that the entire line has been removed and the entire line has been changed. There's a little bit of highlighting to show me which words have specifically changed, but it's a little harder to tell. So I have this my-wdiff-buffer-with-file function. What it does is: it shows me that diff, and it just highlights the specific part that has changed. What the wdiff command line tool does is it takes the diff output and then it refines it to show just the words that have changed, and then you can highlight that specifically. Now, how does this work? Here's a little bit of Elisp wrapping around a shell command. So I've got here a my-wdiff function that takes an old file and a new file. The interactive call asks for the file name so I can compare two different files if I wanted to. All it does is it calls the process wdiff. It's a command line tool you can install. It's the one that does all the hard work of figuring out the actual words that have changed. Then a little bit of font-locking or highlighting it with different colors: going to the beginning of the buffer output and then looking for that regular expression to look for where the additions or deletions have occurred, and adding either the diff-removed or the diff-added face. So if there are command line tools that have some kind of useful output, and you want to color them differently in Emacs, it's fairly easy to write an Emacs Lisp function that will do that for you. I think that there's probably a package out there that does this kind of talking for wdiff and calls it and everything, but it's super short and I can just… It's easy enough to just write the function instead of looking through the packages. Anyhow, so that's wdiff. It's really helpful for prose because if you're writing lots of words, sometimes, it doesn't make sense to do them as separate lines. In fact, when I do transcripts, when I'm looking at word differences for transcripts, I have it squish everything on one line so that I don't have to worry about any white space changes. So wdiff, useful thing.

Touch gestures

  • touch - touch-screen
  • https://kitchingroup.cheme.cmu.edu/blog/2014/08/31/Using-Mac-gestures-in-Emacs/
  • 18:52: Touch gestures: Another interesting thing that I found out this week was that actually my laptop's touchscreen works with multi-touch gestures. This is the first time I've gotten around to trying it out. So I can two-finger-scroll and it does the scrolling thing. I can do a pinch to zoom. Let's see if it works. Oh, I have to make sure I'm in the right area here. Whoops, okay, so yes, it does do it eventually, when it kicks in. Let me see if I can zoom back. Yeah, so that's me like using my pinch gestures to mess around with that, which is slightly less useful. I wanted to share a snippet that I've borrowed from somebody else's configuration. John Kitchin shared these using Mac gestures in Emacs. In this post, he shared that you can use this to slow down the swipe: to set up swiping so I can swipe left and swipe right to go to the previous and next buffer, but to slow it down enough so that it's useful instead of just go whooshing through all these buffers. So if I swipe very carefully, I can just use two-finger swiping left and swiping right in order to make that change, which now makes me think, okay, how do I play around with this?

Thinking about strokes

Might look into strokes.

  • 20:30: Thinking about strokes: There's a strokes package. So strokes lets you control Emacs using mouse strokes. My laptop comes with a stylus, which I've been using to split words in transcripts because I like my captions to be a certain length. When I'm doing subtitles, I like to split them at about 60 characters if we're displaying them on screen and maybe a little less than that if we're displaying them in the regular video player on a webpage versus broadcasting it in EmacsConf. I use a stylus a lot during that part because it's easy to just tap on the word that I want to split at. Now that I'm playing around with touch more, I'm very curious about whether I can use the strokes package to do the pile sorting idea that I mentioned previously on one of these Emacs live streams. So, pile-sorting or card-sorting is when you take a pile of things and you sort them roughly into piles. You might say, okay, this stuff goes over here, that stuff goes over there. I'm thinking this might be an interesting way to think about sorting my inbox, because I don't necessarily want to go through all the steps of refiling something. Refiling takes a little while on my computer, even with a subset of refiling targets that I've been playing around with. But if I can sort them into piles, I can say, okay, this pile will eventually get refiled into this project, and this pile will eventually get refiled into this other place, and so forth. So, if I can make, like, 1, 2, 3, 4, 5, 6, 7, 8 piles, then maybe I could use this swiping or stroke idea, mouse gestures, to just fling something into the appropriate pile, whether it's northwest or north or northeast or south or all those other cardinal directions. That might be a future thing to play around with. I don't usually use the mouse when I'm using Emacs, but it might be fun to do that. It might also be fun to think about it using touchscreens as well. Can I swipe left and swipe right to do something interesting with org subtrees? We'll see. So that's what I've got for that section.

Yay Emacs streaming setup

  • 23:12: Yay Emacs streaming setup: Last little bit of thing that I can probably squeeze in before the kiddo wakes up. Someone was curious about my Yay Emacs streaming setup. it's basically this. This is my current setup, where I've got this external monitor, which is now the one I'm actually sharing so that it's higher res than the kind of really tiny monitor that I… Well, not really tiny, but the X230T is a small computer, so resolution is 720p when I'm streaming, At least this one will get us a bit bigger. The actual computer that's running everything is the X230T because it's very comfortable. I like it. It's already all set up and everything. Since it doesn't have the horsepower to do OBS streaming itself, I am using Video Ninja to share it to the Surface Book. The Surface Book is the one that uses OBS to then send everything to YouTube. There's a Blue Yeti over there that's plugged into the Surface Book. There's a webcam that's plugged into the Surface Book, so that allows me to start doing hand gestures. There's a light, and all that stuff. So I mentioned I don't have a lot of computer time. The kiddo gets screen envy. If I'm on a screen, she's gotta be on a screen too, so it's hard for me to squeeze in screen time, like programming time during the day, because then she's like, "I want to keep watching YouTube videos." Which is okay when I need to bribe her with screen time, but I shouldn't let her do it for too long because then I feel guilty as a parent. Drawing, on the other hand, I can get away, with because she doesn't get too envious about that. When I'm waiting for her or when I'm walking around or doing chores or whatever, else, I can use Google Recorder to do brain dumps. I can use speech recognition, usually through the Deepgram API, so I can use OpenAI Whisper without overloading my computer. All that stuff goes into Org Mode in Emacs, where I prepare notes and turn the transcript into something more coherent. It goes into the Eleventy static site Generator. It goes out to my website. Lately I've slowly figured out the workflow for converting the YouTube videos into our own WebM archive things, and then doing the speech recognition in that one, and posting that up on the web. So now, for example, for the show notes for last week, it's synchronized to the transcript timestamps and everything. Little steps forward. Next steps, I'm getting better at not doing the, "OK, are we live? Is this on?" that sort of thing; the trust that when it says it's live, it's live. I decided to move my posts out of the stream notes so that they're just on my blog, and then there's a link to the stream notes so people can go find the previous episodes. Working on smoothening that WebM conversion so that I don't have to think about it, it just happens. Timestamp synchronization happened, hooray. The next step is I want to be able to extract the media files, turn them into podcast enclosures, and set up the iTunes channel information and all of that stuff so people can also listen to it as just a podcast. I'll try my best to remember that sometimes people will not be able to see what's on my screen. That's another thing that people have wanted me to explain, so that's there.

More about piles

  • 26:58: Piles and e-mail: Charlie mentions that the pile thing sounds like the stack method of getting through email, which I would love to hear more about. I will go look that up later. My current approach to getting through email is that I don't. But that's okay because I'm just trying to keep my life low-commitments. Again, not much computer time. I'd rather spend it coding or writing than responding to emails sometimes. I'll accept that most of my email replies will be top-posted and done from my phone. But stack method sounds very interesting and generally… Pile sorting in general is very useful in real life when you're trying to go through a lot of stuff. I'm trying to look for ways to make that happen on the computer as well.

Emacs News highlights

  • 28:03: Looking at Emacs News: So, great. Now I get to do the thing which I just talked about, which is I haven't actually had a lot of time to code today. Well, code this week. So, code wise, I don't have fascinating blog posts to show but there's always the Emacs News to go over and share the interesting things that people have been sharing over this past week, so I can point you to other other cool stuff. Feel free to ask questions in the chat so I can go back to any previous topic or bring up more detail. I don't know. So in last week's Emacs news, we had a bunch of things in different categories. For Emacs configuration, it was interesting to see two posts on digging into Emacs performance or problems with Emacs configuration. There's "Why is my Emacs slow?" And there's "Debugging Emacs", kind of just trying to find the problem points. The profiler is very helpful for finding slowness. Bisecting your Emacs configuration can help with finding errors and things that run but don't do what you want them to do.
  • 29:21: bug-hunter: So it brought to mind the fact that there's a bug-hunter package. It's been a while since I've used this, but it might be useful to other people as well. What bug-hunter does is it does that bisection for you. Bisection is the idea of commenting out half of your Emacs configuration or whatever else and then seeing if that works. First, you comment out the second half and you run your configuration and you see if you're getting the problem. And if that works, then you split the second half, and you try to find the problem there and so forth. You're always cutting things in half and you're working with smaller and smaller pieces until you can identify the specific expression that's causing you problems. It depends on what kind of error I'm looking for. Sometimes I will just open up my tangled Emacs Lisp configuration and then record a keyboard macro that goes forward one expression and then executes the last expression. The keyboard macro is very easy to keep repeating until there's an error. But if there's something more complicated, like I have to do a lot of steps in order to reproduce the problem, then bug-hunter is helpful for that because it does that kind of splitting up for you, and then it'll ask you. It'll either allow you to specify an assertion (something that can automatically check if the error is present), or if there's an interactive thing that you need to do in order to find out whether you're a problem, then it can also prompt you. So that's the bug-hunter package. Highly recommended when weird things are happening with your Emacs configuration.
  • 31:07: Emacs Lisp: All right, Emacs Lisp, Mike Zamanski has released another episode of learning Emacs. He dives deeper into how to use Emacs Lisp to build a thesaurus. And then there's another post on using cl-letf [oops, not cl-flet] to override a function. Sometimes you'll want to run something, but you want to tweak the way that it works. Sometimes you can do that by using a hook if the authors of the code had the foresight of including the appropriate hooks. Sometimes you can do that with advice. But if you're only doing it temporarily, like you don't want your change to happen all the time, but just for this particular call, and you're trying to modify something that's not directly in that function, but maybe like a layer or two down it, then [cl-letf, not cl-flet] allows you to… It's like the way you can use let to change the value of a variable while when you call a different function. [cl-letf] lets you override a function just for the calls that you're going to make. And it does it not just for this direct call, but also for the functions that that function called and so on and so forth. So [cl-letf] lets you change the function that is being used. Simon Dobson's post goes into a lot more detail. It is very hacky when you need to use it, but sometimes that's what you gotta do.
  • 32:41: ert-results: ert-results, there's a package here that allows you to get more views. So if you're writing tests for your Emacs Lisp, ERT is a popular package for doing so. There is a package for displaying the results in different ways, which I haven't looked into, but it looks useful when you're dealing with a lot of tests. There's been some further
  • 33:11: Appearance: discussion on this "I just wanted Emacs to look nice." I think Hacker News had a big thread on it recently with over 170 comments. In addition to this thread, I think there was one like a few days ago that talked about how terminals are complicated. Then there's more stuff in colors and transparency.
  • 33:36: Window configuration: I often need help focusing, as you can probably tell. So, somebody posted this tip for maximizing buffers, but saving the window configuration, and then somebody else pointed out that if you've got winner-mode, you get that for free. I'm still getting the hang of using winter mode myself, just getting my brain used to the idea of going back to a window configuration. Actually, maybe that's a good use of swiping: instead of using the swiping to shift buffers, which I can do fairly comfortably with C-x b, I can just use the swiping as my touch gesture for switching window configurations. Worth a try.
  • 34:33: Org Mode: Org mode, lots of people sharing their workflows, workflows for writing a book in Emacs and Org Mode. There's a YouTube video on that. Workflows for for studying vocabulary. If you're not quite at the level of writing books, you're still learning lots of words, that's okay too, Org Mode's got something for you. Using a checklist to keep track of your shopping list. This post was about using Orgzly with a checklist to do the grocery list. Somebody else in the comments said that they basically export something that uses JavaScript to give them a checkable checkbox, which is another interesting technique. And yeah, so more Org Mode in real life. Basic Citations in Org has another post, so if you're interested in writing scientific papers and other things like that, Org Mode has citation support to make that easier for you.
  • 35:38: Completion: Ah! So, a couple of interesting resources for completion. This one, I think, is… This one is more about Ivy and counsel, which you don't see as many posts about these days. If you do use Ivy, then that's definitely worth checking out. That's Martin Fowler's post "Improving my Emacs experience with completion."
  • 36:02: Compile: Coding: there was a long video on compile and other things you can do with a compile command, including setting file-specific compile commands, which is helpful. Not just compile in the traditional way we think of (you have some source code, you compile it into a program), but also compile as in, "I always want to run these commands after I edit this file." It could be a configuration file and then your compile command could restart the service that uses that configuration file, for example. So that's "Compile with confidence: a deep dive into compiling code with Emacs," which is 15 minutes and worth checking out.
  • 36:54: Window configurations: Going back to the window configurations: Kalman already shared using registers, which is the same technique as discussed in the Reddit post. The function in the Reddit post about window configurations–sorry, temporarily maximizing your windows, the Reddit thread was called. The function saved the window configuration to a register to make it easier to restore. That's definitely a useful technique. A couple of LSP related things.
  • 37:28: Attaching files: Oh, and there was this interesting one about "Have you ever sent an email with a file attachment that is located on a server?" Where Christian did was use Dired to look for a file that was remote, because you can easily work with files on different computers by using Tramp. Yeah, okay, so Christian used Dired to get to a server over SSH, find the file, and then use Embark to attach the file to a mail composition buffer, which is fascinating. It made me start thinking about if whether you could maybe use the org-store-link mechanism as well. So you store the link, and then instead of inserting the link somewhere else, you might just have an attached file from a stored link, and it would figure out the location to attach. That way, you can go back to the mail buffer that you want to insert it into, and you can insert that there. Yeah, so this function uses Gnus, but it's fairly easy to do that with just a regular mml-attach-file as well. So you don't have to use Gnus for this. If you're using notmuch, you can use that to insert it. Because Emacs lets you use Tramp to work with files on remote systems as easily as you do on your system, attaching something from somewhere far away is actually fairly straightforward.
  • 39:10: Reading comic books: Cool stuff. Oh, "GNU Emacs as a comic book reader" is in the fun category. This got picked up a bit in Mastodon as well. I saw some people tooting about it because… Fun! So comic books are often packaged as archives that have the image files in them. Emacs can understand archive files and Emacs can understand images. You can just put that together with a little bit of help in like flipping the pages. Apparently, you can read comics inside Emacs, which makes me start thinking about okay, well, what else can we do with images in Emacs? A little bit later in this blog post actually… There's a magnifier in a recent blog post, I think, adding a magnifier to the thing. Where is that? So there's a little magnifier over here, which I am going to go look into how that's happening, because that sounds like a fun thing to do for my sketches as well. I'd like to be able to say, okay, I'm talking about this sketch, but highlight a section for easier looking at. Community-wise, FOSDEM– was going on? Is going on? People are posting stuff about having enjoyed it. So it's either currently going on or it's done. FOSDEM is a big free and open source software conference, plus a lot of community stuff. There is a community track. So if you're curious about the community plumbing thing that I mentioned at the start of this live stream, you can go check that one out. Apparently there are lots of interesting talks. So that's my Emacs news highlights. You might have slightly different Emacs news highlights. Totally cool. Everybody gets something different out of it. So let me switch back to the chat, and then I can start saying hello to other people who have dropped by. Hello DJ Cthulhu and Data Monoid and and everybody else who's watching. It's very strange. The kiddo is not waking up yet, so I guess I can just keep taking advantage of this time.

Recent additions to my Emacs configuration

  • 42:01: Org-modern: Okay, where was I? I'm experimenting with org modern and variable pitch, but I'm not sure if I'm doing this entirely well. At least the headlines are bigger now, so we're going to see if that changes things in making my Org files a little bit more manageable when I am wandering around.
  • 42:27: Recent additions to my Emacs configuration: Let's see. Oh yeah, we can find out what else I've added to my configuration recently. I just have a bad habit of forgetting to add things.
  • 42:49: Exporting captions in Org Mode: So, captions. I very much like having captions and transcripts, partly because I'm using these live streams as an opportunity to braindump text for blog posts and presentations and things like that, right? If I look at my recent post, for example, for Yay Emacs, I'll take you through the source code for it behind the scenes. Now I have these caption links. I'm playing around with it first. This will export a section of my captions without my having to do any more manual fiddling around with it. Okay, I need to actually load this up. So this is a subed file. (Why is it not subed-mode? I think my configuration only partially loaded.) So subed allows you to edit the captions while having the video right beside it, which is handy because then I can jump around and correct things and so forth. The thing that I added to it recently was being able to export a section of the transcript with the times so that I can synchronize them. So that's fairly straightforward now. And then if I want to edit the text a bit more, then I can also have a function that specifies the start and the end, and then exports that part of the text with the timestamps on it, at least for the paragraphs. What that does is it makes this… Let me bring up a blog post… It makes this part over here so that I can click on–theoretically, I will eventually be able to click on something in order to jump to that specific point. Or at least in the meantime, you can look at the times and go to it. There's something that needs fiddling with for the JavaScript to have that synchronized, but, step by step, right? This part over here… When I publish a blog post about my live streams, I want to be able to include the video. I want to include the transcripts. I want to have times on the transcripts so that people can jump to the specific section if they want more details. I also want to be able to have my own structure around it. So, for example, I might want to have headings, or I might want to have lists, or something like that. If I have both the ability to put in extracts from the transcript, as well as use Org Babel to evaluate the code that gives me the transcript so that then I can fiddle around with it, I can copy and paste into a separate section and do my own editing, then I think that's pretty cool. That's another thing that I worked on recently for that. The reason I do that is because I have very little patience when it comes to going through things. (Aforementioned not having a lot of computer time.) I like skimming through transcripts. I like finding text in them. I like jumping to specific sections. I want to make that as easy as possible as well for other people who are watching this stuff, which gives me then the freedom to blather on about stuff while knowing that if there's something interesting, people can go find it again afterwards. So the process of getting the automatic speech recognition version, it's fairly easy. I can just use my my-deepgram-recognize-audio command to do it. Then I can turn that into a blog post with very little editing. Then people can go figure out, you know… Eventually this can be polished into something that makes more sense, because I tend to go off in tangents and repeat words and use filler words and all that stuff. So, that is a thing that is in my config now.
  • 47:44: Committing the changes to my config: Okay, so that's another change. Yeah, okay, so those are all the changes I did for this week. Hooray, I should remember to add that. This is touch. Okay, don't panic. All right, Compile. Create commit. Yes, I want all the commits. Okay. Diffing changes. Okay, okay. So, this was touch gestures. This is good. This is, you know, This is a good reminder for me to go actually commit things. Video export. I think that was it.

Other questions, finding help

  • 48:31: Question about Org tables and vocabulary: The question here is, trying to use the org table as a vocabulary manager. What do you do if you have multiple languages for each column, such as English, Tamil, and Mandarin, and you're having problems with misalignment? I'm not sure whether… Oh, good, other people have the same question. Okay, I'm not sure whether specifying the column width is going to be enough, or maybe like different column widths. Do you know that you can, okay, so if you have… If you have a table, column 1, column 2, column 3, you might have really long… Now, if you can specify, I think, the width this way… It's not working. Okay, I C-h i m Org mode Table Column width and alignment… Okay, Let's see if we can get that to work. So theoretically this should have aligned it, but maybe it doesn't. C-c C-c should have split it up. I wonder if Org Modern is playing around with this. I am not entirely sure. That might be a good question for the Org Mode mailing list. They are very helpful over there. So unlike emacs-devel, which can sometimes be a little terse, I guess, Org Mode is specifically set up so that the Org mailing list has help and development questions and everything in one place. It tends to be the place to go for questions because they are cool. There's also an orgmode subreddit where sometimes people have shared questions like that and tips like that too. I would recommend, if you write about what you've done so far and where you're getting stuck, either the Org Mode mailing list or the Org Mode subreddit, which is at reddit.com/r/orgmode. Those might be two good places to ask Org-Mode specific questions, because chances are, no matter what workflow you are trying to figure out, someone out there has the exact same itch and has figured something out. Okay. All right. How to find…
  • 51:18: OrgMeetup: Ah, yes. There is also an Org meetup. I should point that out because it is awesome and because Ihor writes such lovely notes. So there is an OrgMeetup which I think he actually tries to organize about monthly. And it's always great fun. Then he has like really, really detailed notes, including bug reports or interesting features that people are playing around with and so on and so forth. So OrgMeetup is a third place to go if you want help with org things, and they are very lovely. Yes. And then Data Monoid points out that there's a matrix room and Yandar, one of the org maintainers, is around there too, so you can ask. There's also an #org-mode channel on Libera chat. So, yes, places to ask for help.
  • 52:27: Finding help in Emacs: There's a question here about how to find help in Emacs. So of course, you can find documentation inside Emacs itself using the info manual, like the way you saw me look things up right there too, and C-h f, which is describe-function. But let's say that you need help going beyond that. There is the help-gnu-emacs mailing list, and people ask a variety of questions there. If you're starting with a starter kit like Doom Emacs, then you'll also want to check out the community that's specific to that starter kit, because starter kits come with thousands of lines of code that modify the Emacs experience. It can be challenging for people who are using vanilla Emacs or a different configuration of Emacs to figure out where you're starting from, if you're using a starter kit that's different from theirs. If you're using a starter kit, check out the starter kit's community as well. As I mentioned, there's an Emacs subreddit and I see a lot of people asking questions on that too. It's very helpful. People often post snippets and say, okay, this is what I figured out so far, but I'm getting stuck. Or they ask questions on how to do things. That's all good stuff. Just slightly annoying, ads-wise, but you can skip past them. There are the IRC channels on libera.chat. There's an #emacs channel and there's #org-mode and I think there's an #emacs-beginners one as well. Those tend to look like they're off topic most of the time because people are chatting, but sometimes if you come in with an Emacs question, then people will go and answer them if somebody knows the answer. It can be a little hit or miss because you don't know whether someone who's got the same interests is on at the same time, but if you're looking for kind of a quick back-and-forth, that's another place to drop by. Other places to ask for help… Posting on the mailing list or in Reddit. There's also an Emacs Stackexchange. I don't know how active it is. Sometimes I see links to posts on it. so that's another place. But yeah lots of places to go find somebody who has a similar kind of thing.
  • 55:19: Why is Emacs fun for you?: Speaking of finding things, finding someone who's got a similar kind of thing, there is a conversation about what is it that makes Emacs fun for you, which I was going to point out in the upcoming Emacs news because it's interesting to see the kinds of things that resonate with people. So that's one of the discussions that is out there on the Emacs subreddit. Okay, my voice is starting to give out, so in maybe 5 minutes I'm going to wrap up. Plus also, I want to make sure that the transcript isn't so long that I end up with this mile-long blog post afterwards. Data Monoid says that Emacs Stack Exchange is actually fairly active and they got some clarification on display line numbers mode. So there's another place to go and ask questions.
  • 56:23: Sharing your notes: Long-term, I highly, highly recommend using Emacs to write your notes about Emacs learning, and then posting that as a blog because (A) it'll help you as you think through the stuff that you want help with and (B) if it's up there, then people can come across it and they can be helped by your notes as well, which builds good karma. When you write about something, inevitably someone will come along and say, oh yeah, there's a better way to do that. It's happened to me numerous times. I get very excited about something clever I figured out, and then someone points out that it's a built-in package for it. So I highly recommend taking notes and sharing them. Again, you don't have to be an expert. In fact, it's really good to do this as a beginner starting out. Org Mode makes it very easy to do so. You can post to a WordPress blog or you can publish your site directly from Org Mode. Then you can take advantage of Org Mode's literate programming support to have your code and your notes all together. That helps you remember things, and that helps other people understand the context. Who knows maybe they'll get inspired by what you're doing and they'll go back through your archive and share even more tips and so on. It's all very good stuff. Highly recommend if you are asking for help. In addition to sharing what you've been doing so far in your Reddit or mailing list post or whatever, once you figure these things out, please take your notes and put them somewhere, ideally somewhere public, so that when people are searching for the same kind of question in the future, they can find your notes. That will be awesome. Thank you very much. Then you can tell me about it so that I can put it in Emacs News and we can keep those ideas flowing.
  • 58:19: Help on help: Oh yes, so a comment points out there is help on help. Question mark gives you… So C-h is the typical command shortcut for help. It might be different depending on your Emacs starter kit setup or whatever, but C-h is what it is in mine. The question mark here shows you more of a menu, which you can use SPC to scroll through. There's also a quick help, so that just stays around. C-h C-q is quick help. This just gives you a very quick cheat sheet. This is actually configurable, and I was playing around with tweaking it, but I'm waiting for them to figure out kind of other ways to add more stuff to it so I can have my mode-specific help on it more easily. Yes, so there's a lot of help, which is great. Sometimes you don't even know what to look for, and that's where talking to other people about Emacs is very helpful. Because help is great if you know what you're looking for, and reading through the manual is another way to learn the words to look for, but sometimes you're just like, "I want to do this thing and I'm getting stuck. What do I need to do?" That's where you go. Yes. Oh, and as Kalman pointed out, looking at the source code is often also very helpful. In my previous Yay Emacs thing, I went into how you can use helpful to look at the source code of something when you're just looking at the function description. I highly recommend that.

Edebug

  • 01:00:28: Edebug: I also highly recommend using edebug to slowly work your way through a function. Once you've started to get the hang of Emacs Lisp, edebug is super helpful. If you don't know what edebug is yet, I can very quickly squeeze in a quick, demonstration. Let's take a look at that lorem ipsum thing that I just used. That should be fairly straightforward since it just inserts things. Okay, so here, if you use… I don't even know what the menu way to do it is. Okay, M-x edebug-defun, which is I think, [C-u] C-M-x. Then when you call it… so let's say for example, I say [M-x lorem-ipsum-insert-paragraphs], then it will allow you to interactively step through things by pressing SPC. This is edebug. It lets you walk through a function and see where it's actually going. You can press e to evaluate things. So for example, if I want to see what num is, I can press e, type num, and it'll show me the value, which is 4 at the moment, because I called it with a universal prefix argument. So I said, insert 4 paragraphs, please. And it will show you the values of things, assuming you don't accidentally get out of the thing. Mystery. [dealing with some weirdness] This is undo tree. Undo tree is going to help me get back to where I was. All right. This is the buffer that I wanted to revert. Yes. That's the thing that I wanted to run. Sometimes I have a problem where when I'm edebugging, it switches for some reason into insertion, but now it's working. You can see there, I'm stepping through it properly now that I am not panicking. That's how it works. Interestingly, this one does it recursively. How strange. Okay, all right.
  • 01:03:42: Using the menus to explore: So that's edebug. The other thing that you can do while you're edebugging, by the way, is take a look at this menu. A lot of people turn the menus off because it saves them that little fraction of screen real estate, but it's actually very helpful to use it, especially when you're exploring something new for the first time, because then you can see the kinds of functions that people recommend checking out, like you can do step with space, which is what I was doing, and t automatically runs through things. It's called trace. Trace fast does it faster. Also, you can start to look at the different sub menus here. So for example, you can jump to a specific section. It'll tell you what the keyboard shortcuts are for it as well. You can use breaks. So one of the things I played around with a few months ago, was setting a conditional breakpoint. I knew there had to be a way to do it. I just wasn't sure what to call it, but looking through the menu helped me find it. That's another way to find words for things. If you want to look at the backtrace, you can use d for backtrace. If you want to evaluate something, then you can do that. Yeah, so that's edebug. Hey, there's an option for test coverage. I should go check that out. So, edebug is very helpful. And when you're done with edebugging, you can press g to just keep going. And then you can evaluate everything again to take off the edebug instrumentation and just run it as a normal function.

Wrapping up

  • 01:05:19: Wrapping up: So. All right, I really should wrap up because my voice is starting to say, "You're not used to this much talking in one go." But thank you very much for joining me. I will try to get this transcript up and edited sometime within the next few days, and next week let's see if I can manage to squeeze in a little bit of time for coding. It's unlikely because as I previously mentioned, the kiddo gets screen envy, so I'm probably going to be focusing on things that I can sneak in with a drawing. Fortunately, lots of other people are doing great Emacs tutorial videos. You should go check them out if you haven't yet. Protesilaos Stavrou, you've got System Crafters with David Wilson, Emacs Elements… There's a whole bunch of Emacs channels. I include links to those videos in Emacs News, which comes out usually Mondays, sometimes Tuesdays, if things are very busy. Go check them out. I am probably going to be focusing on the things that I can do without necessarily looking up code or writing lots of expressions, because again, very limited computer time. I don't know what that looks like. What is podcast-friendly (so I'm not assuming people can see my screen), and what is my-life-friendly? I'm going to assume that I'm not going to be at the computer figuring out the code… We'll figure it out. It's probably going to involve more drawings. We'll see. Eventually, someday I'll have more computer time, but that time is not yet now. So thank you for joining me. And we might see you again next week. We'll see. Bye-bye! Thank you.

Next livestream will be at [2024-02-11 Sun 07:30] EST: https://yayemacs.com.

View org source for this post