Update to the Org Mode Broken Link Problem

In my Org Mode and Broken Links post I wrote about a problem with the way that Org 8 handles HTML links. If you want to know how great the Emacs Org Mode community is, read the comments to that post. First, David Maus, the developer who wrote much of the current escaping code, corrected my understanding of the problem: it’s not the escaping that’s the problem—it’s always been that way—it’s that the link was apparently not getting unescaped before export.

That was great information and pointed me to where I needed to look next: ox-html, the code that handles export to HTML. I’ve never looked at that code so I was dreading dredging through it. Happily, before I could begin, Rick, the maintainer of ox-html stopped by to report that he had pushed a fix for the problem.

Think about that for a moment. Someone on an obscure blog whines about a problem and two of the developers responsible for the code drop by to help out and fix the problem. It makes me love Org Mode even more and be grateful to be part of such a great community. A lot of this is probably true of many of the open source projects but, really, it’s hard to see how it could get much better than this.

Update: my understanding → corrected my understanding

Posted in General | Tagged , | Leave a comment

SBCL 1.1.12 Is Released

Version 1.1.12 of Steel Bank Common Lisp is out. As usual, compilation and installation on my OS X machines encountered no problems.

The new release features two enhancements (SOCKET-SHUTDOWN added, documentation for extensible sequences), two optimizations (EQUAL and EQUALP transforms are smarter and CHAR-EQUAL is faster for constant and base-char arguments), and a bunch of bug fixes (including getting SBCL to compile on Solaris x86-64). You can see the complete list on the NEWS page.

As always, I recommend SBCL to anyone looking for an excellent Lisp system. Combine it with Slime and you have the perfect Lisp “IDE.” I say perfect because Lisp is integrated into your normal editor1 in a natural way. You don’t have to learn a whole new editing system just to work with Lisp. I put IDE in scare quotes because, you know, Emacs users don’t need no strinkin’ IDEs.

Footnotes:

1

SBCL is excellent even if you aren’t an Emacs user. The only problem is you won’t have slime although there are solutions for Vim users as well.

Posted in Programming | Tagged , | Leave a comment

Messing With The Wrong People

Some people are delightfully grumpy and best not trifled with. Martha Stewart, it appears, is one of those people. For those who don’t know, Stewart runs a media empire loosely based around design, decorating, and cooking. She has her own TV show and, it happens, four iPad apps.

Enter Lodsys with an accusation of patent infringement and a demand that she purchase four $5,000 licenses. This time, Lodsys chose the wrong victim. Stewart is notoriously tough and rather than pay Lodsys to go away she filed suit asking for a declaration of noninfringement and that the patents be ruled invalid. The best part is that Stewart is filing in Wisconsin where Mark Small, CEO of Lodsys, lives and works rather than in lawsuit-friendly Marshall Texas where Lodsys is officially headquartered.

Let’s all hope that Stewart prevails and gets these nonsense patents thrown out. Maybe it will also encourage congress to get serious about reform. It’s way past time.

Posted in General | Tagged | Leave a comment

The Miracle of UTF-8

I’ve written about UTF-8 before and recounted the story of its invention one night over dinner by Ken Thompson and Rob Pike. Now Tom Scott over at audible.com has a wonderful video on UTF-8, which he calls the world’s greatest hack.

Scott gives a bit of the history—he mentions that it was designed on the back of a napkin (actually, a paper place mat as I recall) but doesn’t tell the whole story—and explains how it works and solves almost all the problems that come up with unicode encodings.

The video is under 10 minutes and well worth the time. Scott is enthusiastic about his subject and manages to impart that to his listeners. I recommend it, especially if you don’t already know how UTF-8 works.

Posted in General | Tagged | 1 Comment

H.R. 2818–Surveillance State Repeal Act

In my The New York Times on Encryption Backdoors post, I mentioned that Representative Russ Holt of New Jersey has introduced legislation that reins in the NSA and prohibits some of its more egregious activities. Although it doesn’t go far enough in my estimation, it’s an excellent start.

You can read the bill at the Congress.gov site. The link takes you to a summary of the bill but if you want to see more you can click on the Text tab to see the actual language. So far the bill has been referred to several committees (click on the Actions tab for details) but no further action has been taken yet.

Again, if you’re a US citizen, I urge you to let your representative know that you support the bill.

Posted in General | Tagged | 1 Comment

Org Mode and Broken Links

As a couple of you have pointed out to me recently, HTML links in my posts are sometimes getting broken. That happens when the link has a parameter specified with a question mark and equal sign. For example, here’s a link to one of my blog posts that gets affected

Building a Blog with Org Mode

