Internet Villains

This is hilarious. The UK government and a UK ISP trade group are wetting their pants because Google and Mozilla are planning to implement a more secure, privacy respecting DNS lookup in their browsers. They’ve even declared Google and Mozilla to be “Internet Villains” for having the temerity to respect the safety and privacy of their users. They give all sorts of specious reasons for their opposition to the change—including the usual shameless “protect the children” cant always favored by scoundrels trying to put something over on the rest of us—but it boils down to “we won’t be able to spy on you and control what you see anymore.”

Of course, even that’s not true. It probably is true that it will be slightly harder to filter out “undesirable” sites but at the end of the day, the final IP address must be visible to transport the traffic. Yes, sites deemed undesirable can change their IP addresses often in an effort to stay ahead of the blue noses but those addresses must be available to everyone to be useful so they can still be blocked.

I consider this change an unmitigated good thing and hope that Google and Mozilla will stand their ground but I’m not sanguine. The problem is that both organizations have a history of being hostile to those they consider guilty of BadThink and may come to agree with the censors.

I hope that doesn’t happen. It’s not, after all, up to the rest of us to make it easy for the GCHQ to spy on ordinary citizens just in case they may harbor impure thoughts of a social or political nature. Nor should our safety and privacy be degraded so ISPs can redirect bad DNS requests to their own page offering the erroneously requested domain for sale.

Posted in General | Tagged | Leave a comment

Making a Function a Command

Marcin Borkowski (mbork) has an interesting post on Emacs keyboard macros in the wild. He had a seemingly conventional repetitive editing task that he wanted to accomplish via Emacs keyboard macros but a few problems came up. It’s a nice example of solving small problems as they occur.

What really surprised me, though, was that Borkowski discovered a way of turning a function into a command without altering its source code. If you’re vague on the difference between a function and a command, it’s essentially that you can call a command with Meta+x <command-name> while a function can be called only from other Elisp code. The way to turn a function into a command is to add an interactive special form to the beginning of the function.

That means it’s easy to make an Emacs function into a command since we have access to the source code. But who wants to go mucking around with Emacs source code, especially if it’s a temporary change? It turns out that there’s an easier way. Although this is documented at the “interactive” link above, it came as a surprise to me. Indeed, the documentation notes dryly that “This feature is seldom used.”

Take a look at Borkowski’s post to see how it’s done. It’s dead simple and a nice technique to have in your Emacs toolbox even if you seldom use it.

Posted in General | Tagged | Leave a comment

Deciding What Functions To Do In Emacs

Extremeaxe5 has a question:

For me the answer is simple. If I can do it in Emacs, I do do it in Emacs. Actually, that’s not quite right. I suppose I could browse the Web from Emacs but that just doesn’t work well enough to make it worthwhile most of the time. Other than Web browsing I can’t think of anything that I could do in Emacs that I’m not doing in Emacs.

Mike Zamansky has his own answer: “If I can do it better in Emacs I use Emacs. Otherwise, I use Emacs.” Many other commenters agree.

The reasons for staying within Emacs as much as possible are well known and I’ve written about them before. The big ones for me are avoiding context switches and leveraging my Emacs muscle memory. Emacs über alles isn’t for everyone, of course, but has become a way of life for many of us. I’ve come to feel vaguely uncomfortable if I find myself entering text outside of Emacs.

Posted in General | Tagged | Leave a comment

Chrome Has Become Surveillanceware

Last year I wrote about Matthew Green’s post on why he was giving up the Chrome browser despite being a user for many years. The TL;DR was that Google’s decision to surreptitiously log the browser into Google when you used another Google app was the final straw for him. He said he could no longer trust Google to respect his privacy.

Of course, Green is a cryptographer who is knowledgeable about these matters and you might expect that he would be more sensitive to such things than a normal user. Now, though, The Washington Post has an article, Goodbye, Chrome: Google’s web browser has become spy software, that brings Green’s concerns to the rest of us.

