Emacs Turbo-Charges My Writing

Jeremy Friesen (he/him) - Pronunciation: JERR-im-EE FREE-SEHN, https://takeonrules.com, jeremy@jeremyfriesen.com

Format: 9-min talk; Q&A: BigBlueButton conference room
Status: Q&A to be extracted from the room recordings

Talk

00:00.000 Intro 00:57.120 How I got here 01:18.400 Friction 01:45.960 Domains for notes 02:15.920 Demo 02:55.440 Dabbrev and hippie-expand 03:32.840 Links 07:49.160 Conclusion

Duration: 08:53 minutes

Q&A

Listen to just the audio:
Duration: 15:53 minutes

Description

https://takeonrules.com/2023/12/03/emacs-turbo-charges-my-writing/

I’ve been actively blogging since 2011. In May 2020 I switched to writing my blog posts in Emacs. The numbers don’t lie, I’m writing more than ever, in part because of Emacs.

In this presentation I’ll walk through my writing setup for Emacs. I’ll go over the workflow of writing in Org Mode syntax with Denote serving as my personal knowledge management system.

I’ll demonstrate some of functions (or types of functions) I use for:

  • Dynamic auto-completion for Org-Mode macros
  • Linking to other Org-Mode documents via different contexts (abbreviations, citations, and links)
  • Different Org-Mode blocks that map to HTML elements

And with a complete post, I’ll then walk through the resulting export. Demonstrating the output to Hugo (and its shortcodes) as well as other formats.

About the speaker:

Jeremy Friesen is a long-time software developer but only recently an Emacs convert (as of May 2020). When he switched to writing posts using Emacs, he observed an explosion in writing, in part because of the joy of using a tool that he can shape and extend to meet his needs and wants.

Discussion

Questions and answers

  • Q: Do you think the line number for writing document kind of distraction? Especially for notes.
    • A:I don't find it distracting; I've been coding for a long time and those fringes are partially invisible.  But help me orient.
      • or, what it brings to you, if we don't have that.
        • Given that I'm writing code, prose, documentation, etc, I prefer to have a common left fring...most of the time.
      • Okay. I use (avy-goto-line &optional ARG) for jumping
        • I bind C-j to jump to avy-goto-char-timer; My C-l is bound to consult-goto-line
  • Q: How do you manage private and public data with your zettlekasten. One of my blockers on putting my zettlekasten on the web is I don't want everything in it to be public. expeccily fleeting notes
    • A: I explicitly export a single page at a time; this ensures the primary page is something I consider public.
    • Q: Do you have anything to prevent private links from getting accidentally being made publicaly accessible
      • The main guard is the "publish this page" function.  Under the hood, private notes are those that I don't specify a public URL.  I do this by way of the #+ROAM_REFS: keyword (technically there are a few other keywords I check as well; for bespoke historical reasons) on the document.  If it doesn't have that, then an internal link to that item will not export a public link.
  • Q: Is there anything special you're using to go from Org to Hugo Markdown?  This looks like a really nice setup, and I'd like to give it a try!
  • Q: Another font question.   What font were you using in eww?
    • A: For fixed fonts I'm using "Iosevka Comfy Motion Fixed" and for variable "ETBembo"
  • Q: What's the story behind the name "Take On Rules"?
    • A: The blog started as a game rules oriented blog; it was my time to interrogate rule systems.  But over time that drifted; and once I moved to Org-Mode for writing I settled on an everything and nothing blog.  My https://takeonrules.com/about/ has a bit more details on this
      •  "Anything and nothing." Makes sense. :-)

Notes

  • https://takeonrules.com (presenter's personal blog)
  • When you put your thoughts on the physical world, it actually helps you to generate more. It's kind of releasing your mind and let your mind freely be free so from that kind of states you can create something new

Transcript

[00:00:00.000] Intro

Hello everyone, I'm Jeremy Friesen, pronouns he/him, and today I'll be talking about how Emacs turbocharges my writing. Quick intro: I've been programming since 1998 and blogging since 2011. In May of 2020 I switched to Emacs, having previously used a long list of different editors. Curious about how Emacs impacted my writing, I wrote some stuff on my personal site and found that I blogged about 95 words per day prior to Emacs, and with Emacs I'm blogging about 340. Now, this is not a fair comparison, many things changed. A pandemic removed 2 hours of commute every day as a big contributor. Ultimately though, I've used Emacs and extended it to reduce barriers to capturing and writing and thinking, and I'm always on the lookout for minor refinements that help me stay in my thinking.

[00:00:57.120] How I got here

