Kitchen Sink

It’s often said of Emacs that it includes everything including the kitchen sink. Indeed, there’s even an Emacs logo reflecting this sensibility. I don’t know if it was ever an official logo but its use is widespread. Still, it would be easy to dismiss the notion as a bit of Emacs fanboy hyperbole.

Gopar has a short video that provides compelling evidence that Emacs does, indeed, include the kitchen sink and everything else. The video demonstrates two builtin functions. To say that they are obscure and little used would be an award winning understatement.

The first is a function that translates to and from Morse code. Just in case you want to know what “Emacs is amazing” looks in More code, Emacs has you covered:

./--/.-/-.-./... ../... .-/--/.-/--../../-./--.

The second functionality is to render text in the phonetic alphabet. I’m familiar with this from my pilot days, where it can increase clarity in radio communications, but didn’t expect to find it in Emacs core. If you want to know how to spell Emacs in the phonetic alphabet, here you go:

Echo-Mike-Alfa-Charlie-Sierra

Emacs calls this the “NATO alphabet”. I’ve never heard it called that before but whatever you call it, Emacs can render text into it and, of course, go in the other direction as well.

Again, these functions are builtin, not packages. They make the current agonizing over whether or not to add actually useful functionality to Emacs core look positively silly.

Posted in General | Tagged | Leave a comment

Zamansky: Learning Elisp #10

Mike Zamansky has popped in with another Learning Elisp video before he departs on his vacation. He didn’t want to start the next project and leave it hanging while he was away so this video covers some preliminaries. In particular, he covers some Elisp builtin data structures. That includes lists, pairs, vectors, hash tables, and association lists.

Vectors and hash tables have direct analogs in other languages and are probably familiar to all Irreal readers. Lists are simply linked lists and although they don’t have a builtin analog in most other languages, the idea is a common and familiar.

Zamansky explains how lists and pairs (single, unlinked cons cells) are implemented and then goes on to discuss the data structure that he’s planning to use in the next project: association lists. They’re sort of an intermediate structure, a bit like hash tables but lighter weight and not as fast. They’re the ideal key/value lookup method for small tables. It’s \(O(n)\) instead of the \(O(1)\) that hash tables provide but it’s perfect for relatively small lookup tables.

The next project is going to be about inserting emoji into a buffer and Zamansky is planning on using an association list to map the emoji name to the actual symbol. We’ll have to wait until Zamansky gets back from Europe for that but we can consider this video a teaser.

The video is 16 minutes, 16 seconds long so plan accordingly.

Posted in General | Tagged | Leave a comment

Emacs Writing Studio

As many of you know, I’m very interested in the use of Emacs for non-technical purposes. In particular, I interested in how prose writers and researchers in disciplines other than Computer Science and its close siblings use Emacs for their writing.

Peter Prevos has written a lot about using Emacs for writing and he’s gathered these posts together into an Emacs Writing Studio section on his blog. As Prevos puts it, “The Emacs Writing Studio configuration shows how to use Emacs to conduct research, write your prose and publish your text as an article, (e)book, or website.”

It’s an excellent resource conveniently broken into small easy-to-read articles. There are 28 articles—although some of them are only peripherally about writing. The other aspect of the Emacs Writing Studio is that it includes a downloadable configuration to get the n00b started using Emacs for writing.

In the reddit article about the Emacs Writing Studio, Alphapapa provides a link to his own collection of articles on using Emacs for writing that’s also worth taking a look at.

In his first article, Prevos notes that the right way to approach Emacs is to learn just enough to get started and then learn other details as they become necessary. As even moderately experienced Emacs users know, it’s a fool’s errand to try to learn everything about Emacs up front. Prevos suggests the same incremental approach that Irreal and others have recommended for Org mode.

If your principal activity is writing prose, you should take a look at Prevos’ site. It is, as I say, a nice resource.

UPDATE [2023-09-19 Tue 14:31]: Alphapappa → Alphapapa.

Posted in General | Tagged | Leave a comment

Mediating Remote Work Decisions With Gut Feelings

