2019-05-20 Emacs news

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

Adding :target option for the TOC keyword in Org Mode

Now that A- can be counted on to happily play with a babysitter for several hours once a week, I’ve decided to alternate consulting and personal projects. Two weeks ago, I used my personal time to make a script that renewed my library books automatically. This week, I set aside time to look at Org Mode. DC had asked me to update the patch I made to allow people to specify a target for the table of contents, and I was curious about whether I could hack something together.

Patch for adding :target to TOC keyword

Here’s a sample file that shows what I mean:

#+OPTIONS: toc:nil
* Not this section
** Heading X
** Heading Y
* Target
  :CUSTOM_ID: TargetSection
** Heading A
** Heading B
* Another section
#+TOC: headlines 1 :target "Target"

Here’s the core of how to make it work for HTML exports:

(defun org-html-keyword (keyword _contents info)
  "Transcode a KEYWORD element from Org to HTML.
CONTENTS is nil.  INFO is a plist holding contextual information."
  (let ((key (org-element-property :key keyword))
  (value (org-element-property :value keyword)))
     ((string= key "HTML") value)
     ((string= key "TOC")
      (let ((case-fold-search t))
   ((string-match "\\<headlines\\>" value)
    (let ((depth (and (string-match "\\<[0-9]+\\>" value)
          (string-to-number (match-string 0 value))))
      ;; link
      ((string-match ":target +\"\\([^\"]+\\)\"" value)
       (let ((link (with-temp-buffer
           (insert (org-make-link-string (match-string 1 value))))
         (pcase (org-element-property :type link)
           ((or "custom-id" "id") (org-export-resolve-id-link link info))
           ("fuzzy" (org-export-resolve-fuzzy-link link info))
           (_ nil))))
      ;; local
      ((string-match-p "\\<local\\>" value) keyword))))
      (org-html-toc depth info scope)))
   ((string= "listings" value) (org-html-list-of-listings info))
   ((string= "tables" value) (org-html-list-of-tables info))))))))

It was a lot of fun Doing the Right Thing(s): writing documentation, adding tests, and making it work for more than just HTML export. I found out where to make the changes by using grep to search for TOC in the Org Mode source code. All the heavy lifting was already done by org-export-collect-headlines, so it was just a matter of passing the right scope. It took me a while to figure out that I needed to pass an Org link element. An easy way of making that element work for both fuzzy and ID-specific links was to insert the target text into a temporary buffer (remembering to use org-make-link-string) and then calling org-element-link-parser.

I tried figuring out how to make it work with a link to another file, but I didn’t get very far, so I figured I’d just wrap things up nicely there.

I wasn’t sure if my original post made it through because I sent it through Gmane and Cc:d DC, who got it with an empty To:, so I ended up submitting it twice. I just realized I forgot to add test-ox-ascii.el. I don’t want to spam the list, so I’ll send that along with other changes if people have feedback.

But look! Open source contributions! I’m so excited. I wonder what I’ll get to do in two weeks from now. =)

