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

Judge Orenstein in the New York Times

Remember Judge James Orenstein? He’s the federal magistrate judge in the Eastern District of New York who refused the FBI’s request to order Apple to help them break into an iPhone. I found his decision particularly interesting because the facts of the case almost exactly tracked the famous San Bernardino case that Apple vigorously resisted until the FBI gave up and found other means of getting the data. If you’re vague on the details, here’s a summary that I wrote at the time.

Orenstein recently had an op-ed in the New York Times in which he discusses privacy in the Internet age and bemoans the fact that privacy policy is being set by prosecutors who have little interest in protecting your privacy if it gets in their way. This is the result, he says, of Congress’s failure to act.

Today’s reality is much different than it was just a few years ago. Now our entire lives are very likely recorded in our smart phones. It’s little wonder that the police and prosecutors are itching to get their hands on the data they contain. Often times, that desire is justified but it should still require a warrant issued for probable cause not just some easy administrative subpoena. What’s needed are clear procedures and rules as to what’s permissible and what’s not. Currently, we don’t have that.

Orenstein puts the blame squarely where it belongs: on Congress. Their failure to act has created a void that prosecutors are happy to fill with dubious doctrines if they can find a judge to agree. Read his op-ed. It’s interesting and informative.

Posted in General | Tagged | Leave a comment

Haldar Reads Reflections on Trusting Trust

I’ve written at least twice about Ken Thompson’s Turing Award Lecture, Reflections on Trusting Trust and each time I told you to be sure to read it. It describes one of the—if not the—greatest hacks of all time. In the talk and the paper that recapitulates it, Thompson describes how he modified the C compiler to insert a backdoor into the Unix login command and arranged to have all signs of the code removed from the compiler’s source while keeping it in the binary. In a way, the paper is terrifying and after reading it, you’ll never fully trust your tools again.

If you ignored my strong urging to read the paper don’t worry. Vivek Haldar had done it for you and produced a short video describing it. Watch Haldar’s video to see how Thompson pulled off his trick but then you really should the paper itself. It’s short, easy to read, and entertaining.

Posted in General | Tagged , | Leave a comment