As most of you know to your sorrow, I have an obsession with certain non-computer subjects. The origins of COVID and remote work are two examples. Oddly, those two subjects have collided recently. With the end of COVID lockdowns, many companies are reconsidering their work-from-home policies.

A certain amount of the pressure to return to the office is driven by venal real estate concerns: both exposure to the real estate market and in some cases community requirements to have a certain number of employees present in the “downtown area”. That and that fact that hideously expensive office space is lying fallow provides a powerful financial motive for wanting employees back in the office.

Gleb Tsipursky has an article in Fortune that posits that a large part of the problem with the return to office movement is CEOs relying on the opinions of other CEOs and their gut feelings rather than data. He uses Amazon’s Andy Jassy as an example. When asked why he was insisting employees return to the office, Jassy’s answer was essentially that that’s what all the other CEOs were doing.

Some companies are making more nuanced decisions. For example, Salesforce looked at the data and discovered that new hires do better by being in the office and meeting their colleagues so they tailored their approach to take the data into consideration. They ended up with happier employees by fitting the policy to the individual.

As I’ve said before, work-from-home is here to stay and CEOs who wage a battle against it are risking their careers and the fate of their companies. As Tsipursky says, some positions require more on site presence than others and intelligent management will look to the data to discover what those positions are rather than instituting a one-size-fits-all policy.

Posted in General | Tagged | Leave a comment

Fixing The Emacs/Gnupg Problem

For some time there’s been a problem between Gnupg 2.4.1 and Emacs. Although you can decrypt files with Emacs—your .authinfo.gpg file for example—you couldn’t edit and save an encrypted file: Emacs hangs. This turns out to be a mismatch between the way Emacs and Gnupg expect to communicate the password and apparently it’s a hard problem to resolve. Until one or both apps are fixed you need a workaround.

The workaround is simple: downgrade to Gnupg 2.4.0. That’s not hard, of course, if you compile Gnupg yourself, but is harder if you use Brew to install it. There’s no easy way to do that with the standard Brew commands and the process that I’ve seen previously seemed a bit complex.

Álvaro Ramírez to the rescue. He has a post that gives us a simple procedure for doing the downgrade. Basically, you just download the Brew recipe and then install it using standard Brew commands. I’ve already done that and it took me less than a minute so there’s no reason not to follow his prescription if you’re having the problem.

Posted in Blogging | Tagged | Leave a comment

Emacs Bookmarks

Charles Choi has a new post that considers Emacs bookmarks. His idea is to make Emacs bookmarks as similar as possible to browser bookmarks. That makes sense and, I’m sure, works for lots of folks but I’ve gone in a completely different direction. My main objection to Choi’s method is that he uses a menu to access the bookmarks. Despite our detente1 on using proportional fonts for writing prose, we will probably never agree on the use of the mouse in Emacs. I consider every use of the mouse in Emacs a fail and go to significant effort to avoid it.

Choi is absolutely right that the default keybindings for dealing with bookmarks are obscure and hard to remember. I solved that with a hydra mostly stolen from abo-abo. You can read about it at the link but the TL;DR is that it gives me a fast and easy way to jump to a bookmark. That and the use of headlong-bookmark-jump makes opening a bookmark trivial.

That doesn’t address the other bookmark operations, of course, but I very rarely use them. When I do, I simply type Ctrl+x r (that much I can remember) and let the excellent whick-key tell me the correct suffix.

Finally, as suggested by Choi, I do use Bookmark+. I like it because it allows me to bookmark things other than files. For example, one of my bookmarks is to Irreal. When I invoke it, focus jumps to my browser and opens the Irreal site. It’s a real time saver and I use this all the time.

Take a look at Choi’s post. He’s got a lot of good ideas and you may find some you want to steal.

Footnotes:

1

Okay, my absolute surrender.

Posted in General | Tagged | Leave a comment

🥩 Red Meat Friday: Avoid Evil Mode