Weekly review: Week ending May 10, 2019

  • Kaizen
    • W- replaced the dish rack because the coating on the old one had worn down.
    • A- slept so early, I had some bonus focused time in the evening. I reviewed my old tasks and organized my Org agenda a bit more.
    • W- bent the cup holders on the new dish rack to make them more functional.
  • Us
    • Sourdough pancakes: so fluffy!
    • Sourdough pancakes: More sourdoughy, yum yum
    • Sourdough grissini (breadsticks): Burned half of the batch, but it still worked out great after I cut away the black parts. I put them in the bag too early, though, so condensation made them a bit stale. Try and try again!
    • W- braised some beef. It was so tender and yummy.
    • I made sourdough rye bread for the first time. It was a little moist inside, but it still turned out yummy.
  • Gross motor
    • A-‘s been working on balancing in the tree pose all by herself.
    • A- wanted to leave school early to go to the park behind Runnymede library. She climbed and slid down a few times.
    • A- was curious about the exercise equipment at the park, so we played there a bit.
    • At the swimming pool, A- liked floating in her Puddle Jumpers, venturing a little further away from me. She also practised getting out of and into the pool. She accidentally took in a little water, so I hugged her to help her calm down. After a few minutes, she was ready to play some more.
  • Fine motor
    • The craft activity at school was to make a Mother’s Day card. She decided to make one for Daddy instead. In addition to lots of back-and-forth scribbles, she also practised writing, drew a circle and shaded inside it, and carefully shaded a corner.
  • Language
    • A- used the words “our” and “ourselves” correctly.
    • A-‘s random word of the day: abomasum (a cow’s fourth stomach), because we’ve been reading books about milk production.
    • We were waiting to check out at the store when A- told me that she needed to go to the bathroom. I asked her if she could wait approximately ten minutes, or if we needed to leave our cart and go now. She thought about it and said, “Six minutes.”
    • “You are so Tagalog-y.”
    • Me: “It looks like there’s a small slide, too.” A-: “Hmm. How convenient.”
  • Self-care and independence
    • A- switched to using the electric toothbrush again. She’s getting pretty good at brushing her teeth by herself.
    • I explained to A- that I would need to focus on cooking for about half an hour. She agreed to play independently, and mostly managed to do so while I cooked broccoli and tonkatsu.
    • At bedtime, A- told me that she wanted to go to sleep on her own. “Do Mom things,” she said, so I did. Thirty minutes later, she called for me via the baby monitor, and asked if she could sleep on top of me.
  • Sleep
    • A- wanted to go to school after nature class, so she napped while I carried her.
  • Emotion
    • A- had a big tantrum because she was frustrated when she asked for a video and I said no. It overlapped with another tantrum because I ate the muffin on her plate. She fell asleep in the carrier after crying.
    • A- asked me to read The Day You Begin. As I read the story about feeling like you’re on the outside, I asked her if it’s like how she feels when kids stare at her eye. She nodded.
  • Household
    • A- helped clean the mirrors and the glass door.
  • Social
    • A- enjoyed playing with the babysitter for 5 hours. A- said she even had a nap. She wants to try a longer session. We’ll try 6 hours next week, so it’s a little more like a kindergarten day.
    • We invited Jen, Ewan, and E- over for burgers. A- and E- had lots of fun dancing, playing with balls, building contraptions, and hammering.
    • We visited Joy and J-. The kids had lots of fun playing with toys, jumping on the bed, and listening to stories.
    • We had so much fun playing a game where I’d tell A- she wasn’t allowed to pounce on me, and she’d gleefully tell me she’s allowed and would pounce anyway.
    • We had dimsum with W-‘s family. A- have people high fives.
  • Pretend
    • A- pretended to be a flight attendant. She wanted to pour soy milk for me, and to put food and drink on a tray.
  • World
    • A- said, “I want to go out to the open meadow.” (She meant the backyard.) She played with bubbles and giant bubbles in the deck.
    • We watched a dump truck drop off a bin and pick up another bin.
    • We had fun squelching through mud in nature class. A- also fed the turtle and explored the sandbox.
    • We had a little time before swimming, so we watched workers repair the road.
  • Oops
    • Oops! Lost A-‘s blue Crocs because I didn’t look behind me, and I did the shoe check when I stepped out of the subway train.
  • Thoughts
    • Realization: When I have snippets of free time, I don’t usually use that time to draw. I read, write, or code.

Blog posts


Category The other week % Last week % Diff % h/wk Diff h/wk
A- 33.5 45.9 12.4 77.1 20.9
Unpaid work 1.8 5.8 4.0 9.7 6.8
Discretionary – Play 0.0 3.2 3.2 5.4 5.4
Business 0.0 2.5 2.5 4.3 4.3
Sleep 34.0 36.3 2.3 60.9 3.9
Discretionary – Productive 0.0 1.2 1.2 2.0 2.0
Personal 3.1 4.1 1.0 6.8 1.7
Discretionary – Social 0.0 0.7 0.7 1.2 1.2
Discretionary – Family 27.7 0.3 -27.5 0.4 -46.2

