Publishing Emacs News as plain text, HTML, and attached Org file

Update 2016-02-05: Since @ThierryStoehr linked to this post about Emacs News-related code, I figured I’d add a link to the other support functions I’ve been using to help me with Emacs News summarization. There’s also this bit:

(let ((date (org-read-date nil nil "-mon")))
    (concat
     (my/org-list-from-rss "http://planet.emacsen.org/atom.xml" date) "\n"
     (shell-command-to-string (concat "~/bin/list-reddit-links.coffee emacs " date)) "\n"
     (shell-command-to-string (concat "~/bin/list-reddit-links.coffee org-mode " date)) "\n"
     "- New packages:\n"
     (my/list-new-packages) 
     "\n"))

Handy little things!

——

I’ve been publishing these weekly summaries of Emacs-related links on my blog and to the emacs-tangents mailing list / newsgroup. I started by posting plain text from Org Mode’s ASCII export, and people asked for Org Mode and HTML formats. So here’s some code that prepares things for pasting into a Gnus message buffer.

It turns out that order matters for multipart/alternative – start with plain text, then include richer alternatives. First time around, I put the HTML version first, so people didn’t end up seeing it. Anyway, here’s something that shows up properly now: text/plain, then text/html, with text/x-org attached. The heavy lifting is done with org-export-string-as, which exports into different formats.

  (defun my/share-emacs-news ()
    "Prepare current subtree for yanking into post."
    (interactive)
    ;; Draft Gnus article
    (save-restriction
      (org-narrow-to-subtree)
      (let ((org-export-html-preamble nil)
            (org-html-toplevel-hlevel 3)
            output)
        (setq output
              (apply
               'format
               "<#multipart type=alternative>
<#part type=\"text/plain\" disposition=inline>
%s
<#/part>
<#part type=\"text/html\" disposition=inline>
%s
<#/part>
<#/multipart>
<#part type=\"text/x-org\" disposition=attachment name=\"emacs-news.org\">
%s
<#/part>
"
               (mapcar
                (lambda (format)
                  (org-export-string-as (buffer-substring (point-min) (point-max)) format t))
                '(ascii html org))))
        (kill-new output))))

Howard Abrams showed me something like this in June 2015’s Emacs Hangout (~1:18:26) using org-mime-org-buffer-htmlize, which probably does the job in a much cooler way. =) I thought he had a blog post about it, but I can’t seem to find it. Anyway, there’s my little hack above!

Monthly review: January 2016

January was mostly about planning, people, and preparations. I re-read my blog posts and reviewed my sketches as part of my annual review process. It was great to see the overall patterns from 2015, and from the past ten years that I’ve been here. =)

We had W-‘s family over for a holiday dinner, and we cooked lots of food. Unfortunately, our source for pork belly closed soon afterwards, so we’ve been checking out different places to find a new favourite.

I’ve been gradually transitioning my consulting tasks over to the team. They’re doing wonderfully, and will probably do even more awesome things than I can pull off. =D I’ve also been building little tools for myself, like a web-based interface that lets me use the tablet to review my sketches. Some sewing, some decluttering, some freezer cooking… Everything’s pretty much ready for the next step.

Let’s see how February goes!

2016-02-02c January 2015 -- index card #monthly #review output

Blog posts

Sketches

Time

(my/quantified-compare "2015-12-01" "2016-01-01" "2016-01-01" "2016-02-01" '("Business - Build" "Discretionary - Play" "Unpaid work" "Discretionary - Social" "Discretionary - Family" "Sleep" "Business - Connect" "Business - Earn" "Discretionary - Productive" "Personal"))

2016-02-01 Emacs News

Update 2016-02-02: Added Hacker News links.

Links from reddit.com/r/emacs, /r/orgmode, Hacker News, planet.emacsen.org, Youtube, the Emacs commit log, the changes to the Emacs NEWS file, and emacs-devel.

Past Emacs News round-ups

On routines and depth

A few threads of thought coming together:

  • coming across the Atlantic article Why I Am Not a Maker again, and reflecting on the differences between creating a product and providing a service (particularly a service with results that are hard to measure, or that are repeated)
  • noticing the gradual shift in my 5-year experiment towards becoming more comfortable with routines and not just getting tangible stuff done
  • preparing my mindset for the next phase of the experiment

2016-01-27b Products, services, and routines -- index card #making #services #products

2016-01-27b Products, services, and routines – index card #making #services #products.png

2016-01-25f Do I devalue the other things I'm learning about -- index card #life #learning

2016-01-25f Do I devalue the other things I’m learning about – index card #life #learning.png

I wonder: do I unfairly devalue the other things I do, the other opportunities I learn, because they don’t resemble the things that I’m used to thinking of as opportunities for growth and learning?

2016-01-29b Routines and depth -- index card #learning #perspective #routines

2016-01-29b Routines and depth – index card #learning #perspective #routines

Routines such as vacuuming the house or cleaning the kitchen don’t yet tickle my brain the way coding or sewing do. There’s a sense of satisfaction in clearing the sink, sure, but it’s not something that feels like progress during my weekly reviews, and it doesn’t feel like growth in terms of capabilities.

But maybe that’s a perspective thing, and perspectives can be tweaked.

For example, let’s take vacuuming. It takes me about 30-40 minutes to do a quick vacuum of the house. It doesn’t seem like there’s much more to it. You don’t really have 10x vacuuming the way people talk about 10x programming. On the other hand, vacuuming can be an opportunity to practise concentrating on thoughts and questions despite background noise. It could also be an opportunity to look closely at my surroundings and come up with ideas for decluttering stuff or streamlining routines. I could generate questions for further research. If I do a bit of reading before hand, I could mull over those thoughts while vacuuming.

What about cleaning the kitchen? That’s fairly static. I do it in one place, instead of going through the rest of the house. Most items can go into the dishwasher, but there are a number of things that need to be washed by hand. I could use that time to pay close attention to sensation and anatomy, learning more about the muscles and bones in my hands. I can also learn more about and reflect on the manufacturing technologies and supply chains that made this kitchen possible. Then there’s thinking about the meal we’ve just enjoyed, practising the sense-memory of the tastes and thinking about what to tweak next.

I wonder what else I can do to stack the deck so that these maintenance tasks feel as valuable to me as my more discretionary tasks. I think there might be surprising depth in these activities, like the way monks turn sweeping or walking into moving meditations. It’ll get even awesomer as I get better at seeing the possibilities.

(In case you’re wondering, W- does household chores too. He often brings home groceries, cooks, cleans the kitchen, folds laundry, and works on projects. He handles all the heavy stuff, too. I feel good about our current household workload. Besides, chores took up less than 8% of my total time over the past year, anyway – less than two hours a day, compared to >= 23% discretionary time. =) Plenty of time for other things!)

Weekly review: Week ending January 29, 2016

Another week of preparation. I’ve been gradually turning over more and more of my consulting work to the team, and they’re doing a wonderful job. =) So excited! I hope I’ll be able to check back in with them afterwards to see where they take all of this.

