Move Back to Last Misspelling

One of the handiest things I've learned from Pragmatic Emacs is using 【Ctrl+;】 to cycle through possible corrections for the last misspelled word. It's especially handy because the point doesn't have to be on or at the end of the word you want to correct. It can be after the word and other text as long as there are no intervening misspellings.

Ben Maughan is back with a related tip. Sometimes, flyspell can't find the proper spelling and you need to fix things up by hand. If you're still at the word, that's easy but if the point is after the word you need to jump back to the typo to make the correction. Maughan gives us a bit of Elisp to do just that. It's a small thing, of course, but as with all such micro-optimizations it makes our editing experience a bit more efficient and pleasant.

Posted in General | Tagged | Leave a comment

File Local Variables in an Org File

A nice tip from Artur Malabarba: It's often convenient to use file local variables in your Emacs files. It provides a way of setting certain Emacs variables—mode, fill-column, comment-column, etc.—on a per file basis.

There's a problem, though, when using them in an Org file. Org considers anything after a heading to be part of that heading's subtree. Thus, if you move the node that the file local variables are in, they get dragged along with the node. The answer, Malabarba says, is to put the file local variables in their own COMMENT subtree. Those subtrees don't get exported so it's a perfect solution when using Org to write text intended for export to HTML, LaTeX, Word, and so forth.

Malabarba also gives us a bit of Elisp to make navigating such a buffer easier. If you often use file local variables in Org files, you will probably want to add his code to your Emacs configuration.

Posted in General | Tagged , | Leave a comment

Pages in Emacs

Eric James Michael Ritz over at One More Game-Dev and Programming Blog has a nice post on how and why to use pages in Emacs. Pages in Emacs are text separated by form feeds (0xC)1. As Ritz explains, it's easy to move between pages by using 【Ctrl+x [】 (backward-page) and 【Ctrl+x ]】 (forward-page).

Most of us don't use pages but Ritz gives us a good use case. As he points out, you can install a package such as Steve Purcell's page-break-lines package that will make the breaks explicit and others that make navigation easier. Go read his post and see if you can make pages work for you.



Although, like everything else in Emacs, that's configurable. It's controlled by the page-delimiter variable.

Posted in General | Tagged | Leave a comment

Org Mode and Pandoc

Bsag over at But She's a Girl has a nice post on using Org mode and Pandoc. She says that she's abandoned Markup in favor of Org mode because, among other things, it provides a rich set facilities for handling the structured text. You can move headers and their associated trees up or down and you can promote or demote them in the hierarchy. And, of course, it has especially rich table editing capabilities. Markup is wonderful and all—I mean that—but if you're using Emacs as your editor, Org brings you everything Markdown does and much more. You really should be using it.

I've written extensively about my own system of using Org mode for writing. Normally, that means I write in Org and then export to HTML, PDF, or this blog. I use the native Org exporters for that so I don't usually need Pandoc. Bsag, has gone another route and uses ox-pandoc as her export engine. That means that all the conversion is done by Pandoc. I don't know if that's better or worse than my system but if you're just getting started you might want to give bsag's systems a try.

She also mentions using Org and Pandoc to implement a lab notebook. If you're working in the sciences and need to keep a lab notebook, you should definitely give her post a read.

Posted in General | Tagged , | Leave a comment

Emacs is Sexy

Posted in General | Tagged | Leave a comment


Because I live in the United States, I grew up with the notion that TV would provide me “content” for free in exchange for embedding advertisements in that content. It's always seemed fair and reasonable to me so I've resisted the urge to install an ad blocker in my browser. After all, I enjoy and profit from the works that people put on the Internet so it's only fair that I pay for them with the accompanying ads.

That doesn't mean, however, that I've signed up to be a pushover. Annoy me enough and I'll learn to forego your contributions. For example, if you autoplay a video advertisement when I enter your site, I'm gone as soon as it starts and I won't be back. There are, it turns out, much worse things than autoplay videos and they're mostly invisible and easy to overlook.

I'm talking about the tracking ads and beacons that go by the generic name of adtech. If you want the scales to fall from your eyes, install something like Ghostery or Privacy Badger in your browser and see what happens. It will, I promise you, make your hair stand on end. Some sites are pushing over 20 tracking beacons to your browser all of which are tracking you across the Internet. Some are being reused by the NSA to track “people of interest.”

