Emacs Startup Time

FreeAd7233 has an interesting reddit post on Emacs startup time. He’s recently moved from Doom Emacs to his own configuration and is amazed at how quickly Emacs loads. It’s less than a third of a second on his local (Apple M1) machine and less than three quarters of a second on a VPS. That’s fast enough for all but the most anal but as I’ve said before, for me, at least, it doesn’t matter.

I was a long time Vim user and followed the usual procedure of invoking the editor whenever I wanted to work on a file. When I moved to Emacs many years ago, one of the hardest things for me was adapting to a new way of working: rather than start Emacs when I needed it, I simply left it running and switched focus to it when I needed it. Later, as Emacs became more central to my workflow, this wasn’t even an option. Of course I left it running because I was almost always in it.

So the point of this post—if there is one—is why should I care how long Emacs takes to start? I do it only once when I start my system or possibly when I upgrade my packages. You can even make this part of the boot process if you like but I’ve never felt the need.

Still, not everyone has my workflow. FreeAd7233, for instance, treats the idea of leaving Emacs running as a sort of strange idea practiced only by aliens. Even those folks who want to start Emacs on demand have a way of accomplishing that. Of course they do. It’s Emacs. You can simply start Emacs in demon mode and invoke emacsclient to popup a “new” instance when needed. Of course, it’s not really “new” because it still has your previous state remembered so it’s even better than a fresh start.

The takeaway is that there’s really no reason to obsess about Emacs startup time but, of course, folks still will. It’s just that it’s not a reason to avoid Emacs.

Posted in General | Tagged | Leave a comment

The Mark Ring

Vernon Grant over at Discovering Emacs has an interesting video on using the mark ring. Most Irreal readers already know about the mark ring but its exact operation is a little mysterious. That’s especially true about the global mark ring. When, exactly, are locations put on the mark rings?

Grant discusses these and other issues involving the mark ring. He gives his understanding of when entries are added to the global mark ring—a definitely mysterious set of rules—and some of the most usual events that cause them to be added to the mark ring.

Most of us know that you can visit the locations on the mark ring with Ctrl+u Ctrl+Space and the global mark ring with Ctrl+x Ctrl+Space. What I didn’t know is that by setting set-mark-command-repeat-pop to non nil you can type the first Ctrl+u Ctrl+Space or Ctrl+x Ctrl+Space for the first entry and then simply hold down the Ctrl key and press Space to cycles through the other entries.

The video is only 7 minutes, 14 seconds long so it’s easy to find time for it. Unless you’re already a mark ring expert, it’s definitely worth your time.

Posted in General | Tagged | Leave a comment

Red Meat Friday: Props For Elon

Say what you want about Elon Musk but Irreal holds him in special regard because of a whimsical decision he made for SpaceX. Most observant folks know that Irreal is an admirer of Iain M. Banks’ Culture novels. Indeed, the name “Irreal” is from an idea in one of those novels as the banner at the top of every post hints. Those stories are about an advanced interstellar civilization in which “human beings” and sentient AI have equal status. There are several levels of AI intelligence, ranging from the barely sentient robots that performed routine chores to the super-intelligent “Minds” that ran the day-to-day operations of the Culture.

The Minds lived in—or perhaps had as their bodies—giant interstellar ships. The Minds, like Musk, had a whimsical sense of humor and gave their ships/bodies/selves quirky names such as So Much for Subtlety and Unfortunate Conflict Of Evidence.

One of SpaceX’s innovations is the ability to recapture and reuse their launch vehicles. The recapturing of those vehicles is accomplished by landing them on drone ships. Here’s a video of a recent recovery:

As you’ll notice, the drone ship is named Of Course I Still Love You. That name, like those of the other drone ships, was taken from the Culture novels. Take a look at the Wikipedia article on the drone ships for the other names. Musk has never made a big deal about this; he just named the ships and let those who knew where the names came from appreciate the humor.

