Hippie Expand

Over at Mastering Emacs, Mickey has a nice post on one of Emacs’ hidden gems: hippie expand. The odd thing is that although it is the most capable expander built into Emacs, it does not have a default binding. As Mickey points out, its much less versatile cousin, dynamic abbrev does have a binding but hippie expand does everything it does so there’s no reason to bother with it.

Mickey suggests remapping the binding for dynamic abbrev to hippie expand since it’s unlikely Emacs will ever change the current default. Of course, that’s part of the power of Emacs: you don’t have to put up with the way things are; you can change them to suit yourself.

I’ve been using hippie expand for years and have it bound to Meta+Tab, which seems natural to me for a completion mechanism. Dynamic abbrev is bound to Meta+/, which isn’t as natural but may be easier to type. After reading Mickey’s post I’m going to remap Meta+/ to hippie expand and see if I like it. Of course, Meta+Tab is burned into my muscle memory so I’ll probably forget to use it.

In any event, be sure to take a couple of minutes to read Mickey’s post. As usual it’s well written, informative, and well worth your time.

Posted in General | Tagged | Leave a comment

The NSA, Ciphers, and Backdoors

For many years, we’ve been living in a sort of golden age of digital encryption. This is no longer of interest just to the military or other federal agencies that want to secure their data. Indeed, our economy depends upon encryption to secure everything from our routine banking and credit card transactions to keeping our texts and browsing secure.

Sadly, most of the encryption methods are reaching their end of life. The problem is quantum computing, which makes brute forcing these methods practical. The good news is that new methods that are resistant to quantum computer attacks are being developed and will shortly be deployed.

The standardization of these new methods is being handled by the National Institute of Standards and Technology (NIST) but, of course, all the real expertise resides at the NSA, which is involved with new standards. The problem is that no one trusts the NSA to not weaken the methods or arrange for a backdoor that they can use to spy on our communications.

The NSA has no one but themselves to blame. There have been several documented cases of the NSA trying to sneak backdoors into both national and private crypto primitives. This time, though, the NSA is crossing its heart and promising not to put any backdoors into the new standards. The demurrals are being met with substantial skepticism.

One doesn’t have to be overly cynical to be suspicious. The NSA, after all, does have a history of doing exactly what people are suspecting them of doing. On the other hand, they are, sometimes, honest brokers. Back in the early 1970s when DES was being developed, the NSA suggested some mysterious and unexplained changes to the S-boxes at the heart of the method. People were very suspicious but a couple of decades later it was revealed that those changes were, in fact, to harden DES against the still secret differential cryptanalysis method for breaking ciphers.

Things are different now. The NSA no longer has an (American) monopoly on cryptographic knowledge and techniques. Whatever they propose will be put under the microscope and it’s unlikely those doing the investigations will keep their findings secret.

Posted in General | Tagged | Leave a comment

Changing Directory to a Remote Machine

I’ve written about this before but it’s so useful and magic-like that it bears repeating. The TL;DR is that when you’re in eshell, you can simply cd to a directory on a remote machine. Once there you can pretty much treat the remote machine as if its file system is mounted on your local workstation.

Alain Lafon has a short post that describes using cd to seamlessly log into another machine. You use the same syntax you would with Tramp to specify the path to the remote machine. Once there, you can copy files to and from the remote machine, load a file with the usual Ctrl+x Ctrl+f, or any of the other normal operations. As Lafon says, “It’s magic!”

Posted in General | Tagged | Leave a comment

Eight Hundred Quit Rather Than Go Back To The Office

I and many others have said this so many times you’re all doubtless tired of hearing it but it still hasn’t sunk in. People do not want to and will not return to yesterday’s work environment. In particular, they are not going to return to the office. Why, they ask, should we endure horrible commutes and micro-management from control freak middle managers when we are much more productive at home?

Many companies seem unable to understand this but they bury their heads in the sand at their own peril. The latest to learn this is WhiteHat Jr who have had over 800 employees quit over orders to return to the office.

It used to be that the argument was that you were cutting yourself off from the best employees if you insisted they work on site. It’s increasingly becoming the case that you’re cutting your company off from all employees if you insist on the old ways.

To be sure, not all jobs can be done remotely but many can and every company that wants to retain their employees should carefully consider which is which. Some people really do like the office environment and will be happy to return but the vast majority are saying “no thanks” and are backing that up by quitting if their employers insist.

It’s becoming ever more clear: adapt to the new reality or lose your best employees. That’s another way of saying adapt or die. Darwin would understand.

Posted in General | Tagged | Leave a comment

Some Useful Emacs Shortcuts

Just a quickie today. Bhaskar Chowdhury has a short video (6 minutes, 54 seconds) that describes 4 vital Emacs shortcuts. Three of them are probably already in your repertoire:

  • switch-to-buffer (Ctrl+x b)
  • async-shell-command (Meta+&)
  • shell-command (Meta+!)

Most of you probably use those all the time. The last is something I didn’t know about. If you’re an Ivy user, there’s the counsel-switch-buffer command. Its like switch-to-buffer except that as you scroll down the list of buffers, the buffer at point is displayed in the current window so you can see its content. That can be handy, especially if you have many buffers open at a time.

The counsel-switch-buffer command is not bound by default so if you kike it you will either have to find a binding for it or simply steal the Ctrl+x b binding for it. You probably don’t want to use Ctrl+b as Chowdhury does since it’s an important cursor movement chord.

Posted in General | Tagged | Leave a comment

Red Meat Friday: Nannies