Weekly review: Week ending May 3, 2019

  • Kaizen
    • I spent a little while trying to fix the playdough by adding flour and cream of tartar. It got less sticky and more elastic, although I think I made it a little stiff.
    • W- made pizza dough from scratch. It was nice and elastic.
    • We asked for some of Tita Annet’s sourdough starter.
    • Next time I fly, I should definitely wear my sandals on the plane.
    • We used baking soda to get rid of the ring in the bathtub. W- cleaned up lots of things in the house, too.
  • Us
    • It turned out that the external drive that I had brought over to Kathy for use as her offsite backup already had a copy of her files from 2017, when my dad had mistakenly grabbed the drive and given it to me. That was pretty convenient, actually, as it had some files she wanted to copy.
    • Bert Jan showed us the Point It book that they’d found tremendously useful on their trips. I wonder if something like that might be fun to share with A-.
    • We visited Dan and Bert Jan. We chatted about fandom, travel, tai chi, healthcare, practical knowledge, parenting, the environment, feminism, and pockets. A- had fun with the crayons, playdough, and toys they happened to have lying around.
    • It was nice to go from downtown Den Haag to a large, quiet park.
    • We observed G-‘s horse riding lesson.
    • We went to the children’s farm, the supermarket, and the bank.
    • We met Kathy’s neighbours, who were just as awesome as described.
    • W- cooked bibimbap and we invited Kathy’s neighbours over.
    • Dan visited us and shared more stories about her travels.
    • It was a good idea paying for Vodafone NL’s 10 euro bundle. I used 300mb and a handful of texts.
    • Going through Pearson still sucks. The line at customs was long, and we waited even longer because we declared the food we’d brought.
    • We took the subway home, although the luggage wheels didn’t survive the walk. W- is determined to get a two-wheeled suitcase next time – something with big wheels.
    • It turns out the plants that I thought weren’t chives were actually chives. Also, the spring onions are growing well.
  • Gross motor
    • A- liked playing with the Stomp Rocket. The kids suggested playing outside, but two of the rockets landed too far (one in the neighbours’ back yard, one on the roof), so I redirected them to something else.
  • Fine motor
    • A- was really interested in the Connect 4 game. She liked dropping the yellow markers into the grid, taking turns, and clearing the grid of all the markers. She didn’t play to win, of course.
  • Sensory
    • A- liked the playground with the zip line. W- whizzed her up and down the zip line a few times.
    • So much water play inside and outside!
  • Language
    • I told A- a little about how her brain is still developing a lot and why some things are hard for her to do right now. Some time later, I heard her tell AG, “My brain is still developing.” The next day, I heard AG (who’s 5 years old) say that her brain was still developing too.
    • A- was pretending to sleep. She said, “Honk shu, honk shu, letter zzzzzzzz.”
  • Music
    • The precorder and Suzuki recorder arrived! They both sound nice. W- made a recorder stand.
  • Self-care and independence
    • A- asked for teething medicine, so we gave her half a junior acetaminophen.
  • Eating
    • W-, A-, and I all liked haring. A- had quite a few bites. We also liked kibbeling.
  • Sleep
    • “I’m not tired, I’m not tired,” A- protested. A little while later, I noticed she was spacing out while playing with playdough. She accepted my offer to take her upstairs and fell asleep in my lap while I tidied up the playdough. She woke up just enough for me to brush her teeth before I put her to bed.
    • Because the plane book I made mentioned that we sleep when the lights are dimmed, A- asked us to ask the flight attendant when the lights will be dimmed. He said he’d ask the captain, since it was a daytime flight. When the lights were eventually dimmed, A- settled down for a nap.
  • Emotion
    • We were all cranky, tired, and hungry by the time we got home, but our mood improved after food.
  • Household
    • A- folded kitchen towels, matching the corners precisely and then folding into thirds.
  • Social
    • I spent the day hanging out with the kids at home. It mostly went smoothly, although I think A- got a little jealous and tired towards the end.
  • Cognition
    • W- started teaching A- how to play a memory game with cards. She got the idea of matching, but was a little fuzzy on taking turns.
  • Other
    • W- and A- found a canister of spray lubricant in the plane’s bathroom. They turned it in and the flight attendant joked about A- having squeaky knees.
  • Oops
    • I forgot my water bottle at the stables.

Blog posts


