More on ed

Last month I wrote in amazement that there was someone who (still) liked using the ed editor. If you’re coming in late, ed is a line editor that was used extensively by the early Unix developers. That made a lot of sense when the input device was a teletype but, in my opinion, makes no sense at all in today’s world. I say “in my opinion” because, as I pointed out in that last post, at least one person disagrees.

Either serendipitously or as a case of the Baader-Meinhof phenomenon, a thread on that very subject recently appeared on the Unix Heritage Society mailing list. In it many people wax nostalgic for ed and even the more horrible TECO editor. A surprisingly large number of them report still using it as an everyday tool. Ed has lived on mostly as an editor of last resort for fixing Unix systems that can’t mount the normal file systems that contain things like vi or emacs. Some folks, though, refuse to give it up.

I have a hard enough time trying to understand why anyone would prefer editors other than Vim or Emacs so a preference for ed makes no sense at all to me. But as they used to say back when ed was the Unix editor, “Different strokes for different folks.”

Posted in General | Tagged | Leave a comment

The Case for RSS

Recently, I stumbled across a couple of posts about the virtues and superiority of RSS. I was a little surprised because it seems like a no-brainer to me. What’s the competition? Facebook and G+? Those are systems for harvesting your private information and in any event filter what you see in a way that might not match your preferences.

What about Twitter? No one knows what Twitter’s for but it appears to be mainly a platform for people with a loose grasp on reality to express—and express and express—their political opinions.

The sweet spot for RSS, I think, is following a blog that posts every few days or perhaps even more irregularly. That strategy saves me a lot of time: rather than check a blog for a post that might not be there, I just let the post come to me. For blogs that publish once or more everyday, I simply check the blog once a day. There’s no reason to clog up my feed with a bunch of posts that I know will be there.

The other big question for RSS is what reader to use. For me, that’s also a no-brainer. Even if I didn’t prefer to do as much as possible in Emacs, I’d still use elfeed. I like its search features and the fact that I can search for old posts. Even so, me use of elfeed is pretty elementary. Take a look at Mike Zamansky’s three posts on using elfeed [1, 2, 3] to get an idea of what can be done with it.

Posted in General | Tagged , , | 7 Comments

A Small Swiper Trick

Over at the Emacs reddit, g00eykabl00ey shares a “swiper trick.” He gives an example of the trick where he wants to check the spelling of “Dostoyevsky,” which appears elsewhere in the buffer. To find the previous use—and its correct spelling—he starts a Swiper search with “dos.” That will bring up every occurrence of “dos” in the minibuffer. You can move up in down in the minibuffer (scrolling if necessary) and as each line is highlighted, the buffer being searched scrolls to that instance of the search term. If you type Return, the point is moved to the instance that is highlighted in the minibuffer. But if you quit Swiper (with Ctrl+g, say) the buffer is unchanged but you’ve seen the correct spelling. Notice that this same trick is useful anytime you want to see some term in context, a variable definition say.

I would have thought that this was pretty obvious but judging from the comments maybe not. I don’t keep track but I wouldn’t be surprised if half of my uses of Swiper are like this. I quit out of it as often as I complete the search by moving to the target. Tricks like this are why I say that Swiper and the associated Ivy library are my most useful package.

Posted in General | Tagged | Leave a comment

The NSA and Their Lost Secrets

The New York Times has a damning article on the NSA and its spilled secrets. It goes into depth as to how the Shadow Brokers have disrupted NSA operations and destroyed the morale of its employees. In a sense, nothing in the article is new news to those who have been paying attention but it is damning to see the whole thing laid out in one place.

The article ends with a discussion of the cost and ethics of the NSA’s holding on to vulnerabilities for their own use rather than reporting them to the vendors. Given the damage that the release of their “hacking” tools has caused, that’s a necessary and even urgent discussion to have.

To me, though, the biggest takeaway from the article wasn’t mentioned: Why would/should we trust the government with backdoors to our cell phones and encryption when their premier security agency seems unable to protect its most important secrets? I have no doubt at all that if they were to get their lusted after “golden keys” they would soon lose control of them and put every person on the planet at risk from criminals. That last statement doesn’t include threats from nation-state actors and the existential threat that could represent to folks like reporters and dissidents in some regimes.

Posted in General | Tagged | Leave a comment

Swapping Windows with Ace-window

By way of background, I need to remind you that I use ace-window for switching between windows. I think of it like ibuffer: it’s so much better than the default command that everyone should configure it automatically when setting up their Emacs. I have it mapped to Ctrl+x o which is convenient because it acts identically to other-window when there are only two windows.

I was getting ready to write something else for today’s post when I noticed that my two side-by-side windows were not in the usual blog writing order. My OCD immediately kicked in and I decided to swap them. The other day I was reading that you can change the default ace-window action before selecting the window to change to. By pressing m you can swap the current window with one of the others. Of course, that only works when there are three or more windows. When there are two windows it simply changes window focus immediately.