Geoffrey Fowler writes that he monitored Chrome’s use of tracking cookies and discovered that after a week of browsing there were 11,189 requests for tracker cookies that Chrome would have passed on and installed on his machine. He recommends switching to Firefox (or Safari if you’re an Apple user). You’ll still get the same requests to set cookies, of course, since that’s controlled by the Web sites but Firefox and Safari are much more selective on which cookies they allow. Both browsers try to identify tracker cookies and block them.

You might think it doesn’t really matter because the worst that will happen is that you’ll get some annoying ads. But as Fowler says, it’s much worse than that. Even sites with no ads—such as Aetna insurance—also set tracker cookies. Google and the other data aggregators use those cookies to determine what sites you visit and to build up a profile of your habits, likes, and dislikes. Even worse, this data is being used not just to predict your behavior but to shape it as well. If you don’t mind being spied on and manipulated like that, then by all means continue to use Chrome. If you do mind, you should take Fowler’s advice and switch to Firefox or Safari. I mind so I’ve long since deleted Chrome from my machines and rely on Safari.

Posted in General | Tagged | Leave a comment

Mickey on Polymode

If you’ve been paying attention to the Emacs scene, you may have heard about Polymode, a package that lets you have two or more active major modes associated with a buffer. The first question to occur to many is, “Why would I want that?”

Not to worry, the incomparable Mickey is here to explain it all. There are, it turns out, legitimate use cases for multiple major modes in a single buffer. I’m an old-timey, backend sort of guy so I’ve been spared having to deal with those use cases but for those not so fortunate, Polymode can be a real win.

The basic idea is that you want to deal with two (or more) different languages in the same buffer—Mickey uses the example of Python and SQL. The indentation and font-locking are, of course, different for the two languages and you’d like Emacs to do the right thing automatically. That’s what Polymode does. It detects where one language leaves off and another starts and adjusts the operative major mode accordingly. A configuration that handles a given set of languages is called a “polymode.”

The bad news is that although there are, apparently, a few polymodes already written, by and large you’re going to have to write your own for most things. The good news is that writing a new polymode is pretty simple and generally takes just a few lines. Mickey’s post shows how it’s done by creating a Python/SQL polymode. Doubtlessly, more prebuilt polymodes will start to appear once the package starts getting traction.

If the need for this or the ideas behind it are unclear to you, take a look at Mickey’s post. As usual, he does an excellent job of explaining everything. As a bonus, if you’re not British, you may, like me, learn a new word: bijou. How can you lose?

Posted in General | Tagged | Leave a comment

Microsoft Ebooks: The Past Comes Due

It’s no longer news that Microsoft is closing down their ebook authentication server and those who have paid Microsoft for ebooks will shortly be unable to read them. It’s easy to say it’s their own fault and that’s not wrong but the majority of the blame lays with the book industry and their mule-like insistence on keeping their books locked up with DRM. They and their lackeys in congress enabled this situation with the execrable Digital Millennium Copyright Act. I’m sure the publishers considered all those contributions to congressional campaigns well spent but they will, I think, come to rue the day they made that bargain.

I say that for two reasons. First, Amazon leveraged their insistence on DRM to achieve domination of the ebook market—and probably the dead tree market as well—to the point where they can mandate terms to the publishers including what they pay for the books. It’s pretty much “sell your books with us or don’t sell them.” That’s all because DRM allows Amazon to lock readers into their ecosystem. If there were no DRM, the publishers could tell Amazon that if they didn’t want to buy books on their terms and prices, there are plenty of other outlets that would and users, being able to read books no matter where they bought them, wouldn’t care who sold the books to them.

Secondly, my sense is that the public’s patience is wearing thin. If I were a Microsoft ebook reader and lost my books, I wouldn’t have the slightest compunction about procuring a pirated copy to replace the copy I had already paid for. Once I did that, I would probably avoid future problems by doing away with official copies altogether. At the very least, I wouldn’t feel bad at all about procuring the easily available software that breaks the DRM to make sure these vultures could no longer steal my books.

How long will it be before people who haven’t lost their books adopt the same attitudes? Once the publishing industry comes to be perceived as thieves with no concern for their readers, those readers will no longer have a concern for them. Anything that’s left after Amazon gets done with them will have become worthless.

Posted in General | Tagged | Leave a comment

