Searching As You Like It

Álvaro Ramírez likes that Emacs’ customizability means that you can make it behave exactly the way you want it to. He illustrates this with a simple but useful bit of Elisp that implements what he describes as a DWIM search.

Ramírez is a fan of abo-abo’s great Swiper search function but doesn’t like the way it interacts with keyboard macros and multiple-cursors. To fix that, his function checks if he’s defining a keyboard macro and if so, falls back to the default isearch-forward. If he’s not defining a keyboard macro, the function checks if he’s currently invoked multiple cursors. If so, it calls phi-search to do the search. Phi-search is search/replace package that works well with multiple cursors. Finally, in the default case he simply calls Swiper but arranges for searches to wrap around and automatically use any highlighted region as the search term.

All of this is simple and easy to do but arranges for searches to act just the way Ramírez wants them to. Like yesterday’s post, this serves as another example of how Emacs allows us to automate tasks we do all the time so that our workflow is more frictionless.

Posted in General | Tagged | Leave a comment

File Templates in Emacs

Jeremy Friesen has to write a weekly summary of his team’s work. That summary has a fixed format so management provided a template for it. Being an Emacs user, Friesen, of course, wanted to write his report in Emacs.

He wrote a bit of Elisp that allowed him to insert the template into and Emacs buffer and configure the buffer. This is a common need and other Emacs users may want to do something similar. Friesen writes his report in Markdown so he sets the buffer with the template to markdown-mode. Other Emacs users may prefer to use something else such as Org-mode but it’s easy to tweak his code to do that.

All of this can be done “manually”, of course, but having everything wrapped up in a single function streamlines your workflow and makes day-to-day chores easier. If you’re like me, you probably have several things like this: simple multistep tasks that you could easily automate but just haven’t bothered to. I find that after a while I reach a threshold where I think, “It’s crazy that I keep doing this by hand all the time, I’m going to automate it.” The sad thing is that it takes me so long to reach that threshold.

The real message of Friesen’s post is not about templates but about automating those simple tasks that seem like they’re not worth the effort until they do.

Posted in General | Tagged | Leave a comment

Who Can Work From Home

The Journal of Public Economics has an interesting paper by Jonathan I. Dingel and Brent Neiman on How many jobs can be done at home. The TL;DR is that they looked at broad job categories and by using surveys on what doing those jobs require they determined what jobs could be done entirely at home (spoiler: 37% in the U.S.).

The research is presented in the context of COVID-19 social distancing requirements but it’s also interesting to those of us who have been interested in working from home long before COVID-19. As expected, those who do the sort of work that most Irreal readers do are at the top of the list: we can do 100% of our work from home. Obviously, if you’re serving people at a restaurant, you can’t do any of your work from home. What makes the paper interesting is that it looks at jobs between those two endpoints and considers what percentage of their work can be done from home.

The other interesting result from the paper is that the ability to work from home is positively correlated with wages. That’s not too surprising, of course. A programmer or mathematician makes more than a waiter. What’s surprising is that the graph or wages versus ability to work from home is essentially linear.

It’s a bit of a slog to get through the paper for those of us with STEM backgrounds but that’s only because some of the terms and references are unfamiliar. There’s a lot of information in it even though it’s fairly short. Worth a look if you’re interested in the work-from-home phenomenon.

Posted in General | Tagged | Leave a comment

Steve Yegge on Emergency Emacs

If you’re an Emacs user you’re probably familiar with Steve Yegge’s famous Effective Emacs post. If you’re not, you should go read it right now. It’s full of suggestions to make you more efficient at using Emacs. It really increased my Emacs efficiency when I read it several years ago.

A couple of weeks ago, I wrote about Yegge’s Guided Tour of Emacs video. That turned out to be one of his most popular videos so he’s back with a sequel: Emergency Emacs. The video is very reminiscent of his Effective Emacs post. He demonstrates some of the ways makes his Emacs use as efficient as possible.

