PSA: The Emacs/GnuPG Problem

Most Emacs users are probably aware of the current problem with using Gnu Privacy Guard (GnuPG) with Emacs. The TL;DR is that although you can open GnuPG encrypted files, you can’t edit and resave them. This problem was introduced in GnuPG 2.4.1 and is apparently hard to fix. As of this writing, it persists in all the GnuPG releases after 2.4.0.

A simple solution is to simply downgrade to GnuPG 2.4.0. It’s a simple solution, that is, unless you installed GnuPG with Homebrew. In that case, the solution is a bit more difficult but still not hard. I wrote about how to do it here. In a comment to that post, Michael Alan Dorman notes that another suggested—and far easier solution—is to simply add

(fset 'epg-wait-for-status 'ignore)

to your init.el. That seemed like an easy solution and I resolved to try it the next time I faced the problem.

I’ve just stumbled across a reddit post that suggests that solution will corrupt your encrypted files and make them unreadable. I haven’t had time to verify that yet but I wanted to get the warning out immediately. Hence the PSA. Until the issue is resolved, I’d avoid using that solution and downgrade to version 2.4.0 instead.

Posted in General | Tagged | Leave a comment

🥩 Red Meat Friday: Chrome Atrocities

Metanote: I wasn’t sure if this post really merited being designated a Red Meat Friday item but it is polemical and will doubtless anger some people so I guess it qualifies.

As most of you know, we here at Irreal are not (or at least no longer) fans of Google. Their crimes are well known and documented—at Irreal and elsewhere—so there’s no need to relitigate them here.

But—to channel Arlo Guthrie—that’s not what I’m here to tell you about. Rather, I want to talk about Google’s Web browser, Chrome. The main thing I don’t understand about it is why anyone uses it. Its performance is no longer top-of-the-line and its main purpose seems to be as an information harvester for the Google advertising machine. Yet it is, by far, the most popular browser. Why is that?

Now there’s something new to add to the list of Chrome atrocities: changes to its extension policies and API. In its crusade to fight ad blockers, Google has modified Chrome’s extension API to make filtering more difficult and, worse, demands that all updates (including filter rule updates) go through its app store and review process. That has the effect of preventing the ad blockers from updating the rules fast enough to keep up with Google’s constant changes to its anti-adblocking scripts.

Google, of course, is describing these changes as improvements to Chrome’s security and performance but that’s transparent nonsense. The changes are, in fact, user hostile so I ask again, why is anyone using Chrome?

The TL;DR, if you’ll forgive such a thing at the end of the post, is this: Get rid of every Google service and app that you can. In my case, that leaves only YouTube but, sadly, that’s what this post is really about.

Posted in General | Tagged , | Leave a comment

Why NYXT Is Programmed In Lisp

NYXT is a browser with a workflow inspired by Emacs and Vim. In particular, it strives to be keyboard driven and use Emacs-like shortcuts to speed and ease navigation. The development team takes this inspiration seriously and uses Common Lisp to program NYXT.

Naturally, this brings out the Lisp skeptics and haters who want to know why in the world anyone would choose Lisp as their development language. John Mercouris and Pierre Neidhardt are two of the developers and decided to answer this question once and for all. Their answer is a nice discussion that could serve to answer the same question in any number of domains.

They consider two main factors:

  1. Future proofing and Longevity
  2. Interactive programming

I’ve written many, many times about interactive (or exploratory) programming and why it’s my preferred development method. Mercouris and Pierre give their owns views on this and it’s certainly worth paying attention to them.

The longevity question is one I don’t usually think about but it’s also an important aspect. The idea is that Common Lisp is an extremely stable platform and has been for many years. Unlike Perl, to use their example, there are no backward incompatible changes to worry about. Most Common Lisp—whenever written—will still compile and run today.

To push the Emacs analogy a bit, another advantage that Lisp, like Emacs, offers is that it lets users adapt the language to suit their needs. The macro facility even lets you introduce new syntax if you need to.

Their post is a nice one if you’re wondering why anyone would choose to program in Lisp or if you’re trying to explain to someone else why you do. It’s a nice resource and well worth a couple minutes of your time.

Posted in General | Tagged , | Leave a comment

Sorted File Listings in Denote

