If You're Looking for Another Reason to Despise Journalists...

Here you go.

Posted in General | Tagged , | Leave a comment

The Past Comes Due

Irreal oldtimers know that I have often railed about the activities of the NSA and their domestic spying and about the ever more shrill demands by law enforcement that they be given a back door into our cell phones. As everyone knows by now, the government’s sins have caught up with them.

Here are a couple of tweets from Edward Snowden that illustrate the problem

The NSA developed an exploit for Microsoft Windows and then lost control of the code, which was subsequently published on the Web. Criminals, of course, immediately used it to develop a ransomware worm which, among many other things, shut down several hospitals in the UK. I haven’t yet heard of any deaths resulting from this but it’s probably just a matter of time. In any event, it appears patient records may have been lost.

The US was largely spared but only because a UK security researcher stumbled on a kill switch for the malware and stopped it from spreading. You can read that amazing story in the link from the first tweet. Sadly, it appears that a new version without the kill switch has appeared.

I don’t believe it’s the slightest bit unreasonable to hold the NSA responsible for this mess—including any deaths that result. They wrote the exploit, they didn’t inform Microsoft of the vulnerability that made it possible, and then they let it get stolen. Someone should, at a minimum, lose their job but, of course, no one will.

That brings me to the second point. The government insists it can be trusted with a “golden key” to our smart phones and other devices. They say that of course they won’t abuse the capability and that we can trust them to keep the key out of the hands of criminals and hostile nation states. The WannaCry incident puts the lie to both those claims and justifies my belief that we should never trust the government with the access they desire.

Charlie Stross has an hilarious piece on the incident. He makes the point that if what happened were submitted as a piece of fiction, it would be rejected as unbelievable. He’s got a point.

UPDATE [2017-05-15 Mon 12:23]: Yoni Heisler agrees.

Posted in General | Tagged , | Leave a comment

The Benefits of Reading Code

I’m a big advocate of reading code. A lot of what I know about programming, Unix, and Emacs, I learned from reading code. Chen Bin has a parallel if slightly different take on reading code. He says that mastering Emacs is easy if you read the code. He likes to treat packages as a collection of APIs whose source code he can read and use for his own purposes.

As an example, he considers Samuel Barreto’s excellent post on refactoring with counsel-ag that I wrote about earlier. Chen spent a few minutes looking at how counsel built the wgrep buffer and then leveraged that to do some additional processing before calling wgrep. It’s worth taking a look at what he did. You probably won’t need his code but it perfectly illustrates his point: if you read the Emacs code it’s very easy to extend it to solve your particular problem.

Posted in General | Tagged | Leave a comment

Imenu for Dired

Matus Goljer—Fuco1 of Smartparen fame—blogged a nice bit of Elisp that adds imenu functionality to dired. At first, that doesn’t seem to make sense since an imenu menu would simply have the same information as the dired listing itself. What actually happens is that imenu gives you a list of the subdirectories inserted into the dired listing. You can then jump directly to that subdirectory from imenu

If you think that might be useful, take a look at Fuco1’s post for the details.

Posted in General | Tagged | 1 Comment

A Company-wide Emacs Configuration

Daniel Gopar over at Emacs.el has another of his Emacs chats up. This time he talks to Charles Lowell from Frontside Software. What’s interesting about Frontside is that they have a company-wide, shared Emacs configuration. All the developers use the same configuration, which the company maintains.

My first reaction was one of horror. All developers have preferences—this compiler or that PDF reader—but mostly they’re just that: preferences. If your company doesn’t use your favorite C compiler, you grumble a bit but get on with things. Not so with editors. Every first class developer that I know cares passionately about their editor and wouldn’t dream of using something else. With Emacs, you pretty much build your own editor so you get the same reaction if you have to use a different configuration. Most of us know how painful it can be to use someone else’s Emacs. That’s because their configuration is different from yours. I would, therefore, be very leery of coming into a shop that had a company standard editor.

Still, Lowell makes a reasonable case for their practice and it’s not quite as draconian as I’m making it seem. Nevertheless, having to unlearn my Emacs muscle memory would be extraordinarily painful for me. I’ve seen cogent cases made for insisting on everyone using the same versions of packages and editor—especially in shops doing research and running experiments—but it’s much harder, I think, to make the case for having standardized key sequences. Of course, everyone’s mileage varies and the folks at Frontside seem to like the system so it appears to be working for them.

One interesting aspect of Frontside’s practice is that they package their configuration as an Emacs package. That means that the developers update their configuration the way they would any package and it brings in the changes and updates their other packages automatically. If you’re going to insist on a standard configuration, that’s a very nice way of doing it. It’ quick and easy and no one has an excuse for not staying up to date.

Take a look at the video and see what you think. The running time is 43 minutes, 45 seconds so plan accordingly.

Posted in General | Tagged | 2 Comments

Running Your Life from Your Smart Phone

Back in February, I wrote that more and more functions are being moved into our smart phones. That includes things like ATM cards, credit cards, driver licenses, and even unlocking doors. This is something I welcome—although Noonian Atall pushes back a bit—as a simplification of my life and a reduction in the number of things I have to carry around.