He starts out explaining the Emacs undo operation and how you can use it in unexpected ways. For example, he shows how you can use undo to return to the last change and even use it as a second mark in some cases. He also mentions and demonstrates undoing in a region that I wrote about previously.

The bulk of the video involves Yegge’s custom keybindings. That doesn’t sound very interesting. After all, who cares if someone is grumpy about the default bindings and make their own? But that’s not the point. It’s all about having efficient bindings for the things he does the most. For example, Yegge doesn’t like the using the meta key because no matter what you map it to, it’s hard to reach without moving a hand. His solution centers around strategies like mapping execute-extended-command, that’s usually mapped to Meta+x to Ctrl+x m. He also maps it to Ctrl+c m in case he fat fingers the Ctrl+x.

Another example is mapping end-of-buffer and beginning-of-buffer to Ctrl+x e and Ctrl+x t because he moves to the beginning and end of buffer a lot and the default bindings of Meta+< and Meta+> are clumsy to type.

There are other suggestions as well so you should certainly spend the time to watch the video. It’s a couple of seconds short of 54 minutes so you’ll definitely have put some time aside but it’s definitely worth the investment.

Posted in General | Tagged | Leave a comment

Protesilaos Stavrou on Emacs and Freedom

Protesilaos Stavrou has posted his talk to LibrePlanet 2022 on Emacs and the meaning of freedom as understood by those of us in the free software community. The talk is comprehensive in that he starts with an explanation of what Emacs is, moves on to how he uses it, and finally discusses its relationship to freedom and personal autonomy.

The point of Emacs, according to Stavrou, is its extensibility. In a large sense, the freedom that Emacs brings lies in its extensibility rather than the legalities associated with its copyright. Like me, Stavrou considers Emacs not just an editor but a Lisp Machine. It’s being a Lisp Machine, he says, that brings Emacs its power. That’s because the user can customize Emacs to suit their own workflow. It allows the user to take control of their computer in a way that most other software doesn’t.

The other important aspect of Emacs that helps make that freedom possible is that it’s self-documenting. It’s extensibility would be far less useful without the documentation. After all, what’s the point of being extensible if you can’t discover how to use it.

I found the talk interesting and Stavrou’s take on the freedom associated with Emacs provocative and worth thinking about. The video is 37 minutes, 24 seconds long so you’ll need to schedule some time.

Posted in General | Tagged | Leave a comment

Org Speed Keys Implementation

Tony Aldon has an interesting post on reddit that discusses the implementation of Org speed keys. That doesn’t seem like it would be all that interesting but it turns out to be more complex and involved than you might think, involving—among other things—the self-insert function that places characters you type on the screen and in the buffer.

Aldon does a really nice job of walking us through the code to show us how things really work. You need to be at least a little familiar with Elisp to understand the flow but it’s worth the effort. On the one hand, an Emacs user doesn’t really need to understand any of this to effectively use Emacs but understanding how things works makes Emacs less opaque and easier to reason about.

The nice thing about posts like Aldon’s is that they introduce us to the workings of Emacs a little bit at a time. By taking tiny bites, we’re not overwhelmed by what is, after all, a pretty complex program. It’s a fairly long post but if you want to increase your understanding of how Emacs works, it’s well worth your time.

Posted in General | Tagged , | Leave a comment

Google To (Sometimes) Require ID in Australia

Reclaim The Net has a very disturbing article about Google’s recent announcement that starting next month they will require proof of age before allowing Australian users to view certain “age-appropriate” content. The proof would consist of uploading a copy of the user’s drivers license, passport, or credit card. The new policy is in response to a new Australian law requiring such proof “to protect the children”.

The first paragraph of the article is

Governments all over the world have started pushing for ways to collect ID on social media users, often under the guise of providing a safe space for kids online.

When I first read that I thought it was hyperbolic pearl clutching from the privacy sector. After some thought, I think they may have a point. Policies like this are never what they seem. It is almost universally true that whenever you see the phrase “think of the children”, you should check your wallet because someone is trying to run a scam on you.

