Emacs and Siri Shortcuts

MacOS Shortcuts are a recent addition to Apple’s various operating systems that provides an easy way to automate various workflows. You can tap on the shortcut or even ask Siri to run it. It’s an interesting idea but I haven’t learned how to use it. That’s probably because I tend to think of Emacs as my first level OS and am accustomed to handling automation and workflow through it rather than at the macOS level. Still, macOS has a wealth of useful apps and it’s nice to have a way of automating their use.

Dan Petrov has an interesting post about a package he wrote that integrates Emacs and shortcuts. It allows you to run or edit your shortcuts from the comfort of Emacs. Clearly the program is serving a small niche: the intersection of (diehard) Emacs and macOS users but it does serve as another example of how you can bend Emacs to do whatever you need to support your workflow.

If you fall into that intersection of Emacs and Mac users, take a look at Petrov’s post. It may inspire you to learn more about shortcuts and what they can do for you. And did I mention you can interact with them without leaving the comfort of Emacs?

Posted in General | Tagged | 0 Comments

Five Hacks for Org Roam

David Wilson of the System Crafters Channel has a new video in his Build a Second Brain playlist. The serious is about Org-roam, and is, as I’ve said before, the best introduction to and guide for setting up Org-roam that I’ve seen. If you’re interested in integrating Org-roam into your workflow, you should definitely take a look at the play list. There’s just four videos in the series and the total play time is under 2 hours so it’s an easy investment to make.

The latest video is about 5 small hacks Wilson made to Org-roam to better fit his workflow. The video notes and all the code are available here. My understanding of Org-roam is that it’s an Emacs based implementation of Roam Research, which, in turn, is an implementation of the Zettelkasten method. The method was developed by Niklas Luhmann a German sociologist who used it to write over 500 papers and 70 books. The basic idea was to write a single thought, piece of knowledge, or idea on a slip of paper and link it to related ideas with a complicated indexing scheme. You can read all about the method in this book about it.

The idea of Zettelkasten described in the previous paragraph has been pushed by Wilson and others to be a way of keeping track of all their notes including things like TODOs, daily diaries, and other information not usually associated with the Zettelkasten method. All but the first of Wilson’s five hacks are ways to make this extended use of Org-roam easier and more transparent.

It’s a nice video with five really good ideas. If you’re interested in Org-roam, it’s definitely worth your time. The video is 29 minutes, 44 seconds long so you’ll need to set some time aside.

Posted in General | Tagged , | 0 Comments

Deleting Garbage Files

John D. Cook who, among other things, publishes the TeX Tips Twitter feed, is an Emacs user and has a useful tip for cleaning up “garbage files”. Garbage files are intermediate files that can easily be regenerated. Examples are the .log and .aux files generated by TeX and LaTeX.

The secret is to type % & in Dired. It will mark the garbage files for deletion that can subsequently be deleted by typing x. This being Emacs, what constitutes a “garbage file” is, of course, configurable. The % & invokes dired-flag-garbage-files which flags files that match the regular expression in dired-garbage-files-regexp.

I vaguely remember this and I think I even wrote about it some time in the past. The problem is that if you don’t use it a lot, it’s hard to rediscover. It is, in fact, on the Dired Reference Card but the explanation is “flag various intermediate files”, which is technically correct but doesn’t suggest what it’s really used for.

In any event, it’s good to be reminded of it especially if you use LaTeX or some other application that generates intermediate files that you don’t want to save. It’s also another reason to learn and use Dired if you aren’t already.

Posted in General | Tagged | 1 Comment

Real Crosswords

I like crossword puzzles and when I’m on a roll will do 3 to 5 a day. But being an American, I’m a crossword sissy. American crossword clues are mostly a synonym or direct pointer to the target word. About as clever as it ever gets is a clue like “leaves home”1.

