A Followup To Why You Can’t Use Emacs More

One of the odd things about writing Irreal is that I never know which posts will be popular or at least provoke some engagement. Often, posts that I think are really interesting receive no comments and posts that I suspect will be of marginal interest strike a chord with readers.

Yesterday’s post, Reasons You Can’t Use Emacs More, is an example of the latter. I wrote it mostly because I was enraged by the idea of people who don’t use editors telling people who do which editors they can use. I didn’t expect most people to care but there are, it seems, a lot of our colleagues suffering from that and they are, likewise, enraged.

Of course, they’re hackers and often find ways of bypassing the nannies. But not all the problems are caused by the nannies. Often, the issue is finding some way of a way of performing a necessary task with Emacs. This usually arises when the “normal” app for performing some task won’t interoperate with Emacs.

Serendipitously, I found this Emacs subreddit post by arni_ca asking what sort of tasks people perform with Emacs. That seems only marginally related to JTR’s problems from yesterday’s post but when you read through the comments you find lots of ways people have found to do things in Emacs even if it doesn’t seem possible at first glance.

It is, really, an encouraging post because it shows that it’s very often possible to find some way of importing an important task into Emacs. The real problem is discovering those methods. Posts like arni_ca’s help but that still means reading through a lot of blogs and reddit posts to find them. Sacha’s Emacs News is a good place to start. It provides a weekly review of interesting Emacs news and helps keep you up to date with minimal effort.

Posted in General | Tagged | Leave a comment

Reasons You Can’t Use Emacs More

Over at The Art Of Not Asking Why, JTR has some nice things to say about Irreal but that’s not what I want to talk about. Rather, I like to address the point of his post, which is how difficult it can be to use Emacs as much as he’d like.

There are two main issues. The first is work problems. Lots of companies make it difficult to use anything other than “approved applications”. These are almost always brain-dead Windows apps that don’t work all that well and certainly don’t interoperate with others apps.This sort of thing is usually driven by what my son calls the “Notwork Nazis”, his term for the network engineering folks having an obsession with making sure that not a single unauthorized activity takes place on “their” network.

These guys don’t—usually—care what you do on your own machine as long as it doesn’t impinge on the network. There are, sadly, more extreme cases. Consider this case of of a company so clueless and intent on controlling every aspect of their employees’ work environment that you can’t use Emacs at all because it’s “An old fashioned and slow text editor created by Canonical for use with the Ubuntu operating system.” These morons are actually scanning machines to make sure no unauthorized editors are being used.

There are many degrees of this dysfunction. If it’s only that you can’t access company Email through Emacs, that may be tolerable. If your management thinks Emacs was developed by Canonical, it’s probably time to find another job.

The second problem that JTR encounters is that Emacs doesn’t interoperate with some apps that are important in his workflow. He gives the example of Grammarly. Being a curmudgeon who doesn’t like being told what to do, I’m not a Grammarly user but I take JTR’s point.

These apps obviously have an API so they can interoperate with others apps but sometimes they’re loath to share them. I’m not sure why that’s so. Wouldn’t you want your app to work with as many other apps a possible?

In any event, it’s a sad truth that it’s not always possible to use Emacs as much as you’d like.

Posted in General | Tagged | Leave a comment

Apparently Not Everyone Gets The Irony

At this point, I’m old enough that you’d think I’d know not to believe that governments could ever learn their lesson. But no, it just isn’t so. A month ago I was all warm and fuzzy about the fact that the U.S. government, as a result of the Salt Typhoon exploit of the law enforcement wiretap infrastructure, was now recommending that everyone use end-to-end encryption wherever they could.

Apparently, our closest ally, the UK, didn’t get the memo. They just issued a secret order to Apple ordering them to provide a backdoor for all encrypted communications in all countries [1, 2, 3]. That means, for example, that U.S. citizens, Spanish Citizens, Chinese Citizens and everyone else would have their private communications exposed to the UK security services.

A few impressions that immediately pop out to me are:

  • The UK’s record of safeguarding secrets is no better than that of the U.S. or any other country
  • Their naive belief that they could issue a “secret” order and that it wouldn’t be revealed shows that they have little appreciation for today’s on-line world and the way it works. This speaks to their ability to safeguard the backdoor they’re seeking.
  • The effrontery of issuing an order to a foreign business—yes, I know Apple has a presence there—and insisting that they assist them in spying on citizens of foreign countries is breathtaking. Of course, all governments want this capability but it’s hard to see how they can avoid taking the side of their citizens on this issue.

