2021-08-16 Emacs news

| emacs, emacs-news

Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar and emacs-devel.

View or add comments

Started learning how to interactively debug Javascript in Emacs with Indium

| 11ty, emacs, coding

I noticed something strange in my static blog: my blogging category page didn't list my post on statically generating my blog with Eleventy. Now it does, of course, since I fixed it. But it didn't, and that was weird. I tried using console.log to debug it, but it was annoying to try to figure out the right thing to print out in a long list of nested objects. Besides, console.log debugging is so… last century.

Since these tips for debugging in 11ty mentioned interactively debugging things in VS Code, I decided it was a good time to learn how to use Indium, a Javascript development environment for Emacs.

(use-package indium :hook ((js2-mode . indium-interaction-mode)))

After some trial and error, this was the .indium.json file that allowed me to use M-x indium-launch to start the Eleventy process.

{
  "configurations": [
    {
      "name": "11ty",
      "type": "node",
      "program": "node",
      "args": "./node_modules/.bin/eleventy"
    }
  ]
}

I originally had "inspect-brk": true in it as well, following the suggested configuration, but I found it easier to just set breakpoints in my files using indium-add-breakpoint (C-c b b, a keybinding set up by indium-interaction-mode in my js2-mode-hook).

Conditional breakpoints didn't seem to work, so I just put my logic in an if and set my breakpoint in there.

  categories.forEach((item) => {
    if (item.slug == 'blogging') {
      let post = data.collections._posts.find(o => o.inputPath.match(/statically-generating-my-blog-with-eleventy/));
      console.log(post);
    }
    ...
  }

When I set my breakpoint on the let post... line and ran M-x indium-launch, I got an interactive debugger at that breakpoint. I could also switch to the REPL console and type stuff. Yay!

As it turned out, the post I wanted wasn't showing up in the list of posts. It was because I had used eleventyConfig.setTemplateFormats and forgotten to include md for Markdown files. Once I figured out what was going on, it was easy to fix. This is what the debugger looks like. It adds values to the ends of lines, and you can evaluate things.

Screenshot_20210816_002331.png

I'm looking forward to learning more about using Indium to debug scripts running in Node or Chrome. Slowly, slowly having some focused time to sharpen the saw!

If you use Emacs for Javascript development and you're curious about Indium, you can check out the documentation.

View or add comments

Weekly review: Week ending August 13, 2021

| review, weekly
  • I wrote a few 11ty shortcodes and Emacs commands to make sketches easier to embed into my blog posts.
  • We visited W-'s parents.
  • We made a LEGO vending machine, drink dispenser, and ATM following some video tutorials. A- made adorable beepboop sounds and pretended to cover her PIN.
  • We built and played with the LEGO Heartlake City Grand Hotel.
  • I used the LEGO power functions extension cables I ordered to connect the motors to the train regulator. Now the Great Ball Contraptions can run off wall power.

Blog posts

Sketches

Time
Category The other week % Last week % Diff % h/wk Diff h/wk
A- 39.1 47.2 8.1 79.2 13.6
Discretionary - Play 0.4 2.2 1.8 3.7 3.1
Discretionary - Productive 5.1 5.9 0.8 9.8 1.3
Business 1.1 1.6 0.5 2.6 0.8
Discretionary - Family 1.6 1.4 -0.2 2.3 -0.4
Sleep 34.4 32.4 -2.0 54.4 -3.3
Personal 7.6 5.6 -2.0 9.4 -3.3
Unpaid work 10.8 3.8 -7.0 6.4 -11.8
View or add comments

Turning 38; life as a 37-year-old

| review, yearly

Despite the chaos and challenges of the COVID-19 pandemic, this year was actually pretty good. We easily adapted to staying home with the occasional playdate or masked trip to the playground as A- became more interested in other kids.

We chose virtual learning for A-'s junior kindergarten, which turned out to be just right for A- and me. I loved seeing what the kids were up to and learning from how the teacher taught them, and A- enjoyed being able to mostly follow her own interests. I had fun incorporating A-'s obsession with Numberblocks into lots of playtime. We read hundreds of books together (both print and electronic), and I even got to read some grown-up books while waiting for her to be done reading at bedtime. I learned how to document her learning and organize my observations according to Ontario's kindergarten program. I was even able to help the class with tech support, materials, and donations. We've chosen virtual learning again for senior kindergarten. I hope it will be just as fun.

It was a good year for learning domestic skills. We enjoyed growing cherry tomatoes, bitter melon, and basil last year. This year, I added peppers, and I planted flowers in one of the boxes in front of the house. We've been enjoying a bounty of cherry tomatoes all summer, although I'm dealing with some powdery mildew. We learned more about preserving food, and we tweaked our kitchen layout to accommodate new tools and facilitate A-'s participation. I continued baking a loaf of bread every few days, trying out different recipes until we settled on a slightly modified version of this sourdough sandwich recipe. I learned how to make yogurt, too. Building on A-'s interest in Pride and Prejudice, I sewed her a bonnet, gloves, and many long dresses. I even sewed her a gown of bathing suit fabric that she wore to the splash pads. She was curious about knitting because of Numberblocks. I showed her how to knit and purl, and we worked on some hats and scarves.

I had a bit more discretionary time that mostly came from staying up late. I helped organize EmacsConf again, and I wrote some functions to help automate the things I needed to do. I also set up a calendar of Emacs events. Having developed a greater appreciation of captions and transcripts while trying to speed-read my way through more videos than I could fit in my focused time, I started editing captions for the EmacsConf recordings. That got me interested in possibly live-captioning EmacsConf and other things like it someday, so I ordered a Georgi keyboard and I've been teaching myself stenography with Plover. I mostly use it to write journal entries. I migrated my blog from Wordpress to 11ty because I wanted to use a static site generator that could be extended with Javascript, as it's a little hard to juggle different programming languages if I don't have much focused time. I ended up picking up more Python anyway, since I also wanted to extend Plover. I considered upgrading my laptop so that I could do streaming or video processing, but I'm still more constrained by time and energy than by hardware. Speaking of hardware, I've been learning more about mechanics. A- loved watching videos of Lego Great Ball Contraptions, so I learned how to build a few by following tutorials. I'm beginning to be able to figure out how to make do with Lego Technic, adapting the designs to the parts we have (and our desire to have as many modules as possible running simultaneously).

Last year, I wrote that I wanted to focus on:

  • Managing energy:
    • Sleep and managing my own plans: I slept less this year because I stayed up to do more consulting and personal projects. Fortunately, A- has learned to let me sleep in a little.
    • Enthusiasm: I like gardening and cooking, and A- often joins in. I like working on Lego Great Ball Contraptions while A- helps or reads, and she loves to watch the results. Learning stenography also makes it easier for me to patienty read lots of books since I can practise steno-ing parts of words while I read. Now that A-'s a good reader, we can take turns reading too.
    • Low-energy times: We have some screentime in our afternoon routine so that I can do household chores and get dinner together. That helps us get through some of the low-energy times.
  • Taking small steps: I did a pretty good job of learning about things in the small chunks of time I have, although I've been falling prey to revenge bedtime procrastination. If I get better at taking notes, it might be easier to convince myself to alternate days when I stay up with days when I go to bed early.
  • Making learning visible: My journal helped me capture lots of observations. I organized my notes and shared them with the teachers, who found them helpful when writing report cards. It was fun being able to review A-'s progress, too.

We're continuing with virtual learning until at least February, so next year will probably look somewhat like this year. We're figuring out quick dinners and other sanity-savers in case W- returns to working in the office a few days a week.

Over the next year, I want to:

  • Follow A-'s interests, document her learning, and learn how to support A-'s learning in key areas: Virtual kindergarten seems to mostly focus on literacy and math. A- is pretty comfortable with reading and math, but she's less keen on writing and drawing based on the teacher's prompts. I'll look for more ways to incorporate writing into the sorts of things she likes to do. We'll probably also need to focus on outdoor playdates for social interaction, since it's hard to connect on-screen. I'm learning more about helping her develop emotional self-regulation. She's pretty level-headed, but sometimes she's definitely five years old. That's okay! I'm learning too.
  • Plant more flowers in another front yard planter box: A- enjoyed picking flowers to put into a small pitcher on the table, so it might be fun to grow more flowers for cutting.
  • Take advantage of A-'s independent reading time to read and draw: A- usually likes to stay up another 15-20 minutes, so that's been a good time for me to read. If I take sketchnotes or I draw my thoughts, that will also help me feel like I've had some time to think. I can also get back to drawing moments. Those were fun.
  • Keep my priorities straight: It's tough having limited time to focus. I get tempted to stay up late because I don't have much time to myself during the day, and because it's easier to keep going when I have some code in my head than to figure it all out again the next time I get a chance. I'm less patient when I'm sleepy, though, so the price of feeling a little brilliant is feeling less than awesome as a parent. Reframing it might help. I'm choosing to be able to model self-regulation. I also want to have the energy and enthusiasm to learn from A-'s pretend play. Sure, it's fun geeking out and coding, but I can do that later on. A-'s availability and interest in helping me learn how to play is time-limited.

Sketches

Blog posts

Aside from emacs-news and weekly reviews:

Time

Category % 36 years % 37 years Diff % h/wk Diff h/wk
Discretionary - Productive 6.0 10.3 4.4 17.3 7.3
Personal 4.8 5.6 0.8 9.3 1.3
Unpaid work 4.4 4.5 0.1 7.6 0.2
Business - Build 0.2 0.2 0.0 0.3 0.0
Business - Earn 1.5 1.5 -0.0 2.5 -0.0
Discretionary - Social 0.6 0.1 -0.5 0.2 -0.8
Discretionary - Family 0.9 0.4 -0.5 0.7 -0.9
Discretionary - Play 1.3 0.3 -1.0 0.5 -1.6
A- 46.7 45.1 -1.6 75.6 -2.6
Sleep 33.6 31.9 -1.7 53.4 -2.8
View or add comments

2021-08-09 Emacs news

| emacs, emacs-news

Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar and emacs-devel.

View or add comments

Weekly review: Week ending August 6, 2021

| review, weekly
  • I changed my borgbackup setup so that the server backups go to a different repo.
  • We had a big harvest of cherry tomatoes, so I started dehydrating them. I want to dry them to a crisp so that I can store them at room temperature more confidently.
  • We made vanilla mug cake to celebrate W-'s birthday. For fun, we topped ours with bitter melon slices, and A- topped hers with strawberries.
  • The Brickloot balls arrived, so we opened a bag and started using them in our LEGO Great Ball Contraptions. I learned how to use the 9V motors, so we were able to rig up the sloped stepper, the pinwheel, the ball pump, the S-capade, and the crane module in a loop.
  • I suggested some changes to the EmacsConf 2021 call for proposals.

Blog posts

Time
Category The other week % Last week % Diff % h/wk Diff h/wk
Unpaid work 7.7 10.8 3.1 18.2 5.3
Discretionary - Family 0.2 1.6 1.4 2.7 2.4
Sleep 33.7 34.4 0.7 57.7 1.1
Discretionary - Productive 4.5 5.1 0.6 8.6 1.1
Business 0.7 1.1 0.4 1.8 0.7
Discretionary - Play 1.2 0.4 -0.8 0.6 -1.4
Personal 9.7 7.6 -2.1 12.7 -3.6
A- 42.4 39.1 -3.3 65.6 -5.6
View or add comments

2021-08-02 Emacs news

| emacs, emacs-news

Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, r/planetemacs, Hacker News, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar and emacs-devel.

View or add comments