AltcoinShill has a silly but provocative post on why you should not use Evil mode. The TL;DR is that the default Emacs keybinding are essentially a pinky finger muscle building exercise and that the reason those keybindings were chosen was to help you exercise and build up your pinky. Therefore, using Evil mode short circuits this healthy regimen and should be avoided for health reasons.

It’s satire—if not flat out trolling—of course but there were plenty of commenters who took the post seriously and labored to point out the flaws in AltcoinShill’s argument. You’d think reddit readers would be a little more perspicacious but “kids today”.

There may or may not be reasons to avoid Evil mode but exercising your pinky probably isn’t one of them. In any event, it’s a funny and entertaining post: just perfect for ending your week.

Posted in General | Tagged , | Leave a comment

Proportional Fonts For Writing Prose

Around a month ago, I wrote about Charles Choi’s post on Tuning Emacs to Write Prose in Org and Markdown. One of his suggestions was to use proportional fonts when you’re writing prose. He claimed it’s easier to read and less distracting while you’re writing.

I wasn’t exactly dismissive of this suggestion but it’s fair to say that I was skeptical. After all, I’ve written two books and close to 5,000 Irreal posts all in a monospaced font using one markup language or another. Nevertheless, I decided to try it out for a while starting with that original post commenting of Choi’s.

I found that I actually did like it for writing prose but I didn’t want all my Org buffers rendered with a proportional font. I already had a bit of Elisp to set up my blog post buffers so I just added some code to toggle on variable-pitch-mode. Then I thought that I should really do this with directory local variables so I put a .dir-locals.el file in my blog directory but I got maximum lisp evaluation depth exceeded errors.

This has happened to me before when I tried to use directory local variables with the eval keyword and after messing around with max-lisp-eval-depth without success, I finally gave up and returned to my Elisp hack.

In any event, I’ve now officially adopted proportional fonts as my standard for writing prose. It turns out Choi was right all along.

Posted in General | Tagged | Leave a comment

Emacs Bedrock

I’ve never been a fan of Emacs starter packages. That’s probably because when I started, there weren’t any: you simply rolled your own configuration using whatever resources you could find. Still, there’s something to be said for a minimal configuration that can get you up and running until you learn more about what’s possible and what Emacs offers.

Ashton Wiersdorf has a solution: Emacs Bedrock. The idea is to offer an absolutely minimal configuration that relies almost entirely on built-in packages. The only third-party package that the default configuration includes is which-key, a wonderful package that offers you help on completing a key sequence if you stop part of the way through. I use it all the time and wouldn’t want to live without it. It’s perfect for the n00b trying to learn the Emacs key sequences.

It’s easy for those of us with highly tuned configurations that include multiple third-party packages to forget that vanilla Emacs offers a powerful and very useful editor. I spent some time with an unadorned Emacs when I started and added packages only when my workflow demanded it.

Wiersdorf has that covered as well. There’s a second configuration file that offers some Emacs “enhancements”. These include such things as the irreplaceable Avy, and the world’s best Git porcelain, Magit. The Minions will, of course, be exercised that his default theme is dark mode but, again, these things are easily configured and explained. For example, the configuration points to modus-operandi for a corresponding light theme.

You can checkout the actual configuration here if you’re experienced but if you’re a n00b, simply follow his directions to install a trial installation and see what you think. If you like it, you can copy the trial configuration into ~/.emacs.d to make it permanent.

This is, I think, a good way to get started with Emacs.

Posted in General | Tagged | Leave a comment

Automatic Newlines

Just a quickie today. Emacs Elements has a YouTube short in which he offers an Emacs tip on adding newlines to the bottom of a buffer. The idea is that you can configure Emacs so that when you type Ctrl+n at the end of a buffer, it will create a new line without the need to go to the end of the last line and type Return. The video is less than 40 seconds so there will be no problem fitting it in.

This is the type of thing that would get me into trouble in no time at all so I won’t be enabling it but if this seems like something that make sense for your workflow, take a look at the video. It’s built in so there’s nothing to install. You can turn it on and if you don’t like it, turn it off again all in the same session.

Posted in General | Tagged | Leave a comment