Category The other week % Last week % Diff % h/wk Diff h/wk
Discretionary – Family 6.6 27.7 21.2 46.6 35.6
Personal 2.9 3.1 0.2 5.2 0.3
Business 0.0 0.0 0.0 0.0 0.0
Discretionary – Play 0.0 0.0 0.0 0.0 0.0
Discretionary – Social 0.0 0.0 0.0 0.0 0.0
Sleep 34.9 34.0 -0.9 57.1 -1.5
Unpaid work 3.5 1.8 -1.7 3.0 -2.9
Discretionary – Productive 8.9 0.0 -8.9 0.0 -15.0
A- 43.2 33.5 -9.8 56.2 -16.4

Weekly review: Week ending April 19, 2019

  • Kaizen
    • I reverted to Disqus comments for spam filtering.
  • Us
    • Instead of sleeping or doing productive things, I decided to play Borderlands 2 a lot with W-. It was almost like old times!
    • I organized my travel clothes.
    • I checked out Emerald City since W- had watched a few episodes.
    • I thought about whether to find an independent babysitter or to continue with an agency. It’s actually kinda nifty getting such different babysitters each time, and it’s nice not having to mess around with screening or scheduling.
    • I made lasagna.
    • I hemmed my pajama pants and W-‘s sweatpants.
  • Gross motor
    • A- walked a lot. She wanted to go to Riverdale Farm, so she walked to the subway, from the bus to the farm, and from the farm to the playground.
  • Language
    • “Can you sing a French song? how about Frere Jacques?”
    • Me: “How about pancakes?”
      A-: “Christmas tree pancakes?”
      Me: “We can’t, we don’t have spinach. Plain?”
      A-: “Oh, but we have food coloring!”
      Me: “We try not to use it.”
      A-: “But it’s food!”
    • We were talking about her side and my side of the sungka board. She outlined her part with her hands and said, “My sungka moira, your sungka moira.”
    • A- wanted me to read “Ang Aking Paligid.” When we got to the page with the dress, she decided to change into her yellow dress. She asked me to bring the book upstairs and open it to the page. After she changed into her dress, she said, “Nasaan ang libro?” Her first Tagalog question!
    • “I call myself ‘girl’ and I call Daddy ‘de jongen.'” For the second time, I’ve had to explain to a somewhat bewildered grown-up that A- has picked up a Dutch word from my attempts to learn through Duolingo.
    • I had fun watching A- and the sitter walk to school. The sitter kept the conversation going by pointing out lots of interesting details.
    • “I’m just making up random words.”
    • A- turned to W- and asked, “Are you strong enough to carry a cantaloupe?”
  • Music
    • After a few days of asking me to sing the “eh” song (her name for Sitsiritsit, because of the line “ang babae sa lansangan”), she suddenly sang the whole first stanza pretty clearly.
    • Since A- could sing the first stanza of Sitsiritsit, I started singing Lupang Hinirang to her as well. She said, “I like listening to Tagalog songs.”
  • Self-care and independence
    • I asked A- if she wanted to have more babysitting time. She asked for more days, and she said, “I want to be more independent.”
    • A- drank so much water at bedtime. Still made it to the bathroom the next morning, whew!
    • A- got the hang of gargling, and did it half a dozen times.
    • A- wanted to try sleeping under blankets instead of in her sleep sack. She asked for all three blankets to be piled on top of her.
  • Eating
    • Carnitas: I tried the pre-marinated pulled pork from the supermarket deli. Success! Good in a burrito. A- even had some.
    • A- really liked fishballs.
    • A- asked for a watermelon. She really enjoyed eating it for evening snack.
  • Sleep
    • A- decided to sleep on the crib mattress in her small sleep sack. She chewed on her gum massager for a few minutes and then fell asleep.
    • A- resisted going to sleep. She eventually got upset enough to ask me to brush her teeth, carry her in the carrier, put her in sleep sack, and walk around.
  • Emotion
    • A- had a tantrum in the basement. She wanted to pick up more metal items with her magnet instead of coming upstairs with me. I was worried that she was starting to sound too tired, so I wanted to at least get her out of the workshop before she melted down. I counted, then carried her out. She cried and asked for W- instead, so he swapped in and I washed dishes upstairs. She eventually calmed down with him, and they went through the bedtime routine. She fell asleep in bed early, so yeah, she was pretty tired.

      A gentler approach might have been for me to ask her to set a limit (how many more games of pick it up?), because she tends to respond well to agreements. She was stonewalling a bit on going upstairs, though. Maybe I could have exaggerated the silliness by talking about bringing down pillows and blankets. I didn’t really need to herd her upstairs so that I could wash the dishes. If she spent another half an hour playing and then had a tantrum about that or something else, I could still offer comfort after washing hands. So yeah, room for improvement on my part too.

      Hmm… I don’t think counting is a technique that works well for us at the moment. Let’s see if there are other ways to defuse the situation next time she wants to keep playing…

    • Lots of shrieking – A- seemed to be frustrated about something.
    • I talked to A- about videos and compared it to being a visitor: enjoy, but always be ready to let go.
    • A- had a tantrum when I was too tired to carry her in the carrier, but she calmed down after I rested and then asked her how many times she wanted to go around in the carrier.
  • Social
    • We brought Melissa and H- some chicken pot pie and chocolate-zucchini muffins. A- practised being a visitor, following H-‘s suggestions for things to play with and letting her take things back as needed. Both of them did pretty well.
    • One trick to making morning brushing go more smoothly is to let her brush my teeth. While doing so, she said, “Open wide, my little dear.” A short while later, she said, “I want to take lots of care of you.”
    • J1 makes appreciative sounds while eating. A- started doing the same while eating next to her.
    • J1 and A- took turns very smoothly with J1’s rocking horse.
    • I asked A- if she wanted to go to school, visit a friend, or invite a friend over. She chose to invite J1 over, so Joy, J1, and J2 came. A- was a pretty good host, amiably sharing most of her toys, and mostly keeping her cool when she asked for a toy back. J1 was fascinated by the cats and by the piano. We all had a good time.
    • A- wanted to go to school (really a drop-in centre) with the babysitter. She asked me to come along and stay in the yard while she played inside with the sitter. I packed my laptop, RSA token, phone, Bluetooth keyboard, sketchbook, and book. I told A- that I’d stay there for as long as I could, and that I’d also come and pick them up once school was done. A- walked all the way to school holding the sitter’s hand while I followed them with the stroller. She went inside while I stayed in the yard, and then came out again for lunch break. I worked while my laptop battery lasted, then said goodbye and headed home. When I went back to pick them up, I offered A- a choice of staying for circle time and going home with me, or walking home with the sitter. She picked the sitter, and we made it home in time for the end of our babysitting session. Yay!
    • We chatted with Lola. A- liked interacting with her.
    • A- wanted to invite Melissa and H- over. A- and H- had fun blowing bubbles, jumping on the bed, playing with blocks and animals, eating muffins, and pretending H- was a baby.
    • We went to AO’s birthday party. A- was a good guest. She enjoyed the pizza, played with toys, shared her bubbles, and gave things back whenever AO wanted them again. We went to the park afterwards and spent some time on the swings.
  • World
    • At Riverdale Farm, we had fun watching the ducklings, chicks, and goats.
    • A- was very curious about her body, so we talked about her body for a bit.
  • Other
    • A- liked playing with a small doll at school, and she often pretended to take care of me or other people. I ordered a doll for her. I also bought the Playing Preschool PDF for theme and activity ideas.

Blog posts


Category The other week % Last week % Diff % h/wk Diff h/wk
Discretionary – Social 0.6 4.2 3.6 7.0 6.0
Discretionary – Play 2.0 4.7 2.6 7.8 4.4
Unpaid work 6.6 6.8 0.2 11.5 0.3
Business 1.8 1.9 0.1 3.2 0.2
Discretionary – Family 0.6 0.1 -0.4 0.2 -0.8
Discretionary – Productive 3.6 2.8 -0.7 4.7 -1.2
Sleep 35.8 34.5 -1.3 58.0 -2.2
Personal 12.6 10.6 -1.9 17.9 -3.2
A- 36.4 34.3 -2.2 57.5 -3.6

2019-05-13 Emacs news

Update: Added link to Paris meetup on May 21.

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