Emacs Work Flow

Michael Wall has a nice post on his Emacs workflow. I found it interesting for two reasons. First, I always enjoy seeing how others solve the problems that we, as developers and Emacs users, all face. Most often, I learn sometime that I find useful and can incorporate into my own workflow.

The second reason is that, like me, Wall came to Emacs from Vim but our accommodations to the new environment were different. As Wall says, the typical Vim workflow involves firing up the editor when you want to work on a file and closing it afterwards. Emacs users, on the other hand, tend to start Emacs and just add another buffer when they want to edit a new file.

When I started using Emacs, I embraced the Emacs way and just left it running. Adjusting to that new way of working was one of the hardest parts Emacs. Now, I always have an Emacs frame up, usually beside a Safari window. Almost all my work is done in those two applications. Occasionally, I’ll bring up another application—mail say—but then either quit it or more likely hide its window.

Wall, on the other hand, decided to leverage the power of Emacs’ extensibility to adjust Emacs to his workflow rather than adjust that workflow to the Emacs way. He did that by combining Emacs server with some shell scripts to recreate the feel of a Vim workflow. The great thing about all this is how easy it is. Once again, Emacs let’s you have it your way. Be sure to follow the link to see how he does it. Good stuff even if, like me, you prefer a different way of working.

Posted in General | Tagged | 3 Comments

Password Contains Invalid Characters

Nick Selby tweets a pro tip: what to do if your site delivers the error message “Password contains invalid characters”. It’s funny, of course, but like most things we find funny, it contains the germ of truth.

Now, can we talk about not allowing spaces in credit card numbers?

Posted in General | Tagged | 1 Comment

The Reign of Morons

Even if you don’t know who Jamie Zawinski (jwz) is, you’ve probably heard his famous quip about regular expressions. You may or may not agree but there’s no denying he has a sharp wit.

Here, for your enjoyment, is his recent rant about moronic mobile web design. Not all mobile Web design is as bad as what he describes, of course, but it is shocking that the worst offenders are the big “respectable” “news” “media” sites, as Zawinski puts it. You’d think they’d know better but of course they don’t; they’re still stuck in the last century and depending on its conventional wisdom on how to run a publishing enterprise.

And while you’re over at Zawinski’s site, you might enjoy reading some of the articles from his tech docs page. They mostly exhibit that same sharp wit.

Posted in General | Tagged | Leave a comment

Eavesdropping Versus Surveillance

A common reaction to the NSA disclosures has been, “Meh, it’s just metadata.” Unfortunately, the issues are perceived as being overly technical and as a result it is difficult to explain to the man-in-the-street, let alone your Aunt Millie, how the collection of metadata is a threat and why everyone should care.

As Bruce Schneier has pointed out, lot of people have effectively demolished the argument that metadata collection needn’t concern us but the arguments are subtle and hard to convey succinctly. Schneier comes to the rescue with a pithier argument: metadata equals surveillance.

He says suppose you hire a detective to eavesdrop on someone by planting bugs and tapping the target’s phone. The fruit of that endeavor would be the details of the target’s communications. That’s the data.

Now suppose that the detective instead followed the target around and discovered what he did, where he went, who he talked to, and what he purchased. That’s the metadata. What the detective is doing in the second case is surveilling the target. The difference between the detective and the government is that the government is putting everyone under surveillance. That’s something that should concern every citizen.

Posted in General | Tagged | Leave a comment

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