Leveraging Emacs Introspection

James Cash has an instructive video that shows how to leverage Emacs introspection to solves problems or make simple changes. Cash doesn’t like the way Return behaves when the point is on a list item. The default behavior is simply to start a new line but he’d like it to start a new item.

He’s using evil mode so the keystrokes are different from what a vanilla Emacser is used to but the ideas are the same and the actual key sequences don’t matter. He notes that entering o instead of Return does what he wants so he uses the simplest type of introspection, describe-key (bound to Ctrl+h k), to help solve his problem.

By checking which command is bound to Return and which is bound to o, he’s able to figure out what changes he needs for making the Return functionality behave in the way he desires.

For purposes of the video, he does this by simply making changes directly to the function in question and evaluating it. That’s less than ideal in the real world, of course, but Cash does offer some alternative ways of making the changes.

Regardless, the point of the video is how easy it is to track down where things are happening and fix or change them if you need to. The video is only 10 minutes, 22 seconds so it should be easy to find time for it.

Posted in General | Tagged | Leave a comment

Describe Package

Just the other day when I was writing the post about Steve Purcell’s rewrite of whole-line-or-region, I wanted to ensure that I had the latest version of whole-line-or-region to make sure there weren’t any gotchas after an upgrade. I did that by going to ~/.emacs.d/elpa and checking the version number in the source file. That’s an annoyingly fussy way of doing something so basic.

Serendipitously, Bozhidar Batsov over at Emacs Redux, has a post on Describe Package that reminded me of the correct way of doing these things. I’m sure I knew this already but it had completely slipped my mind. There’s really no excuse because it has the simple binding Ctrl+h P.

If you’re using something like Ivy, you’ll get a nice list of fuzzy matches for the package to help you narrow down to the one you want. The problem, of course, is that it’s not something you use often enough to remember but it’s worth the effort. It makes it so easy to find out almost everything you want to know about a package without having to lookup and go through the source files.

Be sure to take a look at Batsov’s post if you aren’t already completely familiar with describe-package. You might not need it often but when you do it’s just what you need.

Posted in Blogging | Tagged | Leave a comment

Online Voting and Banking

There are, I’m sure, no Irreal readers who don’t understand that online voting is a really hard problem and that, currently, there are no good solutions. Those without a technical background don’t understand this and ask questions like, “If we can do online banking securely, why can’t we do online voting?” It’s a reasonable question. Take a second and think how you’d answer it.

Undoubtedly, most of you hit on the main issue: unlike banking, voting has to guarantee anonymity. If you’re like me, you tend to think of this as less important than security. After all, living in a democracy, I don’t have to worry about a strong man making sure I vote in an approved way, so what’s the big deal? But, of course, democracies can be corrupted in different ways. Votes can be bought, corporations can “strongly suggest” that their employees vote in some specific way, or even extreme social pressure can be brought to bear. Anonymity guarantees that these things don’t happen. In many states it’s even illegal to take a picture of your completed ballot in the voting booth specifically because of these issues.

Ars Technica has an interesting article that considers the question why is online voting harder than online banking? The major issue is the anonymity but they also point out that online banking isn’t really that secure. Indeed, the yearly fraud involves billions of dollars but the banks understand that they have to balance security with user friendliness and therefore write off a certain amount of fraud as the cost of doing business. That attitude obviously doesn’t work in an election.

The Ars Technica article does a good job of covering the issue and answering the question. If Aunt Millie asks you why we can’t vote online, the article provides a good, easy to understand answer. It’s definitely worth a read.

Posted in General | Tagged | Leave a comment

Prelude 1.0

Bozhidar Batsov has just announced the release of Prelude 1.0. Don’t let the 1.0 version fool you. Prelude is over 9 years old and a very mature product. Batsov expects work on Prelude to continue but doesn’t envision major changes.

In case you don’t know, Prelude is an Emacs “starter kit” that provide users with a prebuilt configuration for their editor. A lot of people think of them as mostly useful for n00bs but many experienced users have built on the starter kit foundation and that foundation lives on in their current configuration.

Batsov addresses the question of why anyone would bother with Prelude in this age of Spacemacs and Doom. He explains that explaining the core philosophy of Prelude:

  • simple
  • easy to understand and extend
  • stable
  • a foundation for you to build upon, as opposed to some end-user product that you’re supposed to use as-is

It’s an approach that is, I think, completely in accord with the Emacs philosophy: start with a bare bones functionality and build on it to get an editor that suits your needs. There’s nothing wrong with distributions like Spacemacs or Doom, of course, but if you want to understand your configuration and have your Emacs built just the way you want it with nothing extra that you don’t need, there’s a lot to be said for the Prelude approach.

Posted in General | Tagged | Leave a comment

Daring Fireball on Tracking Redux

A few days ago, I wrote a post praising Daring Fireball for it’s take on adtech’s panty-wetting reaction to Apple’s plan to require user permission before accessing the advertising ID (IDFA) on Apple devices. Adtech loves the IDFA because it allows them to uniquely identify a device and tie browsing activity back to the user to build a profile that they can sell or use to push targeted advertising.