The British, however, despite their egregious over spacing of the em-dash, are not crossword sissies. Their crossword clues do everything they can to be obscure. They make “leaves home” feel like a gimme. I was vaguely aware of the difference between American and British crosswords but had no idea about how large that difference is until someone posted a link to this 2019 reprint of a 1968 New York Magazine article on how to do a real crossword. They really are a different species.

The article gives examples of typical clues and their answers. As it turns out, the clues, themselves, have clues that tell the solver what type of clue it is. Some are anagrams: “Stares at torn pages” is an example. The torn is a (sub) clue that the answer is an anagram of “pages” meaning “stares at” so the answer is “gapes”.

According to the article, there are seven types of clues:

  1. Anagrams
  2. Multiple meanings
  3. Reversals
  4. Charades
  5. Container and contents
  6. Puns
  7. Hidden

An explanation of the various clue types is too involved for a short blog post but if you have an interest in crosswords or are just curious, take a look at the article. In the meantime, I’ll think I’ll stick to American crosswords. At least they give you a fighting chance.

Footnotes:

1

Tree

Posted in General | Tagged | 0 Comments

Booster Shots and Other Reasons for Not Doing Any Work

Last Friday I got my COVID-19 booster shot. Here in Tampa, at least, that was easy. You can get them anywhere with an even tenuous link to the healthcare industry. As happened with my second shot, I woke up the next day completely wiped out and feeling vaguely feverish, although I didn’t actually have a fever.

I managed to summon enough energy to publish my prewritten Saturday post but then went back to sleep for most of the day. I feel better today although still a bit weak perhaps because I didn’t eat anything on Saturday.

In any event, I didn’t write anything for today and I just didn’t feel motivated enough to research a new subject so you’re getting this instead. I’m going to try to get something written for tomorrow so things should be back to normal on Monday.

Posted in Blogging | Tagged , | 2 Comments

Native Compilation in Emacs

Andrea Corallo gave an interesting talk at EmacsConf 2021 on his Emacs Lisp native compilation project. For those who don’t know, the native compilation project provides a compiler that converts Emacs Lisp into native code for the host machine. The idea is to enable the elimination of much of the Emacs C code in favor of Elisp. Native compilation will be officially released with Emacs 28, which is currently at the Pretest 1 phase. That means that native compilation will soon be available and supported for anyone who wants it.

Corallo’s implementation is a tour de force. His idea was to convert the Elisp byte code into IR for the GCC. He started off with a straightforward translation from the byte code to IR but the Elisp virtual machine is stack based whereas modern CPUs are register based. That means that the naive approach didn’t realize the performance increase you’d expect.

The current implementation has several passes to translate and optimize Elisp byte code into GCC IR code that GCC can also optimize and use to generate efficient machine code. Corallo’s talk takes us through the compilation process and explains the problems he encountered.

I found that it was easier to view the video on Toobnix because I could make it full screen. The video itself is 39 minutes 8 seconds long so you will need to set some time aside. If you have any interest in this technology, the video is definitely worth your time. Even if you don’t care about the technical details, native compilation is going to be a boon to your Emacs experience simply because things will be faster.

Posted in General | Tagged | 1 Comment

Red Meat Friday: Cursive’s Last Stand

It’s been a while since I’ve ventured into the emotional minefield that is cursive handwriting. Here’s a couple of tweets from Paul Graham that make two very good points:

The first is a meta remark about handwriting in general. As Graham says, there are very few places where it’s absolutely required. One of those is taking exams and if your (cursive) handwriting, like mine, is execrable, you can even lose points for illegibility.

The second is that things would be better if we got rid of cursive. Graham’s characterization of it as “the weird copperplate script they call ‘cursive’” makes a point that is often missed: cursive really is an atavistic throwback to an earlier time that has no more relevance today than, say, the Gutenberg Press. It’s interesting and important in an historical sense but simply has no place in our day-to-day lives.

Its uselessness in modern life is made clear when you consider the arguments advanced for the continued teaching of it. Its advocates say things like, “If we don’t teach cursive, students won’t be able to read the Declaration of Independence or The Constitution in the original.” That no one insists we should be teaching ancient Greek so that students can read the Iliad or the Odyssey “in the original” shows how silly that argument is. The other arguments for cursive are likewise special pleading.