For this alone, Musk deserves props from the tech community.

Posted in General | Tagged | Leave a comment

Leaving Deft for Vanilla Emacs

The title almost doesn’t make sense. After all, if you’re using Deft, you’re ipso facto using Emacs. James Dyer explains it in a way that makes sense. The TL;DR is that although he has been using Deft, he’s decided to use Org mode instead. He lists several reasons for this, which you can see in his post. The thrust of his post is that there’s nothing wrong with Deft but Org mode and the other built-in Emacs capabilities are a better fit for his workflow.

The reason I’m writing about this is Dyer’s last sentence:

“I think this is an example of over time learning that emacs has a lot of what you want already built in and with org mode it gently nudges you to organise files in a more coherent manner leading to a more simple agnostic digital way of life.”

That is, I think, a great point. Emacs has a multitude of packages that provide a huge amount of useful functionality but many times, everything you need is already there.The great thing is, when you need more, there’s almost certainly a package to give it to you. As always, Emacs has your back.

UPDATE [2023-02-26 Sun]: Added link to Dyer’s post.

Posted in General | Tagged , | Leave a comment

Webdriver

One of the most useful capabilities I have on my computer is the ability to capture the URL of the current page in my browser. That doesn’t sound too exciting but I use it many times a day when I’m writing blogs posts or annotating code, or doing anything else where I want to reference a Web page.

This is particularly easy on macOS as I’ve previously recounted. Since then, I’ve tried to find ways of doing this in other OS environments. None of them are as easy as macOS but I’ve recently come across something that may solve the problem once and for all. That something is emacs-webdriver.

It’s a way of controlling your browser from Emacs which is what Applescript allows you to do on macOS. If you’re an Emacs user and often want to incorporate a URL from your browser this is a real boon. You can, of course, switch context to the browser, capture the current URL in the title bar, and switch back to Emacs but it’s a lot easier to simply invoke an Emacs command with a key shortcut.

Webdriver is a general API that’s not restricted to Emacs and can do much more than simply capture the current URL or title of the current Web page. Even if you don’t need all its capabilities, just being able to grab a URL from your browser is a useful capability. Again, I use this capability everyday in macOS and it’s something you may want to enable it on your own systems.

Posted in General | Tagged | Leave a comment

EKG

No, not electrocardiogram, Emacs Knowledge Graph. It’s a small project by Andrew Hyatt that is best thought of as light weight Zettelkasten sort of like the popular Emacs applications Org-roam and Denote.

Take a look at the GitHub README for an explanation of the project. There’s also a shorter description of the application on reddit but the best explanation is this video on ekg that demonstrates the app and discusses the design. The video is just short of 46 minutes so you’ll need to schedule some time.

One way of thinking about the project is that it’s Hyatt’s attempt to overcome the limitations imposed by Org’s “everything is text” principal. A practical consequence of this is that explicit forward and back links get replaced by tags. This makes linking notes essentially automatic: if two links share a tag, then they’re linked and discoverable from each other. To make this idea more useful, tags can be multiple words. Everything, even the note text, is stored in an sqlite database so searching is fast and effortless.

The project is still fairly new—although it is in Melpa—and Hyatt is still struggling with some of the concepts but he’s been using it at work for several months and hasn’t found any problems. All of this is explained in the video and if you have any interest at all in the package, you should spend the time to watch it.

This looks like an interesting project and it’s one I can see myself adopting. It seems like an excellent way to keep a set of notes: it’s easy to add notes and to find them later.

Posted in General | Tagged | Leave a comment

Using Lisp

Anurag Mendhekar has an interesting post about why he uses Lisp and thinks you should too. He uses several different Lisps—Scheme, Common Lisp, and Racket—but boils down their essence to, “An s-expression based, dynamically typed, mostly functional, call-by-value λ-calculus-based language.”