This week’s freezer-filling frenzy was all about lumpia. There are 130 spring rolls in the freezer at the moment. I still have some filling and a package of 50 wrappers in the fridge, so I’ll see how many of those I can fit. Not much freezer space left, though!

Helped J- review for her physics final exam. It was a little frustrating when some of our answers didn’t line up with the answers provided on the review sheet. This is the last physics course she needs to take with this teacher, though, so we’re not stressing out too much about it.

More long walks this week, since I’ve been making that a priority – an average of almost 8k steps a day, with slightly over an hour a day of walking at about 2.6mph (according to the pedometer app I have on my phone). I usually go to the library to drop off and pick up items, and then the supermarket to pick up whatever supplies we need. Nice to get out, and layers keep me warm despite winter.

Next week: more walking, maybe some sewing… We’ll see! =)

2016-01-30a Week ending 2016-01-29 -- index card #journal #weekly

output

Blog posts

Sketches

Focus areas and time review

  • Business (15.8h – 9%)
    • Earn (8.1h – 51% of Business)
      • ☐ [#A] Do monthly data dump
      • ☐ Earn: E1: 1-2 days of consulting
    • Build (7.1h – 44% of Business)
      • Drawing (7.1h)
      • Paperwork (0.0h)
    • Connect (0.6h – 4% of Business)
  • Relationships (11.0h – 6%)
    • ☑ Coordinate lasagna drop-off for Ewan and Jen
  • Discretionary – Productive (6.6h – 3%)
    • Emacs (2.4h – 1% of all)
      • ☑ Do another Emacs News review
      • ☐ Do another Emacs News review
    • Sewing (1.1h)
    • Writing (0.7h)
    • ☑ Buy toner for printer
  • Discretionary – Play (12.0h – 7%)
  • Personal routines (24.6h – 14%)
  • Unpaid work (27.9h – 16%)
  • Sleep (70.2h – 41% – average of 10.0 per day)

Helping with physics

J-‘s grade 12 physics exam is tomorrow. She’s been working through the exam review sheets that her teacher gave the class: forces, friction, gravity, relativity. The review sheets give the expected answers, so she can check her work. She asks for help when she can’t figure out how to solve the problems, or when her solution doesn’t match up with the provided answer.

I’m usually the one to help with homework, since I can speed-read tutorials to refresh my memory or dig into a new topic. Sometimes it’s just a matter of nudging her towards one equation or another, or pointing out where she forgot to square a number or change a sign.

Sometimes we’re both stumped, when my calculations show her math looks reasonable and I don’t see why the answer should be different. This has happened a number of times in Physics. We’ve asked her to talk to her teacher and ask him to help her step-by-step, but she hasn’t gone yet. Maybe she feels a little intimidated, or maybe lunch break is too crowded, or maybe he’s hard to track down?

Fortunately, her physics teacher seems to be in the habit of reusing material posted online. When I search for the text of the question, I can sometimes find other people who have asked for help with the same problem, or a review sheet from a different school.

For example, we were getting stuck on a problem that started with “A fuzzy Velcro ball of mass 200 g strikes and sticks to a Velcro block (100 g)…” We solved it in a way that made sense to us, but our answer didn’t agree with the one provided by her physics teacher. The only search result on Google was this sheet of practice questions. It didn’t contain any solutions, though, so I nearly gave up there.

After making some headway on other problems, though, I thought I’d come back to that one and see if we could turn up additional resources. You can sometimes get to interesting places when you start playing around with URLs. The file’s top-level domain https://rosedalephysics.wikispaces.com/ is a public wiki for Rosedale Heights School of the Arts. The exam review on the sidebar didn’t match the exam practice document we were looking at, but a search through the Pages and Files section for June 2014 (which I picked up from the practice questions filename) turned up worked-out solutions. It confirmed that our answers and our methods were correct, and that the answer provided by J-‘s teacher was wrong. Maybe it was a typo, maybe he made a mistake, whatever. I can sympathize; I’ve made my share of mistakes as a teacher! Anyway, I’m glad J- asked for help and that we could clear up that mystery.

2016-01-25d Helping with physics exam review -- index card #studying #tutoring #family #school

We should probably bring it to the attention of J-‘s teacher at some point. Incorrect review answers can lead to lots of frustration, second-guessing, and a lack of confidence. Maybe W- can mention it at the next parent-teacher interview, or J- can talk to her teacher after the exam. Anyway, I guess it’s a good lesson in dealing with fallability, being resourceful, double-checking, and sometimes just trusting yourself anyway.