With that in mind you needn’t be overly cynical to wonder if the real purpose of the policy is to collect the names and credentials of people doing things the nosy Parkers don’t approve of. Google’s embracing of the policy isn’t hard to understand either. They’re always trying to collect that exact type of information from their users. And no one but a fool would take their assurances about privacy and destroying the data seriously. The Iron Law of Data Collection tells us that more and more data will be collected and that it will be abused. It’s a safe prediction that it won’t be long before the first case of the government demanding a user’s data. It’s all to protect the children, of course.

The final irony is that the “children” whom this policy purports to protect know far more about the use of the Internet then the drooling clowns who pass such laws. If they want to see restricted material they’ll simply use a VPN to make it appear the request isn’t coming from Australia. If you come from the class of people who describe the Internet as a series of tubes, that last sentence won’t make any sense to you.

Posted in General | Tagged | Leave a comment

Structuring Writing as a List

Posting to Irreal everyday means I do a lot of writing and spend a lot of time thinking about how to structure a few words into an intelligible whole. Over at DYNOMIGHT there’s a post that takes an interesting view on how to structure writing that I hadn’t seen before. After reading it, though, I realized that the proposed method is what I do unconsciously, at least for my longer form writing.

Dynamight’s take is that very often—maybe even usually—the best way to structure an essay is as a list. He starts with two hypothetical articles concerning sleep. The first is entitled The Theory and Practice of Sleep. The second is Seven Insights About Sleep. Which seems more compelling? The first seems like it might be more comprehensive but also like it’s going to be a long and hard read. The second seems like it may offer a good introduction while being an easier read. Perhaps it will be all I need but seems, in any event, like a good place to start.

His second demonstration is even more convincing. It consists of two version of ten paragraphs consisting of nothing but “blah blah blah blah …” The first is structured as usual: 10 paragraphs of blahs. The second is formatted as a list. At least Dynamight calls it a list. It looks more like an essay with numbered headings to me but the point stands. It does look more approachable.

Most of the rest of the post expands on this example but pointing out how the second version better meets a reader’s needs and expectations. If you do any writing it’s definitely worth taking a few minutes to read the post. Best of all, it’s structured as a list.

Posted in General | Tagged | Leave a comment

LibreWolf

I just saw a reference to the new LibreWolf project. It’s a fork of the Firefox browser that focuses on privacy and security. Among other things, they’ve eliminated all telemetry and data gathering and the annoyances that go with it. They also hardened the browser to support maximum privacy and provide protection against tracking and fingerprinting. They’ve even built in uBlock Origin to eliminate unwanted content.

It’s an interesting project and may appeal to those who were put off Firefox by the Brendan Eich controversy. The code is still mostly Firefox’s, of course, but the LibreWolf project is not affiliated with Mozilla. Perhaps the project will even breathe new life into the Firefox browser technology. The current situation with the browser market dominated by Chrome is far from ideal from a privacy standpoint.

Of course, all the heavy lifting is being done by Mozilla so LibreWolf can not be viewed as “Firefox killer”. It’s more of an alternate version of Firefox with features that may appeal to those looking for enhanced privacy and security.

I hope the project succeeds. I’m always in favor of products that don’t hoover up our information and we can certainly use a little more diversity and choice in the browser market.

Posted in General | Tagged | Leave a comment

Red Meat Friday: Internet Laws

Some of you may argue that today’s offering isn’t really Red Meat but since almost everybody will be offended by something in this list of Internet Laws, the Minions have ruled that it qualifies.

You’ve probably seen some of these—Murphy’s Law, for example—but others will probably be new. They were certainly were to me.

The list is amusing and worth a few minutes of your time if only to make your Friday go a little faster and easier. If the list strikes your fancy, there are links to two more lists, Laws of Programming and Miscellaneous that you will probably enjoy too.

Posted in General | Tagged , | Leave a comment