Apple has made no comment but it’s hard to see them acquiescing to this demand. The UK is a tiny part of their customer base and if the UK doesn’t back down I wouldn’t be surprised to see Apple withdraw from the UK market.

In any event, it’s a stark reminder that you can’t depend on the security services in particular and governments in general to look beyond their immediate needs.

Posted in General | Tagged | Leave a comment

Elisp Abstraction

Over at the Emacs subreddit, AbstProcDo proposes an interesting idea: some Elisp constructs are very intuitive and natural compared to other languages. He uses the example of dolist to process a list versus the Python way.

(dolist (item '(1 2 3 4))
  (print item))

versus

for item in ['a', 'b', 'c', 'd']:
    print(item)

It’s a valid point but I think there are better examples to make it. How about

(dotimes (i 10)
  (print i))

versus the same in C

for ( i = 0; i < 10; i++)
    printf( "%i ", i)

The Elisp macro suggests that we want to perform its body for the values \(0 \cdots 9\). The C for loop construct is all about initializing, incrementing, and terminating the loop. Of course, the same can be said of the Lisp do construct.

There’s nothing wrong with either of these approaches, of course. I’ve written a lot more C than I have any type of Lisp and the semantics of the for loop are embedded in my brain. Still, AbstProcDo has a point. The Elisp does seem more natural.

It would be easy to make too much of the comparison and enlist it for use in some sort of language war but that’s not my intention. I merely think it’s a provocative idea and worth thinking about. There are, I’m sure, counter examples, and I’m sure we’ll be learning all about them from the comments.

Posted in General | Tagged , | Leave a comment

Projectile Caching Improvements

Bozhidar Batsov, the developer of projectile, has announced some updates to its caching behavior. The idea is that a projects files are cached so that they don’t have to be reindexed every time your bring up a project.

Projectile has always done this, of course, and it works well but Batsov has always had in mind some improvements and is now getting around ti implementing them. His post is interesting because it gives us a window into his thinking. It’s always instructive a have a good developer explain his choices and his thinking.

Take a look at his post to see what I mean. Batsov says that most people have probably abandoned projectile for project.el but he believes that projectile still has some things to offer. I’m not in a position to say but I am a fan of Batsov’s work, especially in this area.

Posted in General | Tagged | Leave a comment

Exporting To Word In The Real World

As you all know, I’m a huge fan of Org mode and use it for virtually all the writing I do. One of the powers of Org is that you can export it to many different formats. One of those formats is the Borg Word. I always make some facile statement like, “and you can export to Docx if you need to produce a Word document.” But, of course, the reality is a bit different.

Chris Maiorana is a writer and has to acquiesce to the demands of his publisher. Sadly, that most often means submitting your manuscript in Word. It makes perfect sense for the publisher. They can have a single file for the entire production pipeline. They don’t have to deal with paper, can easily track editorial suggestions and the author’s reaction to them, and when everybody is happy, they can send it to the printer.

To those with any sense of aesthetics or writing efficiency, it makes no sense at all. Word is a horror and makes me want to stick a pencil in my eye every time I have to use it. Fortunately, there’s an escape hatch. You can write in Org mode and leverage the power of Emacs and then export it to Word when you’re done.

Of course, the actual process can be a little more complicated. Maiorana has an excellent post on how to actually handle the process. The first, probably most important, issue is dealing with different Word formats that the various publishers require. Maiorana shows how to deal with that and to pick the appropriate publisher format template at export time.

Take a look at Maiorana’s post for the details. He also has an interesting clip of a chat between Lex Fridman and Neal Stephenson talking about Emacs. Stephenson talks about publishers “putting their foot down” and requiring Word. He talks a bit about how he deals with that. I’m not sure when the talk took place but at the time Stephenson wasn’t using Org. That’s too bad because it would have solved a lot of his problems. I’m sure he’s probably discovered it by now.

Posted in General | Tagged | Leave a comment

Unloading Emacs Themes

Here at the Irreal bunker, we’re stodgy, like things the way they are, and are not inclined to change things willy-nilly. As far as Emacs is concerned, that manifests itself in the eschewing of themes. The bunker doesn’t really have a theme. It’s just the default light configuration with the background changed to a light tan (oldlace) and the cursor colored red. That’s just a couple of init.el statements; not a proper theme.

Still, lots of people like to experiment with different themes and change them often. That’s understandable—at least if you’re not stodgy—because there are a lot of great themes available and more are being released all the time.

That brings up the problem of changing themes. It turns out that when you load a new theme, it overlays the existing theme and unpleasant interactions can occur. The proper way to handle this is to first disable the old theme and then load the new theme.

Bozhidar Batsov likes playing with new themes but finds that it’s a chore to worry about disabling existing themes. So, being Batsov, he solved that problem by writing a bit of Elisp for loading a new theme that first disabled any existing themes. It’s short and easy and if you also like to experiment with different themes, it might be worth your while to take a look at Batsov’s solution.

Posted in General | Tagged | Leave a comment

🥩 Red Meat Friday: Parenthesis In Lisp

I love Lisp. I think it’s the perfect language for a very wide variety of problems, that it’s powerful, easy to learn, and that it provides the perfect environment for what I call exploratory programming.

There are some downsides. One of the most annoying is that it attracts a huge number of people who haven’t bothered to learn Lisp complaining about “parenthesis”. “So many parentheses! I can’t read it. Why don’t they just use braces like other languages?”

What these people fail to understand is that the Lisp “syntax” is actually the parse tree for the code. That means, among other things, that those parentheses—or some similar symbol—is absolutely necessary. Otherwise, you can’t specify the parse tree.

Sure, it doesn’t have to be that way. You can choose from any number of conventional languages that have compilers to build those parse trees for you, but if you want to write in Lisp you’re going to have to write explicit parse trees. The odd thing is that it’s actually easier to write the parse trees yourself. It means that the syntax of the language is very simple and easy to learn. There are no annoying precedence rules to remember nor a huge number of special symbols with their own syntax to remember

But some people just won’t accept the gift. They insist upon complaining about the parentheses and, even worse, proposing schemes to do away with them. The fact that the result would no longer be Lisp seems to escape them.

That brings us to the point of this post. Over at the Lisp subreddit, nderstand2grow is proposing yet another scheme to reduce those pesky parentheses. My first reaction on seeing it was, “Oh dear God! Not again.”

Common Lisp and Elisp actually have a construct in the spirit of his scheme: the loop macro. The Loop macro is the subject of considerable controversy in the Lisp community and many Lispers, myself included, consider it a violation of the Lisp way. Yes, it’s powerful but it is, in the end, an escape from Lisp, much like an FFI.

I don’t, by any means, insist that people write in Lisp but if you do, write in Lisp and stop trying to turn it into Pascal or whatever. We all know what DMR said about that.

Posted in General | Tagged , | Leave a comment

Elisp To Python Cheatsheat

Irreal has often commented on the work of Charles Choi, most recently on his Casual App Suite. Choi has just published a nice cheatsheet for Python programmers who want to write in Elisp. The idea is to compare the various Python data structures and their Elisp analogs and to show the various functions for acting on them.

The idea is to allow Python programmers to more or less bootstrap their Python knowledge to write Elisp. I used to write a bit in Python but that was some time ago. I’d be more inclined to use Choi’s cheatsheet in reverse and use it to translate Elisp idioms into Python.

In any event, the cheatsheet should be useful for those of you who want to move from one language to the other. I have always felt (and said) that Elisp is a very simple language but that the hard part was mastering the library functions. Choi’s cheatsheet helps with this by relating the Elisp functions to those of a language you may be more familiar with. If you’re interested in learning Elisp, it’s a nice resource to have.

Posted in General | Tagged , | Leave a comment

Magit 4.3.0

Tarsius (Jonas Bernoulli) has just announced that he’s released Magit 4.3.0. Six months ago, he promised to release a new version every month and this is the sixth such release.

Almost everyone loves Magit—there are a few vc holdouts—and considers it one of the major reasons to use Emacs. It and Org Mode constitute strong magnets that draw new users into the Emacs sphere. Of course, once they enter the Emacs event horizon, there is no escape and the Emacs universe grows ever larger.

Humor aside, Magit is an important part of Emacs and we should all rejoice that we have it. That brings us to supporting Magit.

Tarsius, who works full time on open source projects—primarily Magit—depends on individual contributions for support. The best thing from his point of view is continuing contributions but if that’s not possible, consider a one-time contribution to support his important work. You can find out how to contribute here.

Update [2025-02-06 Thu 10:34]: Tarius → Tarsius.

Posted in General | Tagged , | Leave a comment