Using Emacs 51

Mike Zamansky had a few minutes free in his busy fall schedule so he recorded and posted another video in his Using Emacs series. This time he discusses how he uses Org Mode in his day-to-day work.

If you’ve been around Org for any time at all, you’ve probably heard the advice to start small and just use one or two of the basic functions. Zamansky’s video underlines that advice but from the point of view of an expert. Although he can and does use Org Mode’s advanced features all the time for all sorts of tasks, most of his day-to-day use just involves the basics of TODO lists, notes, capture templates, and agendas.

The main lesson to take from this video is not necessarily Zamansky’s particular workflow but how much of his daily work gets done using just the basic Org functionality. That should be comforting to n00bs might despair that Org mode is just too complicated to use.

The video is 21 and a quarter minutes so plan accordingly.

Posted in General | Tagged , | Leave a comment

Ancient Emacs Code

In response to my two posts concerning Emacs history, Lars Brinkhoff wrote me with a pointer to a wonderful repository holding the code to not only early Emacs but also such goodies as ZWEI and Zmacs and all the way back to TECO Emacs from 1976.

If you’re an Emacser and the type of person who likes to read and learn from old code—there’s more of us than you think, grasshopper—you should definitely take a look at Brinkhoff’s repository. It’s a great way to waste while away hours with software archaeology.

Posted in General | Tagged | Leave a comment

EmacsCast #6

Rakhim Davletkaliyev is back with another Emacs podcast. This episode is mostly about trying to achieve software minimalism and how he leverages Emacs to do that.

Towards the beginning he has an interesting vignette on how Emacs and Org mode helped him solve a problem in publishing his cartoon site. As he points out, what seems natural and easy in Emacs would require a kludgy hack to accomplish otherwise. It’s another example of how Davletkaliyev’s assimilation into the Emacs Borg is almost complete. Although he said in the early podcasts that he was just “fooling around” with Emacs and didn’t intend to use it as his main editor, he finds that he is moving more and more of his workflow to it.

Most of this podcast discusses his desire to reduce the complexity of the software he uses and to avoid the gratuitous changes that characterize the majority of today’s software. Emacs, he says, is different in that its UI is basically the same as it’s always been. Sure, there are improvements and some changes have required tweaks to the UI but Emacs has avoided changing things for the sake of a “fresh” user experience. Were a user of an early version of Emacs transported through time to the current age, his Emacs workflows would still (mostly) work as usual.

As part of his search for software simplicity, he’s changed his mind about making lots of customizations to the keybindings in favor of using the defaults. That makes avoiding conflicts easier albeit at the expense of having to retrain his muscle memory.

It’s an interesting talk and worth spending the time to listen to. The podcast is just under 42 minutes so you’ll have to do some scheduling.

Posted in General | Tagged | Leave a comment

ZWEI

Edward Coffin has a post that’s a nice companion to yesterday’s Irreal post on the evolution of Elisp. After much effort he managed to track down a copy of Dan Weinreb’s undergraduate thesis on the ZWEI editor and has posted a summary of the thesis on the Emacs subreddit.

ZWEI was an interactive full-screen editor written for the Lisp Machine. Like EINE, from which it was derived, it was based on Emacs (EINE is a recursive acronym for EINE is not Emacs). Like Emacs, ZWEI was written in Lisp and had features, such as the point and cursor, that today’s Emacs user would find familiar.

If you’re interested in Emacs history and seeing where your editor of choice came from, it’s worth taking a look at Coffin’s post. It’s short and won’t take much time. Also interesting and worth your time are the comments by netsettler, who worked on editors for the Lisp Machine at Symbolics. He has a nice discussion of the comparative advantages of using a linked list of lines—as ZWEI did—versus the gap structure that modern Emacs uses.

Posted in General | Tagged | Leave a comment

The Story of Emacs Lisp

Stefan Monnier and Michael Sperber have posted a preprint of their paper Evolution of Emacs Lisp. It’s a really interesting account of the history of Elisp and how it has evolved over its lifetime.

The thing about Elisp development is that it mostly flies under the radar. The vast majority of the changes aren’t user1 visible—at least not directly—so it’s easy to think of it as “just there” and never changing. In fact, Elisp is, like Emacs itself, under constant development. The paper traces that development from Elisp’s roots in MacLisp to where it stands now.

One of the major constraints on Elisp is the (nearly) absolute imperative to not break existing code. The reason for that is that much of Emacs is implemented in third party packages over which the developers have no control. This makes the introduction of significant changes, like lexical scoping and threads, difficult. Still, the language has evolved and it’s surprising how much it’s changed even though the core has remained relatively stable.

If you’ve been around for, say, ten years or more it’s surprising how much functionality has been added to the language. Things that we couldn’t live without now simply weren’t there in Emacs 21. So even though the evolution has been slow and steady it has occurred. If you’re at all interested in Emacs’ history and the problems that the developers had to solve, take a look at Monnier’s and Sperber’s paper. It’s a 36 page PDF so plan on spending some time with it.

Footnotes:

1

That is, non-elisp programmer users.

Posted in General | Tagged , | Leave a comment

An Org Mode Workflow

Ayrat Badykov has an interesting post on his Org-mode workflow. In it he shows how he leverages Org mode to be more productive. What I find interesting—other than that I always find workflow articles interesting—is how far he gets using just a few basic Org features. He mostly uses just the list making and agenda functions of Org but still manages to organize his day. Doubtless, he’ll find, as many of us have, that his use of Org will grow organically (heh) and that he will start using more and more of its functionality.

If you’re a n00b, one of the important lessons to take away from Badykov’s post is to start small. Org has a lot of features, many of which are orthogonal to the others. You can make lists and schedule items with it. You can also write and publish papers with it. Or you can use it for literate programming or even to organize your Emacs configuration.