How I got here was I started in WordPress, then I moved to Jekyll, and then to Hugo, and through that process I started writing in Markdown. And when I was learning Emacs, I also didn't want to learn Org Mode, it felt intimidating because it could do so many things. I later learned Org Mode grows with you, and that's where I'm at now.

[00:01:18.400] Friction

But I didn't realize that friction between writing Markdown for my public blog and then adopting Org Mode locally for writing and time tracking and things like that. And also, where did I put things, because migrating the formats was just a little clunky. So ultimately I spent some time thinking about the data flow and where I would put things, this kind of pre-thinking, where does stuff go when it comes into and out of my brain.

[00:01:45.960] Domains for notes

So I have many domains where I'll write towards. The ones for this presentation are going to be blog posts, epigraphs, glossary, and melange. Melange is, I don't know where it goes, but now I do, I just throw it in melange. So I began exploring Org Mode via Org Roam, but I've ultimately switched from Org Roam to the simplified Denote package. I didn't use a lot of the functionality and I appreciate the plain text reality of Denote.

[00:02:15.920] Demo

So let's hop into the demo. I'm going to split my screen. Over on the right is going to be where I'm going to be live typing stuff. So let's get going. You'll notice I don't do a lot of screen splitting. It just makes it easier to focus. So let's create a note. All right, I have bound hyper to my command key, my right command key. This opens up a whole world. I'm going to create a blog post and we're going to name it the ever popular "hello world". It's Emacs. Great. We've saved it.

[00:02:55.440] Dabbrev and hippie-expand

One of the things I encourage everybody to do is to watch Jay Dixit's presentation, Emacs for Writers. It showed me the utility of Dabbrev for quick auto correction. And I also love using hippie-expand. When I watch VS coders code, it's always a little sad pants because they're thinking about coding or writing in terms of their code. But I have found as a programmer, I tend to write more tech, more like English instead of programming code. So I think it's important to understand these tools that help me write better.

[00:03:32.840] Links

All right, we're going to go with links. Links are foundational for the web. I'm going to insert a public link, which is a role playing game that I love, Worlds Without Number. And I'm going to go ahead and describe it. A role playing game. But I don't want to always say role playing game. I'm going to abbreviate it. So I wrote a function that will transform it. And let's take a look at what that looks like on the inside. When I do this real quick, it's toggling it back and forth. And I'll just keep doing that. I also have the idea of public notes and private notes. Public is things that's going to have a URL. I met a person at a conference. He gave a talk on something that I thought was very useful. I didn't write down what he talked about on his note. I wrote it where it was more relevant to the topic. And I can use a backlink to go find that. Next up, I demonstrate the abbreviation. I also have dates. This is a semantic date in HTML5. I can just have the year. I can also just have something like that date is today. And we have date links. I don't have backlinks built up for that, but I have ideas of how I go about doing it. And last up, thank you Frank Herbert, I want to introduce epigraphs. So this is epigraph. I just have that, any sufficiently, dot, dot, dot. And that's my epigraph. Backlinks, I mentioned that. Let's go take a look at Jonathan, right? He's a Rubyist, but importantly is the backlinks. He gave a talk on, that's right, PDFs. I can go look at what he spoke to and I can reference that because I will remember that talk or I will remember, oh, I need to look up PDFs. Oh, I have something in PDFs. Again, it's about stumbling upon data in a good way. So thinking of making linking easy helps me create more and more ways to find things, both by links, backlinks, indices, file searches, and so forth. It's all about information organization. Next up is a really cool function of org capture. So let's take a look here. I'm going to start a clock. It's running. And I'm going to bring up my browser. And I'm going to go ahead and capture to the content to clock. And it brings up this block quote, which is lovely. And boom, I'm going to save it. I'm going to close this. We're back here to my "hello world". And it has grabbed a block quote for this. Again, it helps me gather stuff up quickly. I've bound that also in my RSS feed. We're going to skip over macros, blocks, and the abstract. And we're going to get into the export because this is where we can see the magic that happens because I want to take things from private to public. So I have bound a key. These are my menu of things I don't want to forget. I will export. And here we go. Here is my blog post in markdown format with Hugo shortcodes. So let's go take a look at what that looks like. Localhost. I'm not writing in Rails. "Hello world" right there. This is the epigraph. And I have a mention of Worlds without Number. And I have mentioned this as a abbreviation. So I include the first time this text. Here's also Jonathan. He is not a public reference thing. Also, I have these things here. And here's my captured information along with the citation link to it. Again, helpful to be consistent.

[00:07:49.160] Conclusion

