Ido Vertical Mode

A couple of days ago, I mentioned how much I’m enjoying ido-vertical-mode. I first learned about it from Sacha Chua’s chat with Magnar Sveen as I wrote about previously.

Now, serendipitously, Bozhidar Batsov over at the excellent Emacs Redux is also writing about it. Like me, he’s a fan and included an animated gif in his post that shows what ido-vertical-mode looks like in action. Take a look and see if you agree that it makes the information easy to read.

I admit I was a bit skeptical before I started using it. It seemed somehow un-Emacsy—silly, I know—but after using it for a few days I was a convert. Try it out and see if it works for you too.

Posted in General | Tagged | Leave a comment

Judge Rules Against the TSA

Back in December, I wrote about the government’s dubious tactics aimed at preventing a woman placed on the no-fly from getting a fair trial on the matter. Because the woman is not a U.S. citizen, the government attempted to keep her from testifying by refusing to give her a visa. Then they attempted to keep her daughter, who is a U.S. citizen, from testifying by placing her on the no-fly list so that she couldn’t get home from visiting her mother in Kuala Lumpur. Then they lied to the judge, denying that any of it had happened.

Now the trial has concluded and the judge has ruled against the TSA on practically every point. The ruling itself is sealed until April to give the government time to appeal but the judge did release a summary. If you’re a U.S. citizen, you can’t help but be outraged at the government’s outlandish behavior in this case.

Update: judged → judge

Posted in General | Leave a comment

Emacs Index Searching

Xah Lee has a blog post (2014-01-16) that reminded me of two useful functions that I can never seem to remember: emacs-index-search and elisp-index-search. They allow you to look up a topic in the Emacs or Elisp manuals by querying the index of those manuals. They aren’t bound to any keys by default (which is probably why I always forget about them) but they are available from the Help menu if your Emacs configuration displays it.

Lee uses elisp-index-search enough that he’s mapped it to a function key. That’s probably overkill for me but with the extraordinarily useful combination of ido-vertical-mode and flx-ido I can just type 【Meta+xeis to get the elisp index and 【Meta+xemis to get the Emacs index. That’s easy enough that I don’t mind doing it; now all I have to do is remember to use them.

Posted in General | Tagged | Leave a comment

Schneier on the NSA Threat

Yesterday, I wrote about how there is little evidence that the NSA’s mass surveillance is effective. Bruce Schneier has an interesting article up that argues it’s worse than that. Schneier says that the NSA is a threat to our security.

Most of his arguments will be familiar to Irreal readers but the thing that struck me was his depressing assessment of how difficult it will be to fix things. He says that new laws will be largely ineffective because the NSA will apply their infamous “novel interpretations” to them and lie about what they are doing. We need, he says, to work towards security not surveillance.

Put that way, it’s easy to see why he thinks the system will be hard to reform. Just think about all the NSA apologists and their constant mouthing of the agency’s talking points. Most of them, I’m sure, think security and sticking their noses into everyone else’s business are the same thing.

Posted in General | Tagged | Leave a comment

The Usefulness of Mass Surveillance

Remember those 50 plus terrorist plots that the NSA mass surveillance was instrumental in stopping? You won’t be surprised to learn that that was yet another lie. Ars Technica is reporting on a New America Foundation study that examined 225 cases in which terrorist suspects were “…recruited by al-Qaeda or a like-minded group or inspired by al-Qaeda’s ideology, and charged in the United States with an act of terrorism since 9/11…” The report concludes that the NSA’s mass surveillance of Americans played an identifyable role in at most 1.8% of the cases.

What were those cases? It turns out that the 1.8% was 4 people involved in a single incident. The “terrorist plot?” The four conspired to donate $8,500 to the Somali terrorist group Al Shabaab. That’s a useful outcome but it’s really rather trivial compared to the massive trodding upon of millions of Americans’ fourth amendment rights.

The report goes on to say that traditional investigative techniques such as tips from the local community, informants and targeted intelligence were responsible for almost all of the government’s success in preventing terrorist attacks. The NSA is fond of saying that if these programs had been in place at the time, they would have stopped the 9/11 attacks. This report casts doubt on that as does the Boston bombing, which the NSA was unable detect despite the non-existent op sec on the part of the perpetrators leaving clues cluttering the ground.

Despite the report and the NSA’s inability to point to any substantial successes in preventing terrorist plots enabled by their mass surveillance, the usual suspects continue to assure us that these programs are there to keep us safe. Really, it’s time everyone stopped listening to them and start demanding reform. Or to put it in a slightly less polite way, those claiming that these programs are necessary should put up or shut up.

Posted in General | Tagged | Leave a comment

Emacs Byte Code

Over at null program, Christopher Wellons has an excellent post on Emacs Byte Code Internals. Most people won’t care, of course, but we’re nerds and we don’t like black boxes. As Wellons says, the byte code internals are under documented—or in some cases, undocumented—so this post is welcome for those of us who’d like to know what’s going on.