These advances are still nascent here in the U.S. and probably most of the Western world but China has fully embraced the concept. The story of how the Chinese leverage their phones for running their lives is an interesting one. I first learned of this from a Daring Fireball post about problems the iPhone is having in China. You can read Gruber’s post for the details but the TL;DR is that iOS doesn’t have the loyalty in China that it does elsewhere because the Chinese experience in concentrated in a single app: WeChat. WeChat is the portal through which the Chinese access all the services they need in their daily lives. It has, in effect, replaced iOS and Android as the operating system for smart phones, at least from a user perspective.

Gruber quotes Ben Thompson as saying

There is nothing in any other country that is comparable: not LINE, not WhatsApp, not Facebook. All of those are about communication or wasting time: WeChat is that, but it is also for reading news, for hailing taxis, for paying for lunch (try and pay with cash for lunch, and you’ll look like a luddite), for accessing government resources, for business. For all intents and purposes WeChat is your phone, and to a far greater extent in China than anywhere else, your phone is everything.

If you want to know more about WeChat and its influence in China, Connie Chan has a great post about it over at the Andreessen Horowitz blog.

I’m not sure that WeChat is what I want for the future but I do love how the Chinese can handle so many mundane chores with their phones. My guess is that iOS and Android will begin integrating more and more of these functions if only to avoid being made irrelevant. I prefer that solution if for no other reason than the single point of failure—Apple or Google in this case—is large enough that it probably isn’t going away soon. Apple also has the advantage that they aren’t interested in harvesting your information and selling it to advertisers, something I very much care about.

Posted in General | Tagged | Leave a comment

Jumping Directly to Org Headers

Last week I wrote about finding out about counsel-imenu from Arjen Wiersma’s Emacs configuration. Today, I discovered something new about it. Filipe Silva was looking for a way to jump to an Org mode heading using fuzzy completion.

There were a lot of suggestions but the one that jumped out at me was to use counsel-imenu. Naturally, I immediately tried it and it worked just as advertised. In the past I would occasionally use org-goto (bound to Ctrl+c Ctrl+j) but it never seemed to get me where I wanted to go easily, whereas counsel-imenu does exactly what I want.

If you aren’t already using swiper and counsel, I urge you to give them a try. I’ve been using them ever since Mike Zamansky’s video on swiper goaded me into giving them a try and I’ve found that they have given me a significant efficiency bump in searching and navigation. My newfound use for counsel-imenu is just one more example.

Posted in General | Tagged , | 1 Comment

How to Make Swiper Choose the Second or Subsequent Match on a Line

Chanyoung is a Swiper user and asks a question I’ve sometimes wondered about: when using swiper, how do you choose the second or subsequent match on a line? If you follow the above link, you will see that abo-abo himself provides the answer.

What you do is call swiper-avy (bound to Ctrl+) to see tags for every visible match. Then you simply choose the correct tag in the usual Avy way. I’ve known about (and even used) swiper-avy for some time but I always thought of it as a way of choosing the correct line in the minibuffer. That usually brings you to the match you want but not (necessarily) when there is more than one match on the line you want.

It turns out—although I somehow never noticed it—that the visible matches in the searched buffer are also tagged so you can simply choose the tag you want and jump right to the desired match. I know I’ve said it before, but if you aren’t using swiper and counsel you owe it to yourself to give them a try. I’m always learning something new that they can do and they’ve made my navigation a lot more efficient.

Posted in General | Tagged | Leave a comment

Comey and Feinstein At It Again

James Comey and Dianne Feinstein are at it again pressing for legislation to compel device manufacturers to enable law enforcement to bypass device encryption. In a sense, nothing is new. Comey is trotting out the same arguments—many or most of which have been debunked—and uses the abracadabra words “national security” to shut off argument because no one, after all, can be against national security.

The funniest part of their spiel is the oft repeated, “None of us want backdoors” when, of course, that’s exactly what they’re asking for. Feinstein’s last attempt at a bill was so bad even her Senate colleagues understood it couldn’t work and would have devastating unintended consequences. There’s no reason to hope this try will be any better.

Feinstein’s hypocrisy on this subject is especially annoying. She’s fine with having the government pry into every bit of the communications and online activity of citizens who aren’t even suspected of wrongdoing but nearly had a heart attack when the CIA spied on her and her staff. In the linked post I wrote that I thought Feinstein’s tantrum was hilarious. Now I think it’s just disgusting.

Posted in General | Tagged | Leave a comment

Going to the Beginning and End of Special Buffers

Way back in 2013 Magnar Sveen published a nice bit of Elisp for moving to the beginning and end of a dired buffer. By beginning and end, he meant the logical beginning and end: the first and last line of file or directory listings. I immediately stole that and modified it to do the same thing for ibuffer buffers.

Now Fuco has published a set of macros that implements the same thing for a wide variety of other special buffers. The macros are actually nicer because the first time you press Meta+< or Meta+>, you will move to the logical beginning or end of the buffer. If you press it again, you will move to the physical beginning or end so you get the best of both worlds.

Fuco gives several examples of using the macros for various types of buffers so even if you don’t know much Elisp, you can easily implement the behavior for most buffer types that you’re apt to care about.

Oddly, looking at my original post on ripping off Sveen’s code for ibuffer buffers from 2014, I see that Fuco made a comment pointing to these macros. Now he’s posted about them and given examples for anyone who’s interested to use. If you use dired, ibuffer, occur, vc-dir, agenda, or other special buffers a lot, you may be interested in his solution. Be sure to give his post a read.

UPDATE [2017-05-07 Sun 20:33]: Fixed the links.

Posted in General | Tagged | 5 Comments