In conclusion, when I started learning Emacs, I quickly shifted to vanilla Emacs and just started writing. As I wrote, when I needed to do something that I'd previously done in a text editor, I'd find an experiment with a package. I continue that mindset. As I write, I'm attending to what I'm doing. And eventually, I realize if I were to just write a function that does this one thing, I'd have a smoother writing experience. This helps me practice my craft, extend my editor, understand its capabilities, and begin exploring other things. The goal of this is all to minimize the distractions. As I'm thinking about it, I wanted to quickly add it and then move along, basically creating breadcrumbs for me to follow my thoughts in the future. And one of those functions is I'd like to write an extender for my abbr, abbreviation export to work in Latex. It's like halfway there. So I'm looking forward to getting that done when I have some time and can prioritize it. But for now, thank you. And I look forward to your questions.

Captioner: bala

Q&A transcript (unedited)

so Sasha, you don't need to worry about this. Hi Jeremy, how are you doing? I am feeling replenished after this lunch break and I am happy to go back for 4 more yeah great, Let me just put up the questions. So Jeremy is going to read the questions and answer them and I will be doing jazz hands in the background or provide any bits of information I may, considering that Orgrim has been mentioned during the presentation and everyone's going to want to ask me. at... Show me? Yeah, go. do you think the line numbers for writing documents is kind of a distraction, especially for notes? No, I do software development and that left fringe is kind of invisible, but I do like to use jump to line. So I just bind that to control L and it's helpful to just see that. So no, I haven't noticed that. There are other ways to jump around in Emacs, but I like to have many different ways. So, yeah. Then how do you manage private and public data with your Zettelkasten? 1 of my blockers on putting my Zettelkasten on the web is I don't want everything to be public, especially fleeting notes. So 1 thing is I only explicitly export a file to Hugo and I have that, I can like, I can export this. That doesn't show up very well. So it's export probably export org to take on rules and we'll export the buffer. And then any that I referenced, like these are all links, any notes that are not public will be exported as the text, but there won't be a link to it. So it's having the very deliberate, this is going up. And so I send it over into Hugo, which is its own repository, and either massage it there or whatnot. Is that any further questions on that 1? org to Hugo markdown? This looks like a really nice setup. I like to give it a try. Yes, there I have a bespoke build process. Having started in WordPress, working through Jekyll, going to Hugo, and then switching from Markdown to org mode, I've backed into this private public Zettelkasten, which is really nice. And I have added quite a bit of code. There's my dog. notes because I want I have marginalia instead of like the footnotes, but I still use org mode footnotes. And so I've got a bunch of these things and this is all available up on GitHub And I'll provide a link in the document. Yeah, so there's quite a bit of making the export work how I want it. And I've been kind of fiddling with also improving like LaTeX or PDF export. So yeah, I have a long running to do item to fully lay out my bespoke build process. Because once it gets to Hugo, there's also additional work that I do to compile what is kind of a personal, like a digital garden-ish, it's really a blog focused 1. So yeah, it's at Jeremy F on GitHub at dot Emacs. And you'll be looking for JF blogging.l that has some of this. Also jforgmode.l will have some of that. Yeah, I wanna circle back to that, anything to prevent private links from getting accidentally being made publicly accessible. Yes. So previous to using denote, I also used org-roam. So I have this idea of a node in org-roam has roam refs. And org-roam is much more robust about that. So anytime you mention a ref, it will count it as a backlink. So for example, if my node was my blog, take on rules, anytime, anywhere in my org Rome repository, I mentioned takeonrules.com, it would treat it as a backlink. So from that Rome refs, I have a, I will interrogate, and this is not the function for I will look at the node to see does it have a Rome ref and if it does I will treat it as a public link. So I don't I haven't bled out any private information because again going back to I only publish a document and the document I'm explicitly doing so and then my process filters out any links that do not have public URLs. It will just dump it in there as maybe a span with a ref class of it so that I can kind of know that that came from there. Yes, So the font I am using is, so this is another font. What font were you using in EWW? I think I'm using IOS Becca and ET Bembo. If we are doing full ricing setup, I can recognize Yosefka just by looking at it. ET Bembo, I'm using these 2 fonts as kind of my anchor. So the variable pitch is ETBembo. My blog started off with a Tufta style CSS and I really pared it down and got rid of any of the additional fonts because they can be used as trackers. And I'm like, nope, you decide what font you want for your browser. I don't need to tell you what looks good for you. Yeah, so the story of Take On Rules, I have to thank my partner and lovely wife for that. She kind of nudged me to do some blogging, and we spent some time thinking about it. And originally, it started off as writing about rules for role-playing games or tabletop games. And it has extended far beyond that. The blog, as I've shifted, as I think I mentioned in the presentation, as I've shifted towards an everything and nothing approach, the blog is anything I want to write about anymore. There's haikus up there with some regularity. So the name is now a relic of a past. So yeah, the thing and nothing is, and I put that in the about on my blog. So it's, I highly encourage like, I feel great. Once I like said, oh, I don't have to write this towards a topical blog post or like what the topic is, it freed it up. And I know that it comes at a potential compromise because it's very much me being a voice up there instead of something that is curated and filtered through a specific channel like I could have a technical blog but I decided I'm just gonna tag it as programming or emacs and let you find it and you can subscribe to the rss feeds of each tag that you find applicable question on the pad but I see that some people have joined us on the blue button. So, hi everyone! We have about 6 minutes until we need to go to the next talk, but if anyone has a question on the blue button, I'm thinking about James who's joined us and who was kind enough to drop a thank you line on the blue button. Do you want to unmute yourself and ask a question maybe? I'm not putting pressure by the way, I don't feel like you need to but it just... I speak all the time otherwise I'm very happy to spend time with our speakers you know but you know EmacsConf it's about, as Sasha told you during the intro, it's about making people take things, brilliant things out of their mind and put them outside in the public. And for us, you know, we get to see the talk evolve, we talk with people. So for us we are already quite cognizant of the topic and the point is not for us hosts to ask questions, it's mostly for you to ask questions and then we worry about all the fancy stuff in the background. Otherwise you damn well know I will ask questions about org-roam, about links, and nodes in general, because that's my bread and butter. the process of migrating the data from a WordPress export to markdown to org mode by way of Pandoc was, it was really insightful to help me understand how I want the data to flow and how I could create a repository for me of information and 1 that I could then send out into the world, the public information, while not having to worry about the private things that I might want to keep. So it was that process of just working through it to reflect on how I'm writing and what I started using writing for. I think Richard Feynman said, no, writing is my thinking. What I wrote is thinking. So it has helped to really frame that. ambivalent relationship because it feels like writing helps thinking and thinking helps writing in a way and nowhere have I personally been more aware of this than when coming up with networks of notes because it really I mean you use whichever word you want you know a second brain a collection of notes a slip box a repository of notes whichever the tool you use the point at the end is to resonate with you. It's kind of like extending those moments of consciousness that you have when you take your notes, and you make the entire gradient available. Sorry, I heard Sasha whispering in my ear sometimes. It's pretty pleasant. It's really shocking. Do I use denote just for my blogs or do I use it for other purposes? I use denote for all of my note taking and almost, I think it's exclusively org mode that I, that I use it in. But what I really appreciated in the consideration that Proc put forward was the file name encodes the information that's relevant. So it has helped me be able to query by using things like ripgrep, well not ripgrep, tree or I forget any more what I use. But having that the file encodes useful information. And it's so much more relevant when I look at having worked at a university that rolled out Google Drive to everyone without any guidance on how to organize stuff. And I worked at a library and it was just a nightmare watching things show up where you could never find it again. So, file name, the file name having the date, having the title and having tags just made so much sense to be findable. And yeah, I really do just use org. But if I am going to make txt files or other files, I have started adopting that structure and format. and 30 seconds left until we go on to the next talk. Do you have any final words regarding your presentation or maybe where people can find you? I know you've already mentioned this but... dice.campmastodon at take on rules and I've thought about emacs.h but we federate well So I appreciate that. And I can stay on and answer any further questions if folks have it. I confused myself with the buttons talking to production and all. Well then, what I'm going to do is that the stream is going to move on to the next talk in about 50 seconds. If people want to join and ask any questions, feel free to join on the blue button. The link is on the talk page or on IRC. And feel free to hang out as long as you want to ask as many questions as you want to Jeremy. We are recording all of this and we'll be publishing this later on once again. And all that's left for me to do is to thank you so much, Jeremy, for your presentation and your answers. And I will see you another time. I'm not able to grant speaking powers. So if you wanted to type up something question-wise. So we're moving on to the next talk. We'll figure out the things about VBB, But in the meantime, enjoy the next talk. Bye. All right, Jeremy. We are now on the next talk. Sorry about having to mention multiple things at the same time. Speaking rights. I will try fixing this in the background. I need to get moving for the next talk, but I'll do it in the background and we'll let you know as soon as it's ready.

Questions or comments? Please e-mail jeremy@jeremyfriesen.com