There’s no point in my recapitulating what Wellons said so you should head on over and take a look. I don’t think this information is going to be of much practical use unless you’re interested in working on the byte compiler or interpreter but you may find that it’s just what you need for some project you’re thinking of. If nothing else, you’ll discover a bit more of how Emacs works.

Wellons is on a roll. Last week, I wrote about his post on closures in Emacs. He’s providing the sort of technical information that helps us all become better Emacs Knights. The more we know about the minutia of Emacs internals, the more productive Emacs users we’ll be.

Posted in Programming | Tagged , | Leave a comment

Emacs Colors with OS X

Bozhidar Batsov has his third post on the features of the coming Emacs 24.4 up. This time, he discusses the addition of sRGB to the NextStep (NS) build section of Emacs. The NS build section is where all the Mac OS X specific code and configuration lives. If you’re looking for better color support, you’ll be getting it in Emacs 24.4.

I don’t use a prepackaged color theme; I prefer to just add a pale beige (oldlace) background to the standard white screen color set. From time to time I look at the themes people have made and still haven’t found anything I like better than my simple set up. But that’s just me. Most people prefer darker screens (why is a mystery to me just as why I prefer light screens is doubtless a mystery to them) and most prefer one of the many themes that people have put together.

All that said, I will find it interesting to see if and how the new color facility changes my mind. If you’re one of those people who have been applying the sRGB patch or using homebrew your life is about to get easier.

Posted in General | Tagged | 3 Comments

Know Lisp, Get a Job?

Over at the Lisp subreddit, nhs111throwaway asks if anyone actually got a job because they know Lisp. The problem with a question like that is that you’re going to get only anecdotal information as answers. Still, it’s interesting to read about people’s experiences.

If I had to guess before reading those answers, I would have said that there are very few Lisp jobs and knowing Lisp probably doesn’t help much except as an indication that you have broad based knowledge. It turns out, at least according to the answers to nhs111throwaway’s question, that my intuition is wrong. Several responders recounted how Lisp helped them get the job they wanted. Sometimes it was a Lisp job, other times it was a job using a different language but they were able to leverage Lisp as a tool in support of the other language.

If you’re a Lisper and would like to get a Lisp job, you might find comfort in the answers. It really does seem, as Paul Graham says, that Lisp is a secret weapon that no one talks about very much but that gives its practitioners a big leg up.

Posted in General | Tagged , | Leave a comment

When Your git Server Dies

I’ve written before about how I use git to keep my two main machines in sync. The other day the linux server that I kept the repositories on died. I had turned it off for a few seconds to deal with a power problem and afterwards it wouldn’t spin up. That was a little annoying because I’d recently rebuilt the OS. The big problem, though, was that it was the machine that hosted my git repositories.

Until I could replace the machine, I needed a temporary home for those repositories. Happily, I use git instead of something like subversion so my two machines had the full history for each repository. All I needed to do was make a directory on aineko, my iMac, to hold the repositories, clone the repositories into that directory, create the git-daemon-export-ok file in each repository, and finally point the individual repositories on each machine to aineko instead of the linux machine.

Easy enough but I wasn’t looking forward to the drudgery of it all. I decided to solve the problem once and for all by automating the process. It’s nothing special but if anyone else has the misfortune to lose the server hosting their repositories, perhaps this will help.

#! /bin/bash
# -*- mode: sh -*-
REPOS="/Users/jcs/org /Users/jcs/medical /Users/jcs/tax /Users/jcs/.emacs.d /Users/jcs/tt"
for r in $REPOS
do
    git clone --bare $r `basename $r`".git"
    touch `basename $r`".git/git-daemon-export-ok"
    sed 's/url = bedia:/url = aineko:/' $r"/.git/config" > tmp
    mv tmp $r"/.git/config"
done

Now all I had to do was create the new directory, put this script in it, and run it. I also had to run it, without the git clone and touch on my other machine to point the repositories to the new server. Once I get a new server and configure it, I can just copy the repository directory on aineko to the new machine.

Posted in Programming | Tagged | Leave a comment

Unicode Representation in Emacs Strings

Xah Lee posted a useful fact that I’m sure I knew but had forgotten or at least not internalized. The tip is how to encode unicode in Emacs strings. Given that Emacs supports Unicode and, indeed, uses UTF-8 as its default file format, you can usually just place the Unicode symbol right in the string. You can also encode the symbol as \uXXXX or \UXXXXXX—see Lee’s post for details.

Why would we need this alternative representation? As Lee points out, sometimes you want to embed a non-printable character in the string and the \u or \U representation is more convenient—especially when the non-printable character involves cursor motion of some type.

Another example is to deal with missing glyphs in a font. For example, the Inconolata font that I use doesn’t support some of the glyphs that I need. An easy way of representing them is to use the alternative encoding. I can still embed the glyph in the string, of course, but it will appear as a tiny sliver of white space. Unless you look carefully, it just appears as if nothing is there. With the alternative encoding you can see that something’s there, even if you have to look up what it represents.

Posted in Programming | Tagged | Leave a comment