I wondered if there was a way to force one of the alternate actions so I typed Ctrl+u Ctrl+x o as an experiment. It immediately swapped the windows. I checked the documentation and discovered that if you type Ctrl+u twice before calling ace-window it will delete the current window. I’m not sure why you’d want that instead of the easier Ctrl+x k but that’s what happens.

Afterwards, I vaguely remembered knowing all this but I’d completely forgotten it. In case you’ve forgotten it too or didn’t know it, consider this a PSA. If you’re interested in what other actions you can perform when you have three or more windows, see here.

Posted in General | Tagged | Leave a comment

More PDF Tool Tips

If you liked my previous post on PDF-tools tips from Ben Maughan and Marcin Borkowski, you should take a look at Maughan’s followup post that includes a few more tips.

If you work with PDFs a lot, it’s definitely worthwhile spending a bit of time honing your workflow. It will pay dividends in reduced friction. As I wrote in that previous post, the more I use PDF-tools, the more I like them.

Posted in General | Tagged | Leave a comment

Ivy Selection Algorithms

Today I learned that a capability I’ve often wished for already exists. As I’ve written many times, I use the Ivy/Counsel/Swiper package for my searching and selection needs. Although it took me a day or two to get used to it, I’ve come to really like the default matching algorithm which essentially turns a space into “.*”. Now I consider it a cache miss if I have to actually enter regex notation.

Ivy supports several matching algorithms and you can choose the one you want to use with each application, such as Swiper. One such algorithm is to search for a target that contains two or more terms without regard to the order they occur in. My use case for that is searching for an old blog post. I’d sometimes like to search for several words without regard to their order. That’s useful when I can remember two or three terms in the post but not the order they appeared in.

Sadly, though, there was no way to choose an algorithm on-the-fly and I normally want to use the default algorithm. Happily abo-abo fixed that problem back in July. You can now cycle through the various matching algorithms. The details are in this Emacs Stack Exchange question. This is a real win for me and makes Swiper and Ivy even more useful for my workflow.

If you aren’t already using Ivy/Counsel/Swiper, you’re missing out and really should give it a try. As I’ve said before, it’s my most useful package.

Posted in General | Tagged | Leave a comment

Xah Lee on Long Term Emacs Productivity

Xah Lee has a nice post on obtaining Long Term Emacs Productivity. It’s 7 tips to help you be more productive with Emacs. Doubtless anyone who is not a complete n00b will disagree with some of his suggestions. I disagree with some of them. The thing is, we probably disagree on different things so the post is a useful thought provoker even if you ultimately dismiss some of its suggestions.

For example, Lee is very interested in ergonomics and has extensively investigated the (for him) optimal key bindings. I, on the other hand, generally avoid remapping keys to existing commands. That probably started when I was a n00b and, not understanding how Emacs eventually becomes an editor customized for each user, avoided remapping commands so that the experience would be the same no matter whose Emacs I was using. Several years on I no longer suffer under that delusion and—even though I still don’t remap existing command’s key sequences—I would find it painful if not impossible to use someone else’s Emacs productively.

Lee likes and recommends ido-mode while I vastly prefer the ivy, swiper, counsel package. Again, this is simply a matter of preference; there is no “correct” answer. I was an ido user before I switched to ivy and liked it a lot but for me the ivy package is probably my biggest productivity booster.

Those are my two quibbles with Lee’s tips. Yours will probably differ. Regardless, the post is worth reading for the ideas it presents. My only addition would be the idea of navigation by searching. That starts with Steve Yegge’s suggestion to use incremental search for navigation but also includes using the excellent avy library (the successor to ace-jump) for finer grained and quicker navigation.

Posted in General | Tagged | 7 Comments

Pandoc 2

There’s a new Pandoc available that has a ton of new features and improvements. You can see the (substantial) list of new features in the Pandoc 2.0 release notes. There’s also a Pandoc 2.0.1 release with a few bug fixes and cleanups.

There are many improvements in the processing of Org files—both reading and writing. If you’re writing in Org you can use ox-pandoc to publish your document in a large number of formats right from Emacs. Even if ox-pandoc doesn’t support your desired format, you can still call Pandoc directly to output in any of the Pandoc supported formats.

Follow the Pandoc 2.0.1 link to get the the latest binary for your platform. If you have Haskell installed and want to build it yourself, there’s also source code available.

Posted in General | Tagged , | 1 Comment

Autocomplete Boilerplate

If you haven’t already, be sure to take a look at Bin Chen’s EACL package. The idea is that if you have some boilerplate in a project, you can type the first few characters and EACL will grep the project looking for matches. It presents the candidates in the usual Ivy way and will insert the candidate of your choice.

The project is available on Melpa. You can see an automated gif of it in action at Chen’s post or the project’s GitHub page.

Posted in General | Tagged | Leave a comment