Protesilaos Stavrou (Prot) is continuing to add new features to the upcoming release of Denote. The latest changes are about sorted listings of Denote files. Back in November, I wrote about Prot’s work on another new feature: dynamic blocks. Part of his latest additions also involves dynamic blocks.

You can specify a dynamic block of files and populate it with a sorted list of all the denote files that match a regular expression or have a given keyword. The files can be sorted on a number of criteria and are presented as links to the files. Once the block is set up, it can easily be updated as your files evolve by simply reevaluating the block. The idea is that dynamic blocks are used in what Prot calls “metanotes”. These notes represent a summary of other notes so having an automatically produced listing of links to those files is very useful.

But wait. There’s more. You can also collect the file listing into a dired file. From there you can do any of the usual dired operations. Again, you can specify the files to be included by a regular expression or keyword.

These changes are already in the development version of Denote and Prot says that they will be officially released in Version 2.2 sometime in December. If you’re a Denote user, this is something to look forward to. If you’re not, this video may be the final nudge you need to try it out.

Posted in General | Tagged | Leave a comment

Emacs Elements On Bookmarks

Emacs Elements has a new video on bookmarks out. I’ve written about bookmarks before—most recently here—but it bears repeating how useful they can be. I don’t have a huge bookmark list but I use those bookmarks several times a day. I hate entering long file paths or, worse, trying to remember them. Bookmarks eliminates all that. They can even remember where you were in a file so it’s easy to bookmark specific parts of specific files.

As the video points out, all the keybindings for bookmarks start with Ctrl+x r, which is the same prefix used for registers. Some people find the overloading of Ctrl+x r confusing. Emacs Elements’ suggested solution is to rebind those keys. My solution is to use a hydra to jump to bookmarks and let which-key remind me of the rest after I type the Ctrl+x r prefix.

For me, the most useful part of the video was a link to his previous video on Bookmarks+. That’s what I use and have for a long time. Among other things it allows you to bookmark Websites, which can be really useful. If you’re using bookmarks, and you should be, you should definitely take a look at Bookmarks+. You should also take a look at abo-abo’s headlong-bookmark-jump to make choosing bookmarks easy.

Posted in General | Tagged | Leave a comment

Reasons To Work From Home

There’s been an ocean of words written about why it makes sense for companies to support work from home. Irreal has reported on a lot of it. A bit less has been written about why it makes sense for the employees. Those reasons could, I suppose, be deemed self evident but it doesn’t hurt to have them written down if only so management can catch a glimpse of their employees’ points of view.

Sysadmin over at Shaving The Yak writes about why he prefers—and will always prefer—working from home. A lot of it’s what you’d expect but seeing it from an employee’s perspective, in his own words, gives it more impact. One, I think, powerful point he makes is that his home office is his office and he has it outfitted in a way that makes him maximally productive. He’s got 4 monitors, an extra large desk, a couch, and a drink fridge. As Sysadmin puts it, he’d need to be in the C-Suite to have comparable working conditions at the office.

There also the cost of commuting, both in dollars and time lost in your life. The hours lost to commuting are hours you’re never getting back. There’s also the monetary aspect. Tolls, gas, and insurance can cost a significant amount of money: Sysadmin estimates around $200 per month in his case. That doesn’t even consider what happens if there are children to take care of. That alone can cost thousands a month.

He also examines some of management’s arguments including the ever popular water cooler and offers some countervailing perspectives. In particular, he’s merciless in taking down the “builds company loyalty” argument.

It’s a nice post and worth spending a few minutes on.

Posted in General | Tagged | Leave a comment

Remote Work versus Revenue Growth

Forbes has an interesting article that, to mix a metaphor, puts another stake through the heart of the Zombie that is the notion remote work is somehow harmful to productivity and the bottom line. It’s an idea that refuses to die. Yet every time research with actual data—rather than apocryphal, “gut feelings” of CEOs and micromanagers—is brought to bear, the results always put the lie to it.

Last month, I wrote about some data driven research that showed, in fact, that remote workers were MORE productive than their office bound colleagues. As I wrote then, it pays to look at the data rather than depending on the intuition of so called experts. The Forbes article looks at research that shows the revenue growth of companies that have “fully flexible” remote work policies was 16% greater than companies with more restrictive policies. Even when tech companies are eliminated from consideration, the fully flexible enterprises enjoyed a 13% greater increase in revenue growth. Those are astounding results.