Ivy, Swiper, and Counsel Gain a New User

Yesterday, I wrote about abo-abo’s recent enhancements to the Ivy UI. After I wrote that post, I saw this tweet:

I went through the same process almost exactly 3 years ago and have never looked back. Ivy and friends are so much better than the default mechanisms that I’m always a little surprised by tweets like the above because I always assume that everyone has abandoned smex and ido by now. Apparently not.

That brings me to the point of this post. If you haven’t yet tried Swiper/Ivy/Counsel you’re missing out and owe it to yourself to give them a trial. I can’t think of any reason at all to stay with smex and ido—although I’m sure some folks have special use cases or needs where they make sense—and even people using helm might want to try the Ivy suite out. Just the way swiper does implicit regular expressions makes it worth while all by itself but there’s lots more. Take a look at the manual if you want to see what it can do. Don’t be put off by all the functionality. It’s easy to get started by just using it as a drop in replacement for isearch and things like find-file. You’ll discover the other functionality as you go along. Give it a try; you will, I promise, be glad you did.

Posted in General | Tagged | Leave a comment

Ivy and Directories

Abo-abo posts that he has made some usability enhancements in Ivy directory handling. If you’re like me, Ivy is a fundamental part of your workflow. As abo-abo says, the original idea was simple: provide a list of strings and a way of choosing one of those strings. Of course things quickly got more complex. One source of problems is dealing with directories.

The first example is dealing with file name completion. As you’re traversing down the path of directories, you need to select the proper one and move on to the next but you can’t just accept the directory because that would open the directory in dired instead of allowing you to choose the next directory in the path. Abo-abo solved that problem simply enough by using Ctrl+j to select that directory but keeping going.

The next problem is directory creation. That’s harder because Ivy couldn’t tell the difference between a new file and a new directory so he used a special key binding for that case. Recently he dug into the dired-create-directory and make-directory code and discovered that they pass Ivy a unique prompt that he could use to ascertain the user’s intention. Now it works the same as with files and there’s one less key sequence you have to remember.

He also fixed a long-standing annoyance involving the dired-dwim-target variable. You can read his post to see what the problem was and how he fixed it if you use that variable.

As we’ve come to expect from abo-abo, Ivy just keeps getting better and better. I can’t imagine how I got along without it. If you’re an Ivy user, be sure to read abo-abo’s post to see what’s new.

Posted in General | Tagged | Leave a comment

iPhone Security

One of the reasons I have an iPhone rather than an Android device is that I feel it’s more secure. Everyone—except maybe the bad guys—likes more security, of course, but not everyone is willing to pay the price to get it. In the case of the iPhone, that price is mostly being willing to live in Apple’s walled garden. Principally that means you have to get your apps from the App Store rather than having a choice of sources as Android users do.

Apple can not, of course, filter out all the bad actors but they mostly do. That, for me, makes the trade off worthwhile. Others have a different calculus.

Still, the iPhone isn’t safe out of the box. There are some steps you should take to help keep your data and yourself safe. From John Cook’s excellent Data Privacy twitter feed, I found a pointer to this:

If you follow the link, you’ll find an article that recommends 7 specific settings you can make to your iPhone to help keep the snoopers away. They’re easy and you probably already have many of them set but if you’re an iPhone user, it’s definitely worthwhile taking a look at the article and checking your own settings.

Posted in General | Tagged , | Leave a comment

GitHub/GitLab Pull Requests from Emacs

Prathamesh Sonpatki has a useful post that shows how to make pull requests for GitHub and GitLab from Emacs using Magit. Sonpatki took some code from one of Artur Malabarba’s posts on Endless Parentheses and made the trivial changes necessary to get it to work with GitLab too.

Malabarba’s post is from 2015/2016 so you may not have seen it. Sonpatki’s post is, therefore, a welcome reminder. After completing and pushing a change to a new branch, you can use one of the code snippets to create a pull request from within Emacs. That’s useful because it allows you to stay within Emacs rather than having to switch out to your browser. If you’re an Emacs/Magit user and work with GitHub or GitLab you’ll find Sonpatki’s post useful.

Posted in General | Tagged , | Leave a comment