Zamansky 35: Blogging

I discovered Mike Zamansky’s blog about a year ago when I wrote about his transition to Nikola as a blogging platform. Shortly afterwards, he began his Using Emacs Series. His latest video has, in effect, come full circle as he, once again, looks at blogging with Nikola.

I always enjoy seeing other people’s workflows and particularly their blogging workflows. The video details Zamansky’s efforts to bring the entire blogging workflow under Emacs. After his transition to Nikola, a lot of the workflow was conducted on the command line. His latest improvements involve using Prodigy to manage the non-Emacs part of his workflow. He’s now at the point where virtually everything can be done from within Emacs.

Watching the video makes me appreciate anew the wonderful org2blog/wp that I use for blogging. Everything is completely contained within Emacs; I simply write my post as an Org mode file and call org2blog to post it to my WordPress site. Of course, many folks prefer static pages and don’t want to bother with a heavyweight CMS like WordPress. For them, a solution like Zamansky’s makes a lot of sense. You can do everything from within Emacs and the process is pretty much automated. There are, of course, solutions other than Nikola and I’ve written about some of them but since I don’t use them those posts could only describe what others said about them. If you’d like to start (or switch to) a statically paged blog, Zamansky’s video is a good place to start. The video is 14 minutes long.

Posted in General | Tagged , | Leave a comment

Choice Lists for Yasnippets

This will probably be up on Planet Emacsen before I have a chance to publish it but if you haven’t already seen it be sure to take a look at Ben Maughan’s really excellent tip on Yasnippets. He shows how to implement choice lists for Yasnippets.

Posted in General | Tagged | Leave a comment

Org2blog/wp and Multibyte Characters

I love blogging with org2blog. I write my posts as normal Org documents and org2blog takes care of everything else including renaming and uploading jpegs and things like that.

About a year ago, I started having problems with org2blog dying and hanging Emacs. It turned out that Emacs 25.1 had a small change that meant multibyte characters could no longer be sent by the url-http library, which org2blog uses to upload posts. I don’t have many non-ascii unicode characters in my posts but occasionally I need one for things like accented names and special characters. The most usual case is the em-dash. I can type --- and the blog will get an em-dash but for some reason I don’t understand, the RSS feed will turn that into gibberish. I solved that problem by using the TeX input mode, which inserted a unicode em-dash that worked in both places.

After Emacs 25.1, none of that worked and I had to go to great lengths to get names accented correctly. And, of course, the em-dashes in the RSS feed were broken again. I worked sporadically at fixing things but even though I knew what the problem was I couldn’t get it working. Now Grant Rettke has opened a Pull Request to the xml-rpc library that solves the problem.

If you’re an org2blog user and are having the same problem, you can wait until the patch gets merged or you can simply apply it yourself to xml-rpc.el. It’s only 3 lines so it’s simple to do it by hand. In any event, many thanks to Grant for resolving this problem.

*UPDATE [2017-06-26 Mon]: Grant has posted a copy of the complete file if you want to grab a copy.

Posted in General | Tagged , | Leave a comment

Police State

What could go wrong?

Posted in General | Tagged | Leave a comment

Protecting Line Breaks from Fill

Here’s a nice tip from Marco Wahl on protecting line breaks from the fill command in Org mode.

Posted in General | Tagged , | Leave a comment

Make M-RET better in Org Mode

If you’re an Org mode user you probably know that Meta+Return can be used to create a new headline, list item, or table field. One minor annoyance is that by default it will split line you’re on at the point, which is almost never what you want. Therefore, I’ve developed the habit of always going to the end of the line before invoking Meta+Return.

Silly me. This is Emacs so of course there’s a way to get the desired behavior: merely set org-M-RET-may-split-line to '((default . nil)) as explained in this Emacs subreddit post.

Actually, you can have finer control by setting it for headlines, list items, or table fields individually. The “default” selection as shown above chooses the result for any not already listed. Check out the org-M-RET-may-split-line variable documentation for details.

It’s not a big thing, of course, but making that change will definitely make my life a bit easier.

Posted in General | Tagged , | Leave a comment

Aaaaaaand We're Back

Irreal headquarters are back on the Internet and will resume its quest for world domination forthwith.

Posted in Administrivia | Leave a comment


Internet access to the International Headquarters of Irreal has been disrupted due to a cable cut. Our regularly scheduled program will resume as soon as it's fixed.

Posted in Administrivia | Leave a comment

The Inevitable End of Government Surveillance

Kontra gives us a useful reminder:

Here’s the backstory from the New York Times.

Posted in General | Tagged | Leave a comment

More Font-locking Fun from Fuco1

The other day, I wrote about Fuco1’s efforts to add some context awareness to Emacs font-locking. Now he’s back with a new font-locking problem. This time, he wants to highlight interpolated variables in quoted strings in shell code. Those of you familiar with the Unix way will recall that there are two situations: variables will be interpolated in double-quoted strings but not in single-quoted strings. Fuco1 wants to distinguish the two cases by highlighting the first case but not the second. Thus we want

Foo = "bar"
String1 = "We want highlighting for $Foo in this string."
String2 = 'But no highlighting for $Foo is this string.'

This is another case where the font-locking has to be context aware: we want it in a double-quoted string but not in a single-quoted string so the context of where the interpolated variable appears matters.

As Fuco1 said in his original post, you can substitute a function for the normal regular expression controlling font-locking as long as the function has the same interface and returns as re-search-forward. Check out Fuco1’s post for how he solved the problem. If you, like Fuco1, have a refined sense of style in such matters, you can install his code and get his results yourself.

Posted in General | Tagged | Leave a comment