For some reason Org Mode has started escaping equal signs in links so that the above gets turned into

http://irreal.org/blog/?p%3D2168

which is, of course, incorrect. This happens in org-link-escape, which is called by org-make-link-string when I insert a link with 【Ctrl+c Ctrl+l】. No problem, I thought, they must have added the equal sign to the list of characters to escape; I’ll just fix it up with a buffer local variable or something. Unfortunately, when I checked I discovered that the equal sign has always been there and that neither org-link-escape nor org-make-link-string have been changed in over a year.

I put in a little bit of time trying to track down what changed (it didn’t do this in Org 7 and maybe even not in the early Org 8 versions) but couldn’t find anything. I’ll keep looking but in the mean time, here’s a little bit of Elisp that I threw together to fix things up:

(defun jcs-clean-link ()
  "Clean up munged = in an Org link."
  (interactive)
  (save-excursion
    (goto-char (point-min))
    (while (search-forward-regexp "\\[\\[[^]%]*\\(%3D\\)[^]]*\\]" nil t)
      (replace-match "=" nil nil nil 1))))

I can call that before exporting the Org file to HTML and everything will be fine. I may advise the exporting function to call jcs-clean-link for me but for now I’m doing it manually.

The whole thing has not been a total waste of time, though, because I learned two new things. First, calling 【Meta+xvisible-mode shows the links as they really are rather than just the description part. I used to switch to text-mode to do this which is sort of a pain so this is a good find for me.

Second, although it doesn’t help me with the current problem, I discovered that you can set Org variables affecting export—even if they aren’t one of those supported by an option—with the BIND directive. To set variable to value, you just add the line

#+BIND: variable value

to your Org file. You also have to set org-export-allow-bind-keywords to t for this to work. Back when I thought my links were getting munged during export, I speculated that maybe XHTML Strict required the escaping and I was able to disprove that by using BIND to cause the file to be exported as HTML4.

If any of you know what’s going on with the links, please leave a comment.

Posted in General | Tagged , | 5 Comments

Emacs Regular Expression Recap

Xah Lee has a nice summary of Emacs regular expressions and how they differ from the other familiar varieties. I may have linked to an older version of this a while ago but it’s a worthwhile link for anyone who hasn’t seen it.

If you regularly use Emacs, Perl, and Unix regexs, this is a good resource to help you keep the Emacs differences in mind. You can get much the same information from the Emacs documentation, of course, but it’s handy to have a nice summary like this and you may want to bookmark it.

Posted in General | Tagged | 1 Comment

Building a Blog with Org Mode

As regular readers know, Irreal posts begin as Org Mode files that are subsequently published to WordPress with org2blog. This works very well for me but not everyone wants to run WordPress. For those of you who want to build your own blog, Bastien Guerry has a great post that shows you how to build and publish a blog from Emacs Org Mode.

It’s astounding how easy it is. Guerry walks you through the process from your first post to adding an RSS feed. What you end up with is a static blog and the associated RSS feed. In the spirit of eating his own dog food, Guerry publishes his blog this way. You can see the result by clicking on the home button at the linked post.

Guerry is an interesting guy and one of the heroes of Org Mode. For anyone interested in some background, I’ve written about him here, here, and here.

Posted in General | Tagged , | 2 Comments

Hating Apple

My friend Watts has a perspicacious tweet concerning those who hate Apple:

At times I suspect hating Apple is at least as much of a fashion
statement as buying them is.

That’s right, I think. How else to reconcile the near universal panning of the new iPhones by the technical press with Apple’s announcement that weekend sales of the new iPhones set a new record of nine million units? Apple also revealed, in the same announcement, that over 200 million iOS devices are now running iOS 7, which was mostly panned by the press as well.

Posted in General | Tagged | Leave a comment

The New York Times on Encryption Backdoors

In a bit of good news, The New York Times has published an editorial Calling on the NSA to close their backdoors. There’s nothing in the editorial that will be news to Irreal readers but it’s useful because it educates the public at large as to the issues at stake. It’s easy for us geeks, who sometimes seem to understand these things at the DNA level, to forget that to most people encryption backdoors (and even the associated massive surveillance) is (1) an esoteric technical issue not understandable by normal folks and (2) something that has no impact on their lives.

The advantage to having mainstream publications like the NYT weigh in on the situation is that it can help educate the man on the street about the risks these activities bring to all of us. The article mentions that Representative Rush Holt of New Jersey has introduced legislation that would bar the government from demanding that software makers build in backdoors to their products. If you’re a US citizen, this might be a good time to let your representatives know that you support Holt’s measure.

Posted in General | Tagged | Leave a comment