There’s too much there to learn all at once but you don’t need to. Learn a couple of its capabilities and integrate them into your workflow. You’ll find yourself thinking, “Gee, it would be nice if I could …,” check the manual and find that, in fact, Org can do that. Before long you’ll find yourself using a significant portion of Org’s functionality.

Posted in General | Tagged , | Leave a comment

A Road to Common Lisp

I had years of programming experience before I learned Common Lisp—or any Lisp, for that matter—and I’ve always regretted it. Lisp teaches you new ways of thinking about programming and every programmer should be familiar with it even if they never use it in a non-trivial way. Emacs users have an advantage here because it’s almost impossible to use Emacs without learning at least a little Lisp.

The problem is that it’s hard to get started. Lisp is the second oldest (non-assembler) programming language and some of the terms it uses have different meanings now. Steve Losh has performed a public service by publishing A Road to Common Lisp, a longish post on how to get started with Common Lisp. He doesn’t teach you the language or how to program in Lisp; he focuses on the steps you should take and the resources you should use to learn Lisp and to set up a reasonable Lisp programming environment.

His first piece of sage advice is not to worry about an editor. Use whatever editor you’re familiar and comfortable with. Later, when you get more experienced, he says you’re going to have to choose between Vim and Emacs because of their Slime or Slime-like plugins. He’s a Vim user himself so this is more than a roundabout piece of Emacs evangelism.

He goes on to suggest some useful books and explain some of the harder concepts like “packages,” “systems,” and “projects.” Finally, he discusses some of the popular libraries that perform tasks not built into the language itself. It’s a great post and should be very useful to n00bs. I wish I’d had it when I was learning Lisp.

Posted in General | Tagged , | Leave a comment

Mike Elgan on Google

I’ve been reading Mike Elgan since his article on the New Bedouins in 2007. He still writes about technology but is increasingly focusing on traveling to exotic places and sampling their food and wine. One of his latest posts on technology bemoans the shuttering of Google+.

Google has become, he says, the new Yahoo. By that he means that, like Yahoo, Google introduces new products with great fanfare and once its users become dependent on them, abandons the products. Google+ is just the latest example. Ironically, Elgan makes a compelling case for not trusting Google or depending on their apps but then reveals that he’s still depending on Google Photos and—worse yet—Google drive.

I don’t get it. You spend a whole article articulating why you shouldn’t use Google apps yet you continue to commit some of your most precious content to it. Several of the commenters are in the same boat.

These folks are going to get burned. That is what happens when you depend on Google for anything. Sooner or later they’re going to pull the rug out from under you. It’s impossible, as a practical matter, to get away from all their apps. If you want to watch a video, for example, the chances are overwhelming that it will be on YouTube. But there’s a difference between consuming someone else’s content on a Google app and committing your own data to it.

Of course, none of this addresses the—even worse in my opinion—Google practice of reading your documents and locking your account if they find something they don’t like. The engineers writing the AI to do this aren’t nearly as clever as they think they are so they get false positives. That means a completely innocent research paper on Google Docs, say, could get flagged as Bad Think™ and just like that you lose your work. Why would anyone subject themselves to this?

Elgan wonders where people should go in a post-Google+ world to express their views and share their content. It’s not that expensive to get a domain and rent a virtual server. Irreal costs less than $10 per month. Then you can have a blog and build a community around it. It’s completely portable and if the provider goes out of business (or doesn’t like you) you simply move to another provider and update your DNS. Users wouldn’t even have to be aware of the change.

Posted in General | Tagged , | Leave a comment

More Pro Tips from Ambrevar

I was looking for something to write about and found this (slightly old) post from Ambrevar (Pierre Neidhardt) on some useful Emacs tips. He begins with a couple of tips to speed up Emacs loading. I last restarted Emacs when I updated my OS to Mojave so this is not something I worry about but some people—especially Emacs developers—restart Emacs more often so having a fast startup time can be a win.

He follows with a couple of tips to control package loading. One tip makes sure that the latest code is loaded even if it’s not byte compiled. The other sets up a local Lisp site directory.

There are some tips on controlling modes and a bit of Elisp that uses youtube-dl to download the video URL at point. There are also some suggestions for improving your workflow such as using lispy instead of paredit and turning on parentheses matching and possibly rainbow delimiters.

There are a few more tips as well so be sure to take a look at Ambrevar’s post. And while you’re at it, take a look at his first post on Emacs tips. After all, who doesn’t like learning some tips that will improve your workflow?

Posted in General | Tagged | Leave a comment

Advanced Hashing Techniques

One of the first advanced programming techniques I learned back when I was beginning was the use of hashing for fast table lookup. The use of the adjective “advanced” probably looks strange to younger engineers who are used to languages like Perl, Python, and others that have dictionaries or hash tables built in but they weren’t as well known back then except, of course, that Lisp already had them. Regardless, I was fascinated with the technology and read everything I could find about them. During my career I’ve implemented hashing tens or even hundreds of times.

Attractivechaos over at Attractive Chaos has a very nice post on Advanced techniques to implement fast hash tables. He begins by noting that open hashing is very often faster than the chaining method. That’s a bit counterintuitive for me, perhaps because chaining seems more deterministic even though it really isn’t.

He then goes on to discuss some advanced techniques that can be used to speed up hashing. He concludes by noting that the choice of a hashing library is always a tradeoff and there is no “best choice.” He says there probably isn’t even a best choice for the fastest hashing method.

It’s a fairly short post and well worth reading for anyone who uses hashing in any way more significant that just using Perl or Python’s associative arrays.

Posted in Programming | Tagged | Leave a comment