How To Create A Missing Directory

If you’ve been around Emacs for a while, you probably know that Emacs has you covered if you call find-file (Ctrl+x Ctrl+f) and specify a path with a missing directory. You simply get asked if you want to create the missing directory and give your assent with a simple Return Return.

That’s pretty simple and convenient but Bozhidar Batsov is committed to eliminating as much friction as possible and doesn’t want to have to do anything to create those missing directories. He just wants it to happen. Of course, being Batsov, he made it happen. It turns out to be pretty easy and he gives two solutions for doing it.

Almost every time I get the missing directory error it’s because I mistyped the path. That means that automating the creation of missing directories would almost always be a fail for me. But that’s me. Others, like Batsov, view it as a win. If you fall on Batsov’s side of the question, take a look at his post to see how easy it is to do.

The final, obvious, oft repeated, but mandatory observation is how easy Emacs makes it to fine tune it to each individual user’s workflow.

Posted in General | Tagged | Leave a comment

Spaced Repetition

One of the things that I wish I’d known during my school years is the technique of spaced repetition. The TL;DR is that it’s a method for learning and remembering material that’s much more efficient and reliable than other common methods, especially cramming. The basic idea is that you revisit material based on ever increasing intervals determined by how well you remember it.

As Ali Abdaal says, there are rigorous studies that show the effectiveness of the method. Adaal has a whole series of videos that explore spaced repetition and other strategies for effective learning. Those videos are the easiest way I know to explore the method. He recommends using active recall in conjunction with spaced repetition for maximum benefit.

There are, of course, numerous applications—including Emacs packages—that implement the space repetition technique. If you’re still a student or otherwise need to learn a collection of facts, spaced repetition is almost certainly your best bet.

If you want a quick and easy introduction to spaced repetition, Nicky Case has a cartoon based explanaton of the method that’s easy and enjoyable to read. Case’s post is from 2018 but is still relevant today. Take a look at it and see how easy learning things can be.

Posted in General | Leave a comment

Apple Passkeys

At WWDC, Apple just announced Passkeys, their implementation of the FIDO protocols that aim to replace passwords. In Apple’s case, this capability will be available with iOS 16 and macOS Ventura, probably this fall. The other vendors are doubtless planning similar releases in a similar timeline.

Dan Moren from Six Colors has a post that gives a nice explanation of Passkeys and its operation by endusers. If you’re an Apple user with some or all of your passwords stored in the Apple iCloud Keychain, nothing much will change: you’ll authenticate with a fingerprint or face ID and a cryptographic exchange takes place between your device and the remote site to verify you. You can even use one device to log into another. Take a look at Moren’s post for the details.

The Passkeys mechanism will do a lot to improve security. If nothing else, there will be no more 123456 or password vulnerabilities floating around. Of course, the scammers will still be out and about trying to get your credentials but it’s going to be much harder for them. At present, there’s no way to share a key other than through AirDrop so it will be harder to scam victims into giving up their keys especially since that from the user’s point of view, the key is their biometric information. Doubtless the scammers will find ways to probe the system but it’s going to be more secure than passwords.

Posted in General | Leave a comment

Red Meat Friday: Who’s Next?

As most of you have probably heard by now, the Atom editor is being discontinued in December. That’s sad, of course, especially for Atom users but there are some lessons to be drawn.

Eric Fraga has the TL;DR:

It’s a good point. You devote considerable effort into mastering an editor and perhaps
writing extensions for it only to have it jerked out from under you. Fraga says that with Emacs he doesn’t have to worry about that. Bozhidar Batsov explains why that is in his Forever Emacs post. The short version is that Emacs is a community driven open source project1.

The demise of Atom shows that open source is not enough. After all, Atom was open source too but it wasn’t community driven. It was, rather, commercially driven by GitHub and GitHub, like every commercial entity, is mostly concerned with pursuing projects that they perceive will benefit them. Apparently, they no longer felt that Atom was a worthwhile investment in time and resources.

Now for the red meat. As the post title suggests, a natural question to ask is, “Which editor is next?” A reasonable candidate is VS Code. Like Atom, it’s an open source, commercially driven product. Furthermore, Microsoft has historically shown itself more than willing to dump any product that they felt was no longer meeting their needs.

If your PDF reader is discontinued it might be a little annoying but, really, who cares? There are plenty of them out there and they all work pretty much the same. If your editor goes away, it’s a much bigger deal. Most of us have put considerable effort into mastering our editor and making it an integral part of our workflow. If Microsoft does decided to sunset VS Code, what will all those users who flocked to it do?

Footnotes:

1

Yes, yes. Of course I know that Emacs is Free software. I’m merely making the point that the same principal applies to the larger universe of open software.

Posted in General | Tagged , | Leave a comment

Proced

Bhaskar Chowdhury has a nice video on using proced in Emacs. He covers many, but not all of the things you can do with it. As Chowdhury says, proced is best thought of as a top substitute built into Emacs. I don’t think it’s quite a full blown top substitute but it does have many of the same capabilities and does move us closer to never having to leave Emacs.

As most of you know, I do most of my work on my MacBook laptop and for a long time proced didn’t really work on a Mac. But at least since 2018 it’s been working fine on the Mac. After watching Chowdhury’s video, I fired up proced to see if I could find any shortcomings—I couldn’t. Everything that Chowdhury showed worked fine on my MacBook.

Proced is perfect for a quick check on things when you don’t want to have to context switch out of Emacs. It’s just another example of how Emacs provides a nearly complete operating environment. It is as I’ve often said a light weight Lisp Machine. Most of us will never have to opportunity to work on a Lisp Machine but Emacs does provide a hint of what it was like.

Proced gives you top-like information in an Emacs buffer. That’s nice because you can use all the usual Emacs searching and navigation commands in that buffer. You many not use proced all that often but it’s perfect when you need it.