Of course, correlation is not the same as causality and my first thought was that maybe the results are more reflective of the companies’ treatment of their employees rather than remote work itself. The Forbes article considers the same possibility but notes that the results do counter the commonly held belief that companies that insist their employees be on-site perform better because of water coolers and stuff.

Whether you like or agree with the findings, they do provide additional real evidence that’s based on more than some bosses’ gut feelings about the issue. The Forbes article is another great resource for those who have input to management’s thoughts on this issue.

Posted in General | Tagged | Leave a comment

Building A Bookmark Launcher

Álvaro Ramírez has a very nice post on Building your own bookmark launcher. The idea is that you have certain Web sites that you visit all the time and you’d like a quick way of opening them in your browser.

This isn’t too hard to do at small scale. I use the Bookmark+ package to launch a couple of frequently used Web sites, such as Irreal, directly from Emacs using abo-abo’s headlong-bookmark-jump to enable single letter targets. That’s great and I use it many times a day but there are a couple of problems:

  1. It doesn’t scale very well to more than a few bookmarks
  2. It only works from inside Emacs

The first problem doesn’t matter too much to me because I don’t have many Websites I need to call from within Emacs. The second (and even the first) problem is solved by the wonderful Alfred framework that I’ve written about before. I simply invoke Alfred with a hotkey, type in a letter or two of the target, and BAM! I’m taken to that site in my browser.

Ramírez’s solution solves both of the above problems in a unified way. It’s pretty straightforward, but interesting, when used from within Emacs: You get the usual completing read list of targets that allows you to fuzzy search for the desired site.

When not in Emacs, it makes a command line call to Emacs asking it to invoke the bookmark code. The clever part is that Ramírez sets up a custom frame for the interface. He also uses Hammerspoon to map a shortcut for his call to Emacs.

It’s a nice solution and worth studying even if you don’t need a way to launch bookmarks to Web sites. There’s plenty of good ideas and techniques so be sure to take a look.

Posted in General | Tagged , | Leave a comment

More On SQL For Arbitrary Data

In response to my recent post on Making Ad Hoc SQL Tables From Org Tables, commenter Fritz Grabo points to another, more general system, for doing the same thing. As Grabo points out, the method depends on the external package dsq from Multiprocess Labs. That package allows SQL queries on a number of different data types.

Grabo’s contribution is ob-dsq.el, a package that integrates dsq into the Emacs Org Babel framework. You can get an idea for what it is and how it works from his blog post. Even though my knowledge of SQL is limited, I can see how useful a facility like this can be. If you have a reasonable facility with SQL and are an Emacs user, this seems like it would be a worthwhile package. SQL is a wonderfully expressive way of querying tables and it’s nice to bring it to bear from Emacs. It’s another win if you’re committed to the reproducible research way of working.

The shortest way of seeing what’s going on is to read Grabo’s blog post. If, after reading that, you decide to adopt the system, the other links should tell you everything you need to know.

Posted in General | Tagged , | Leave a comment

Zamansky: Learning Elisp #15

Mike Zamansky has published the latest video in his Learning Elisp series. This is (probably) the last video in his emoji replacement project. In the last video, Zamansky showed how to turn his emoji replacement code into a minor mode. This video cleans things up a bit and explores two other aspects of programming in Elisp.

First off, he shows how configure the minor mode to use either the replace or overlay method for substituting an emoji for a keyword. That’s done with a boolean variable, of course, but rather than use it to test which function to call after every screen update, he uses it to set a function variable that is installed in the appropriate hook.

He mentions, but does not elaborate on, the need to use funcall to actually call the function in the variable. That doesn’t matter here because the variable is used by hook mechanism and not called directly by Zamansky’s code.

The second aspect is how to define the boolean variable. He first considers using devar instead of setq but explains that the proper way of doing it in this instance is with defcustom. Doing it that way allows the user to set the variable using the Emacs Custom interface. That way, the variable can be set once and the values will persist between Emacs invocations but can still be changed whenever the user desires.

Even if you’re familiar with Lisp from, say, Common Lisp or Scheme, the defcustom form will be new and is worth learning about. The video is 11 minutes, 59 seconds so you’ll probably have to schedule some time but as usual with Zamansky’s videos, it will be time well spent.

Posted in General | Tagged , | Leave a comment