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

Outage

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

Xah’s Tutorial on Text Properties

Xah Lee has a new page out in his Emacs Lisp Tutorial that serves as a 10 minute introduction to text properties. Text properties are one of those things that you probably won’t need to fiddle with directly unless you are writing a (major or minor) mode but you often see them mentioned in such commands as buffer-substring-no-properties, which is a common function that anyone might use to write Elisp that manipulates text. So even if you don’t use them directly, it’s nice to know what they are and how they work.

The tutorial just gives you a flavor of what you can do with properties but it links to the full documentation if you really want all the details. It’s pretty easy to deal with the properties, as you’ll see when you read the tutorial.

I haven’t written about Lee’s tutorial for some time but I thought this new page was interesting and that others might enjoy it too. Lee has done a lot of work on the tutorial since I last mentioned it and it looks pretty good and is easy to navigate. One thing I especially like is that hovering over a function will pop up the doc string for that function so it’s easy to follow the action if an example uses a function you’re not familiar with.

If you work off-line a lot or just want to help out, you can buy a copy of both the Emacs and Emacs Lisp tutorials for $25.

Posted in General | Tagged | 1 Comment

Finally!

It appears that at long last even the U.S. Senate is getting tired of the Intelligence Community’s dissembling on the abuse of §702 of the FISA act. They are insisting that they be informed of the number of Americans caught up in §702 surveillance. The answer should be essentially none because it’s against the law for Americans to be targeted.

Of course, as we know from Snowden and declassified FISA orders, thousands (or more)of Americans are routinely having their communications swept up in NSA operations. The point is, we don’t know because the Intelligence Community, despite numerous promises to do so, has refused to give the legislators the number.

The senators, finally, are fed up. They have, it turns out, a big stick to use to break the information free. Section 702 is up for renewal this year and there is a growing bipartisan willingness to hold up the reauthorization if the spooks don’t start playing by the rules. The usual suspects, of course, are trying to push through a permanent renewal with no changes but perhaps this time senators who have actually read the Fourth Amendment will prevail. One can only hope.

Posted in General | Tagged | Leave a comment