The TL;DR of the dispute is that Apple is saying that before you can track our users you have to ask permission and the users have to agree. Adtech is right in seeing this as an existential threat because virtually nobody is going to agree to such tracking. Rather than considering how they might change their business models, the advertisers are simply throwing a temper tantrum and whining that Apple has no right to interfere with their spying on us.

The latest whiner is Instagram CEO Adam Mosseri who complains about how much this change is going to hurt small businesses in this time of pandemic. Gruber calls out Mosseri for this nonsense and then sows salt in his fields.

When all is said and done, Gruber says, these people feel entitled to track us as they always have and react with outrage when someone suggests that they aren’t. I just wish Apple hadn’t agreed to delay this important and necessary change past the release of iOS 14. Still, even if it’s a few months late it will be worth waiting for. If Apple’s new policy helps drive a steak through the heart of the adtech beast it’s fine with me.

Posted in General | Tagged | Leave a comment

Org Mode 9.4 Released

Bastien Guerry writes that Org 9.4 has been released:

The changes are here and Guerry also discusses crises in free/open software projects and how we often don’t learn about them until it’s too late. He makes a few suggestions on how we can help to make sure that Org doesn’t suffer the loss of maintainers that Helm and pdf-tools have. Be sure to give it a read.

Posted in General | Tagged , | Leave a comment

An Update for whole-line-or-region

Most of you probably know Steve Purcell as the man behind MELPA or perhaps for his Emacs configuration, which many use as a starter kit. But, in fact, he’s the author or maintainer of numerous packages, one of which is whole-line-or-region. As I’ve written before, whole-line-or-region is one of my most used commands. I call it several times a day and wouldn’t want to live without it.

Purcell has just released version 2.0. It’s a rewrite that cleans up the code and uses modern Emacs interfaces instead of ad-hoc ways of getting things done. The rewrite eliminates some nasty interactions with things like rectangle-mark-mode so there are user-visible changes as well as general bolt-tightening.

If you’re already a user and are enabling whole-line-or-region-mode, you’ll want to change that to whole-line-or-region-global-mode. Be sure to take a look at the README for some other details.

If you aren’t already a whole-line-or-region user, this is your chance to try it out. You’ll be surprised at how useful it is. When you read the description, your reaction might very well be “meh” but once you start actually using it, you’ll wonder how you ever got along without it. Purcell calls it “an under-appreciated gem in the Emacs world” and I agree. I don’t know why it hasn’t been subsumed into Emacs core. It really is that useful.

Posted in General | Tagged | Leave a comment

Happy Programmers Day

This being a leap year means that Programmers Day comes a day early. As a cal -j will tell you, today is, in fact, the 256th day of the year. So happy Programmers Day to all you Irreal readers who do daily battle trying to make the computer do what you mean™.

Posted in General | Tagged | Leave a comment

An Emacs Workflow for Videos and Podcasts

Protesilaos Stavrou has posted a very nice video that describes how he uses Bongo and Elfeed to play and control his videos and podcasts. Just being able to handle your videos and podcasts with Emacs is a win because it puts another function under the Emacs umbrella.

But the video is much more useful because it serves as a nice example of integrating otherwise unrelated packages within Emacs to provide an excellent workflow for listening to podcasts or videos. Stavrou demonstrates how he can move a multimedia feed directly from his Elfeed index to his playlist for later viewing or listening and the seamless switching back and forth between Elfeed and Bongo buffers.

As usual, Stavrou has added a lot of functionality to the base applications with his own code. He’s linked to that so you can see how he does the magic if you’re interested in recreating or adapting it for your own use. There are two related videos, one to how he uses Bongo and the other to how he uses Elfeed. You should watch those first if you haven’t already seen them. The video is only 12 minutes, 13 seconds so it should be easy to fit in unless you need or want to watch the other videos.

Posted in General | Tagged | Leave a comment

Life Imitates Literature

Old-time Irrealers and alert newcomers know that I’m a big fan of Iain M. Banks’ Culture novels. Indeed, this blog is named after one of his ideas from the novel Excession: the Irreal. I mention Banks because I was reading yet another article about “deep fakes” and how they mean the end of civilization, or something.

That reminded me of another of Banks’ Culture novels: The Player of Games. The backstory is too complicated to relate here—read the story, it’s great—but the initiating event is a bit of blackmail. That was supposed to be impossible in the Culture because, as Banks puts it,

Anybody could make up anything they wanted; sound, moving pictures, smell, touch…there were machines that did just that. […] Where nothing could be authenticated, blackmail became both pointless and impossible[.]

We are not yet, of course, at that level in the real world but the continuing evolution and perfection of deep fakes does suggest a [near] future where any evidence could be seamlessly manufactured. The usual reaction to that is that we’ll all be doomed to random false accusations making our lives miserable. But what if Banks was right and that future means that no one will have anything to fear because everyone will discount any evidence a blackmailer or other miscreant might offer as evidence of wrongdoing.

Sometimes, apparently, life really does imitate art.

Posted in General | Tagged | Leave a comment