It’s well past time that we laid this anachronism to rest. Even if you force students to learn it, they, like Graham and I, will abandon it as soon as they can. It’s really just a waste of class time that many students find painful and almost all find pointless.

Posted in General | Tagged , | 0 Comments

Cloning Buffers

Mickey Petersen tweets about cloning buffers and makes explicit a distinction that I must admit I wasn’t clear on.

I’m pretty familiar with indirect buffers, which are a clever way of looking at a buffer with two different views: you can have different narrowings, point positions, modes, and other properties while still maintaining identical text. Text changes made to the indirect buffer or the base buffer are instantly reflected in the other. It’s almost always what you want but sometimes it’s convenient to simply make an independent copy of a buffer.

Mickey’s tweet shows you how to do either. Oddly, I couldn’t find clone-buffer in the manual but its documentation available with describe-function (Ctrl+h f) and has been around for a long time.

As I said, you almost always want clone-indirect-buffer or its siblings. I’ve used it a few times but I’ve never used clone-buffer. Still, it’s nice to know they’re both available. As usual, Emacs has us covered.

Posted in General | Tagged | 0 Comments

An Emacs.app Bundle for macOS

A few days ago, I wrote about a script to build Emacs on the Mac M1. It was perfect for Mac users who want to build their own Emacs exactly the way they want. Not everyone wants to do that, of course. At the other end of the spectrum is the user who just wants to install Emacs with as little fuss as possible.

For those users, Jim Myhrberg has the perfect solution: An Emacs.app bundle for Emacs 28.0.90 (the first Emacs 28 pretest) that a Mac user can download and install with a minimum of effort.

The bundle includes everything needed to install Emacs with native compilation including the necessary libgccjit library. The installation does support the M1 machines but uses Rosetta2 for that so if you have an M1 you’ll probably want to find another solution such as one of the Homebrew distributions.

Myhrberg is an Apple developer and has a developer’s account so he is able to sign the distribution which means that it just works once installed—no telling the OS that, yes, you really do want to use it. If you’re looking for any easy way to install and try the Emacs pretest, it’s hard to imagine an easier way than Myhrberg’s bundle.

Posted in General | Tagged | 1 Comment

The Lab Leak

As you all know, I’ve been obsessed with the origins of COVID-19 and what is clearly the cover-up arising from it. To me, there are two main components to the story. The first is the malfeasance of the press, which swallowed whole the nonsense served up by the Chinese, the Government, WHO, and people like Peter Daszak and relegated the idea that maybe we should investigate the possibility of a lab leak to the domain of the tinfoil hat brigade making it impossible to even be discussed. Most infuriating of all, the press spent a whole year patting themselves on the back for “fighting disinformation” while they were the principal purveyors of it.

Tablet has an excellent article on the press’ disastrous coverage of the controversy. At every turn they chose to support those saying the cause was zoonotic dismissing any other explanation and ignoring the vested interests of those they were quoting. They’re still doing it today and show no signs of admitting that maybe they were wrong. Tablet makes out a pretty good case that their coverage was politically driven and it wasn’t until the change of administrations that it became permissible to even speculate on an alternative explanation.

The second issue is more serious. Everybody now admits—although the government and Fauci denied it for a long time—that the NIH was funding gain-of-function research. As Tablet points out in another article, the term is a euphemism for something that could better be described as “Viral-deadliness enhancement”. Sensible people—including many virologists—are asking why anyone would do such a thing let alone fund it. The usual answer is that will help us fight future pandemics but as the second Tablet article makes clear that hasn’t happened and is unlikely to happen because virus mutations are unpredictable and are unlikely to match what the researchers are ginning up in the lab.

The main takeaway from all this for me is that we need a strong moratorium on gain-of-function research. The last year and a half should have taught us at least that.

Posted in General | Tagged | 0 Comments