It's even worse on mobile where all this extra cruft uses up your expensive bandwidth and depletes your battery charge. Dean Murphy, the developer of Crystal, an iOS 9 app that blocks tracking ads and beacons, has run some benchmarks. He finds that blocking trackers makes pages load 3.9 times faster and use 53% less bandwidth.

Plugins like Ghostery, Privacy Badger, or Crystal seem like an ideal solution to me because they don't block ads per se, only tracking ads so you're keeping faith with the content providers as long as they don't abuse your trust. Sadly, the content providers are getting ripped off by adtech too. Don Marti explains adtech fraud in an excellent post that shows how content providers and advertisers are getting ripped off while we users are having our privacy violated. You really should read it but the TL;DR is that the adtech vultures drop a tracking cookie on you when you visit a high quality site such as The Atlantic but actually serve the ad when you visit a low quality site with cheaper ad rates: collect your interests in the high rent neighborhoods but sell you the goods in the sketchier parts of town.

As I said at the beginning, I don't mind ads but that doesn't mean that I'm open to having my behavior tracked by mostly unsavory ad networks that feel entitled to run arbitrary scripts on my computer without my knowledge or consent. Until they clean up their act, Ghostery will block their privacy invading scripts. Marco Arment says that even if some publishers experience difficulties that doesn't mean we're obligated to let them romp through our machines. I agree. Send me non-tracking ads and I'll see them. Otherwise, your ads are going right into the bit bucket unread and unexecuted.

Posted in General | Tagged | Leave a comment

Org Mode Basics: Structuring Notes

Ben Maughan of the wonderful Pragmatic Emacs is writing a series of articles on Org mode. It's a big subject, of course, so he's starting off easy by talking about the feature that got him started: structured notes.

He covers how to get headings and subheadings; lists; numbered lists; and checklists. It's a quick and easy introduction that's written in Org format so that you can see what it looks like. As smitty (one of the commenters) says, the nice thing about Org mode is the minimal UI. You can see that in Maughan's tutorial. There's hardly anything to know to take structured notes and yet it opens up many possibilities to other functionality that Maughan will doubtless cover in subsequent posts.

If you aren't already following Pragmatic Emacs, you should definitely add it to your feed. He covers loads of useful material.

Posted in General | Tagged , | Leave a comment

Law Enforcement Lies about Encryption

By way of the Macalope's John Evans putdown, I came across this old but still true and relevant article by Marcy Wheeler over at Salon entitled America’s huge iPhone lie: Why Apple is being accused of coddling child molesters. The article starts by noting that encryption hardly ever plays a roll in FBI cases (only four times last year) and that much of what law enforcement has to say on the matter amounts to lies.

Wheeler also points out that a substantial part of the “lost information” resulting from encryption on smart phones is obtainable elsewhere. For example, one complaint is that the recent location data collected by the iPhone is unavailable on encrypted phones but is available from the phone carriers because the phones log onto cell sites and thereby reveal their location.

Although law enforcement assures us that their concern is about being able to access data for which they've obtained a warrant, Wheeler's article suggests that, in fact, their concern is about losing access to data for which they don't have a warrant, and therefore a right, to see. Wheeler says the real issue is that the encryption makes it harder to do searches without getting a warrant for which they often don't have sufficient evidence.

She says

If law enforcement wants to retain this access, they should be honest about what they might lose and why every iPhone user should be asked to carry a phone that is susceptible to criminal targeting as a result.

She makes the final point that smart phone encryption offers real benefits to everyone, not just pedophiles, and that the government should recognize that and stop pretending Apple is benefiting only law breakers. It's a good article and definitely worth reading.

Posted in General | Tagged | Leave a comment

Crazy but Right

Posted in General | Tagged | Leave a comment

Scheduling Emacs Events

Jon-Michael Deldin has a short post detailing how to schedule periodic events in Emacs. Most of us probably don't want to have Emacs natter at us as implemented in Deldin's example but it's easy to imagine many helpful uses for the run-with-idle-timer function.

More useful, perhaps, are the run-with-timer and run-at-time functions. The run-with-idle-timer function runs a function when Emacs has been idle for some period of time. The other two run every n seconds (run-with-timer) or at a specific time and optionally every n seconds thereafter (run-at-time).

The latter two functions are very flexible and perform a bit differently depending on their arguments so be sure to read their documentation. If you want to do things like schedule a git push every hour (or when Emacs is otherwise idle), these functions could be just what you need.

Posted in General | Tagged | Leave a comment