Posted in General | Tagged | Leave a comment

Emacs Buffers

Mickey from Mastering Emacs has a post, Why Emacs has Buffers, that considers why Emacs makes the buffer concept one of its signal concepts. After all, he says, the natural construct when a programmer thinks of an editor is the string. The lines that you see on the screen are just strings and (text) files can be viewed as just a collection of strings.

Buffers, on the other hand, seem more abstract and unnatural. Mickey says they don’t evoke the same familiar associations as terms like “file” or “document” do. Of course, that’s a little overwrought. Any Emacs user, let alone programmer, who has a hard time with the concept of a buffer probably needs to find another occupation. Still, it’s worth considering why bringing the buffer concept to the forefront instead of burying
it in the internals as most editors do is the right thing and that’s what Mickey does.

One of the things the “modernize Emacs” nebbishes want to do is replace buffers with tabs. Not because tabs are better but just because they’re used to them. Of course, buffers are a much more general concept that includes things that are not files. You could, I suppose, make a tab for each buffer but that’s not want the nebbishes want: they want one tab per file just like they’re used to. I know I’m waving my cane at the kids on my lawn but—really—if you aren’t willing to put in a little effort to learn the Emacs way, please go away. If you are willing to put in that effort, welcome. There are plenty of people here willing to help you learn.

As always, any post from Mickey is worth spending a few minutes reading. Spend a few minutes to check it out.

Posted in General | Tagged | Leave a comment

The iOS Builtin Flight App

This post is a bit specialized—to iOS—by Irreal standards but it’s so useful to those who have an iPhone that I’m going to write about it anyway. I’m not sure if this is new or has been in iOS for a while but it turns our that the iPhone has a builtin flight tracker.

Everything I know about it is in the above post so you should definitely take a look at that but the TL;DR is that you can enter a flight number into the Safari or Spotlight search bar and get all the information about the flight that a dedicated App will typically provide. It also works if you click on a flight number in a text.

This is really nice. Like most of you, I haven’t done much traveling in the past two years but it’s nice to know I can track any flight I’m on or that a family member or friend is on. It’s perfect for knowing when to leave for the airport.

It’s actually easier to use than my dedicated app, which requires me to add a bunch of information before it will tell me about a flight. All I have to do here is enter the flight number. Take a look at the post for the details.

This isn’t about iPhone triumphalism—I’m sure Android has something similar—but rather a celebration of how much easier our digital age makes our lives. Just consider this app. You don’t have to download or buy anything or plan ahead. All you have to do is enter a flight number and you get all the information. Splendid!

Added before publication

Here’s a tweet that makes the same point:

Posted in General | Tagged , | Leave a comment

Org 9.5.4

Yesterday I saw this tweet:

I checked the Emacs-Orgmode mailing list but there was no mention of a new release. Fortunately, Sunday is my day to upgrade my Emacs packages and when I did I noticed that there was indeed an Org-mode update.

As you can see, the tweet says that 9.5.4 is a bug fix release so upgrading is not critical unless you’re having problems. Still, If, like me, you basically live in Org-mode, you’ll probably want to get the latest update to make sure everything is working correctly.

As always, thanks to everyone who fixed those bugs and contributed to make Org-mode one of the jewels of Emacs.

UPDATE [2022-06-06 Mon 14:49]:

The above tweet doesn’t mention Org 9.5.4 being a bug release; that was another tweet that I didn’t include.

Posted in General | Tagged , | Leave a comment

Determining If Emacs Is Running In Terminal Or Gui Mode

Even if, like me, you mostly run Emacs in GUI mode, it’s sometimes desirable to invoke a terminal instance. Mostly it doesn’t matter which mode you’re in but there are a few things—font colors, for example—that you may want to set depending on which mode you’re in.

That means you need a way of determining the mode you’re running in. As Bozhidar Batsov tells us, that’s not hard: simply test the variable display-graphic-p. The problem comes when you have both modes running in a single instance of Emacs. In that case, one of the color schemes, say, is going to be wrong.

Batsov has a solution. The answer is to make the mode test in a after-make-frame-functions hook function. That way you can make frame specific settings for the appropriate mode. Here’s the example Batsov gives for setting the font text:

(add-hook 'after-make-frame-functions
  (lambda ()
    ;; we want some font only in GUI Emacs
    (when (display-graphics-p)
      (set-frame-font "DejaVu Sans Mono 28")))

As you see in this example, the code runs in the proper frame environment and the resulting customization is set for this frame only. That allows fine grained configurations even when an Emacs instance has both types of frames. Problem solved.

Posted in General | Tagged | Leave a comment

Commercial Emacs

In a followup to his recent post on Modern Emacs, Bozhidar Batsov has a short offering that talks a little about Commercial Emacs. It’s a fork of GNU Emacs but it’s not the first one. There have been several others, most famously XEmacs, which was a reaction to the slowness in getting changes accepted into GNU Emacs. This latest fork was, as far as I can tell, made for the same reason.

The list of things the Commercial Emacs developers say they’ve fixed includes several long standing problems such as (finally) doing something about the long lines problem and integrating tree-sitter to replace the slow and brittle regex-based font locking code. There are other changes, as well. You can see the whole list in either Batsov’s post or the README at the Commercial Emacs GitHub site.

I’m a little surprised by the fork because as far as I can tell, Emacs development is relatively speedy and there have been regular releases so the situation is different from what it was when XEmacs was forked off. On the other hand, there are a lot of FSF politics to negotiate when you want to make a change. Sometimes changes are rejected for political—as opposed to engineering—reasons.

Whatever the reasons, I’m sure that both distributions will benefit from new the blood and ideas.

Posted in General | Tagged | Leave a comment