Most of his post is an explication of each of those characteristics, including their advantages and disadvantages. Mendhekar takes a pragmatic view on each of them. While he believes they are generally the right thing, he understands that sometimes you want to violate them. He illustrates this most clearly, I think, in his discussion of statically typed versus dynamically typed languages.

Mendhekar is an advocate of dynamically typed languages and contra conventional wisdom makes a good case for them. That basically boils down to static typing seldom really helping make better programs but always getting in the way by enforcing rules that are so general that they often don’t make sense. The power of Lisp is that although it’s generally dynamically typed, you can make it statically typed when you need to. Take a look at Mendhekar’s post for a more nuanced explanation.

He also discusses how s-expressions eliminate many of the syntax related annoyances of “conventional” languages. There is no associativity or precedence rules to worry about. Everything is either a list or an atom: that’s all there is.

As many of you know, I spent most of my career hacking C but once I discovered Lisp, I didn’t want to program in anything else. If you’d like to explore Lisp, I think Scheme is the best place to start. Some folks recommend Clojure but Mendhekar avoids it for reasons he explains in his post. In any event, take a look at Mendhekar’s post for a good discussion of why you should be using Lisp.

Posted in General | Tagged | Leave a comment

Covid Origin Phase Two Study Cancelled

WHO has announced that the planned second phase of their study to determine the origin of COVID-19 has been canceled. Exactly no one is surprised by this. The reason given for the cancellation is China’s refusal to provide access to their researchers and records although there are certainly factions in the U.S. with no appetite for exploring the question.

As I’ve said many times before, when I have my scientist’s hat on it’s currently impossible to come to a definitive answer regarding the genesis of COVID-19. If, on the other hand, I put my informed man-on-the-street hat, there’s a lot of cogent evidence pointing to a lab leak from the Wuhan Institute of Virology resulting from the gain of function research that was reportedly being performed there.

The cancellation of the phase 2 study is a further datum providing yet another reason for suspicion. A reasonable person could ask, “What are you afraid of having revealed?” As Paul Graham pointed out, the cancellation itself tells us a lot about the origin of COVID-19:

Again, none of this is definitive but it’s getting harder and harder for a thoughtful person to escape the conclusion that COVID-19 did indeed result from an accident in a laboratory performing gain-of-function research.

Posted in General | Tagged | Leave a comment

The History of Emacs

Over at Linux User Space, Leo and Dan have a short video giving a reasonably comprehensive history of Emacs:

They start with TECO and the infamous tower of Babel that grew out of every developer having their own set of macros leading Guy Steele and Richard Stallman to develop a standard set of Editing MACroS that everyone could use. From there, they trace Emacs’ development from a set of TECO macros to the current day GNU Emacs. Along the way, they discuss Gosling Emacs and its relation to GNU Emacs as well as the Lucid version that eventually became XEmacs.

The video is 14 and a half minutes long so it shouldn’t be too hard to fit in. If you’re freaked out by the warning about leaking your IP address in the Twitter link, just follow the above link and watch it on YouTube.

Posted in General | Tagged | Leave a comment

Org Mode For Project Breakdown and Estimation

Over at In a stream of Random Thoughts .. there’s an interesting post on using Emacs and Org mode for breaking down and estimating projects. The idea is that each new project is given an Org file that breaks down tasks to be performed, progress made on those tasks, and estimates for completing them.

This Org file is populated with Yasnippet to ensure uniformity and placed in a file hierarchy that reflects the state of the project. There are directories for active projects, pending projects, paused projects, and completed projects.

The breakdown in each project file serves as a basis for making estimates. Nothing can make time estimates easy, of course, but having a project broken down into its constituent parts does make it less of a burden.

Take a look at the post to see if some of its ideas could be useful in your own workflow. My takeaway is the advantage of using Yasnippet to initialize each project file to ensure that nothing is missed. By having to “fill in the blanks” you help avoid missing any important details.

Posted in General | Tagged , | Leave a comment