I promised that this week’s Red Meat Friday would serve as a sort of balance to last week’s RMF post making fun of IDE users. It was supposed to be about an Emacs reddit post that asked Is emacs only for those with “low” cognitive abilities? That was an obvious troll and most of the respondents recognized that and joined in the fun. Those who took the post seriously—or didn’t care that it was a troll—engaged its points and provided reasonable rebuttals.

Sadly, you can’t read the post (although the comments are still available) because some reddit nanny decided that the post was insufficiently civil or something. When did we become such babies? The post didn’t call out any individual and wasn’t vicious. It just poked fun at Emacs users exactly as Vi users and other editor partisans have been doing for ages.

I don’t know about the rest of you but I don’t want or need any humorless apparatchiks censoring what I can read. I’m sorry to see this nonsense invading the tech sector. Judging by what’s happened in other domains, it won’t end well.

Posted in General | Tagged , | Leave a comment

Torstein Johansen on Keyboard Macros & Multiple Cursors

Torstein Johansen, who’s been using Emacs for 20 years, has a shocking confession: Although he learned about them, he’s never used keyboard macros. Part of the reason for that, he says, is that he uses multiple cursors instead. My first impression was, “But multiple cursors was just introduced 3 or four years ago.” Actually, Sveen’s famous Emacs Rocks! video on multiple cursors was 10 years ago so it’s more than possible that lots of people have always used it in preference to keyboard macros.

Regardless, Johansen set out to remedy the situation by getting serious about macros and recording a short video on how to use them. The video uses macros to solve a simple reformatting problem and then solves the same problem with multiple cursors for comparison. The amount of work is pretty much the same—especially if use the repeat macro to end of buffer command instead of repeating it for each line—but multiple cursors does take a few less keystrokes.

The video illustrates a problem with multiple cursors that I mentioned in my Are Multiple Cursors Suboptimal? post: there are several commands devoted to placing the initial cursors that you have to know whereas you can do real work with keyboard macros by just knowing how to start and end the macro recording. I like the F3 and F4 keystrokes for that especially since F4 will replay the macro after it’s been recorded.

All in all, the video is a nice introduction to using keyboard macros and it’s short (3 min, 31 secs) so there will be no problem finding time for it. The video does not cover everything you can do with macros but just knowing the simple commands Johansen illustrates will cover 90% of everything you want to do.

Posted in General | Tagged | Leave a comment

FIDO and The End of Passwords

Eight years ago, I wrote about FIDO, a proposal to replace passwords with a secure way of signing onto sites and applications. Of course, anyone can propose a new, better protocol for a security problem but implementing it and getting industry buy-in is the hard part and usually results in the death of the proposal.

Happily, FIDO seems to avoided that fate. Apple, Microsoft, and Google have committed to support the standard and are pledging to roll out implementations this year. If you’re Aunt Millie, you don’t care or understand any of this. All you know is that you’re not going to do anything more complicated than what you’re already doing. The FIDO proposal addresses this by making signing up for and using the FIDO protocol as easy as possible.

With the three major platforms signing onto the FIDO proposal, there’s a good chance that we’ll finally get away from depending on passwords and suffering from all their deficiencies. Doubtless the scammers will find weaknesses and ways to exploit the system but we’ll certainly be better off and the new system should be resilient enough to recover from the scammers’ incursions.

At the very least, we won’t have passwords like password or 12345678 putting naive users and the rest of us at risk. I hope that by this time next year passwords will be a distant memory.

Posted in General | Tagged | Leave a comment

The Emacs 28 Edition of Mastering Emacs

Good news for all Emacsers who have a copy of Mickey Petersen’s excellent Mastering Emacs: Mickey has updated the book to cover Emacs 28. You can read the “2022 Edition Update” section of the book at the previous link but the TL;DR is that the big change is, of course, native compilation and that Emacs 28 otherwise consists of incremental changes to many aspects of Emacs. You can read the section or Mickey’s longer treatise on what’s new in Emacs 28 for details.

If you currently own the book, you’ve probably already received an email from Mickey alerting you to the update. You can get the update for free by using the secure link for updating that you originally used to get the book and subsequent updates.

If you don’t yet own a copy, now’s a good time to get one. You can buy it for only $28.79 at the Mastering Emacs site. It’s a great book and one every Emacs user should have.

Posted in General | Tagged | Leave a comment

Following Org Links Outside of Org

Tony Aldon has been busy posting informative articles to the Emacs reddit. One of his latest discusses org-open-at-point-global, a way of following a link formatted in Org syntax even if it’s not within an Org buffer. That’s something I didn’t know about but can be pretty handy. Rather than killing the link and pasting it into Emacs, your browser, or some other application, you simply put the point on the link and call org-open-at-point-global.

The example Aldon uses has two links before the definition of a user-defined function in an init.el file. One, [[help:pcase]], was a link to the HELP entry for pcase. The other, [[info:elisp#Current Buffer]], was a link to the Elisp info node for “Current Buffer”. Both links are in a comment in an Elisp buffer so they are in no way active as Org links. Nonetheless, org-open-at-point-global will follow the link by popping up a buffer to the appropriate place.

Almost all my non-code text buffers are Org buffers so Aldon’s example is perfect for me. If I want to put a link to something in a source code buffer, I can use the usual Org syntax in a comment and follow it easily if I need to.

It turns out that there’s an edge case concerning link definitions that Aldon discusses but other than that, org-open-at-point-global will faithfully follow any link. The link definition issue was raised on the Org-mode list so perhaps the edge case will be fixed.

To be sure, org-open-at-point-global is a small thing that’s not going to revolutionize anyone’s workflow but it’s still useful and I’m glad to have discovered it from Aldon’s post.

Posted in General | Tagged , | Leave a comment