The Success of Markdown

Anil Dash has a long post on How Markdown Took Over The World. We Org mode users may have a few problems with that depiction but it is fair to say that Markdown usage has become ubiquitous. We see it everywhere, even in the most unexpected places.

The most interesting part of Dash’s post, to me, is his history of Markdown. In the tradition of open source software, it began as an itch on the part of a user. John Gruber wanted an easier way of writing his blog Daring Fireball. The original markdown was a perl script that translated some simple markup text into HTML.

In retrospect, I’d say that the real genius of Markdown is that it’s plain text. That means you don’t need a bespoke application to use it. You can use your preferred method of entering text to write your Markdown source. It’s other winning aspect is that nobody “owns” it. Anybody can use it or incorporate into their application without fuss or fee.

We Org mode aficionados prefer Org markup, of course. I’m inclined to think that the syntax of Org mode versus Markdown isn’t that much of an issue but others strongly disagree. For me, the advantage of Org mode is it’s power—to which some dialects of Markdown are slowly catching up—and it’s close integration with Emacs, which is where I do all my writing.

The other big advantage of Org mode is that there is only one. Sadly, Markdown has several incompatible dialects so it’s hard to know which version to master or use. On the other hand, Markdown is not tied to any particular application so you can use it anywhere. It is technically true that you can write Org mode in any editor and translate it to almost any target with Pandoc but as a practical matter if you want to use Org mode, you need to use Emacs.

This post is an ecumenical moment where we celebrate the huge advantages of Markdown and Org mode over their mostly proprietary competitors. We may argue over which is best but we agree that they’re better than their alternatives.

Posted in General | Tagged , , | Leave a comment

Regulating Your Writing Workflow With Emacs

A few days ago, Chris Maiorana wrote an article, The 10-Commit Rule: how git version control can improve writing quality, about how he uses Git and Emacs to regulate his writing workflow. The idea is to track how many changes he’s made to his text since the last commit and to stop and review his work when he reaches about 250 changes, deletions, or additions. The advantage of this system, he says, is that it keeps you from burning out in an initial burst of enthusiasm by forcing you to stop periodically and see where you are.

To help him with this, he has a mode line display that shows him how many changes he’s made since the last commit and how many commits he’s made today. It seems like a system that could be useful to many writers. The problem is, he didn’t explain how he got the numbers for his mode line display.

Now, however, he has a new post that explains how he generates that display. The TL;DR is that he interrogates Git to get both numbers. The number of commits is pretty easy, of course, but getting the number of changes is a bit trickier. Basically, he runs a script that does a git-diff and pipes the results through grep and wc to extract and count the “words” that have changed. To keep from running the script continuously, he caches the results and updates them only every 30 seconds.

I’m not sure I’d like using his exact system but I must admit that I do pretty much the same thing without the software assist. Every so often, I stop, reread and edit what I’ve written, and, if I remember, commit what I have so far. As any writer will tell you, there are as many writing methods as there are writers so whether Maiorana’s method works for you will be a matter of your preferences.

Posted in General | Tagged | Leave a comment

Bending Emacs 10: Agent Shell

Álvaro Ramírez has a new Bending Emacs video up. This time it’s about his agent-shell app that serves as uniform Emacs interface to LLM agents supporting the Agent Client Protocol (ACP).

I’m not interested in LLM technology so you almost never see an Irreal post about it. I don’t know—and therefore have no opinion on—if it’s something real or just another venture capitalist fever dream. Still, if you are interested in LLMs, it’s nice to have an app like agent-shell that provides a uniform interface to most (all?) of them.

There’s a huge number of options and details to negotiate so an app like agent-shell is a real boon. Almost none of those options involve picking which shell you want to use. You simply choose one from a list of supported shells and work within that shell for the rest of your session.

There are way too many details for me to cover here. The video itself is 36 minutes, 34 seconds so there’s a lot of content to cover. If you are interested in LLMs, and especially if you use more than one, you should definitely watch this video and download agent-shell. It’s available on Melpa so installation is easy. Like all of Ramírez’s work, agent-shell seems like a well engineered app and it’s free so you have nothing to lose by trying it.

Posted in General | Tagged | Leave a comment

Multiple Editing Instances Of A Single File

Emacs has a couple of builtin ways of dealing with separate windows that are looking at the same file. The default method is to simply “open” the file again in a separate window. In this case you have two views into the same file. The windows may be looking at different parts of the file but any change made in one window appears in the other as well because both windows are using the same buffer.

Alternatively, you can open the second window by cloning the first buffer. That creates a second buffer with the same text and properties but they are distinct buffers that can have different point values, different narrowing, different major modes, different markers, different overlays, and different local variables. Nevertheless, any text or text property change made in one buffer is reflected in the other. Take a look at the Emacs manual for the details.

You’d think that those two options would cover whatever you needed to do but Sacha Chua has a post that describes a case not covered by either. In this case the user wants to display an SVG file in one window and the XML that generates it in another. The problem here is that the image is displayed with text properties so toggling the display in one window will cause it to affect the other window as well even if the other window is a cloned buffer.

Chua shows how to solve this by writing a bit of Elisp. The TL;DR is that she bypassed the code that checks if the target file is already opened in another buffer and simply creates a new buffer unconditionally. Of course, now you have to worry about syncing the text between the two buffers. Chua solves this by turning on global-auto-revert-mode so that when one file is saved, the other gets updated.

I’m always prattling about how having the Emacs source available from within the executable image coupled with the ability to make on the fly changes is one of Emacs’ magic powers. Chua’s solution is a nice example of this.

Posted in General | Tagged | Leave a comment

Making Agenda Items Into Appointments

Every Org mode user knows that you can add tasks to your Org agenda with a SCHEDULED or DEADLINE keyword. That will cause your agenda to warn you ahead of time of upcoming tasks requiring your attention. Emacs also has an appointment system—tied to the diary—that will give you an active warning just before you need to act.

It would be nice if you could have those agenda tasks somehow be promoted to appointments so that you’d get a timely warning when the task is due to be acted on. It’s Emacs so of course you can. The idea is pretty old. Here’s Sacha Chua writing about it before it became part of Emacs in 2007. The answer is to use org-agenda-to-appt. It will scan your agenda files and set appointments for each entry that has a SCHEDULED or DEADLINE keyword.

The problem is automating this. You don’t want to have to call org-agenda-to-appt every time you add a task with an action date. Over at Dave’s Blog, Dave has a solution. It amounts to running org-agenda-to-appt every hour to pick up new potential appointments. See Dave’s post for the details.

What you’d really like is to be able to advise the agenda functions to add the appointment when you add a new agenda item. That’s non-trivial but probably doable. In the mean time, Dave’s solution is a reasonable approach if you’d like to try automatically promoting your agenda items to appointments.

Posted in General | Tagged , | Leave a comment

Unix V4 Source Commentary

I’ve written a couple of times about the recent discovery of the only known Unix v4 tape. The v4 release, which was generally considered lost, is important because it is the first Unix that was written in C and therefore portable.

There are no v4 releases in operation today except, perhaps, for the few instances brought up on a PDP-11 emulator by hobbyists so you might think it doesn’t matter at all to the modern engineer but that would be wrong. Every software engineer should have a basic understanding of operating systems but modern systems are so large and complicated that not even the people who work on them understand the entire thing.

The early Unix systems, on the other hand, were developed mostly by two people who certainly did understand the whole thing as did their colleagues. The advantage of those early systems is that they are complete, working, operational systems but small enough to be understood by anyone who wants to make the effort to learn them.

If you want to learn the basics of operating systems, Unix v4 is an excellent place to start. To make things even easier, Briam Rodriguez has produced a line-by-line commentary on the v4 kernel that is reminiscent of John Lions famous v6 commentary. The repository has the source so that you can build your own version but there’s also a PDF version that you can download and read.

I’ve read Lion’s commentary and have skimmed through Rodriguez’s commentary and Rodriguez’s version seems a worthy successor. If you want to understand the basics of operating systems without getting tangled in the weeds, this is an excellent way of doing so.

Posted in General | Tagged | Leave a comment

Unfill

I saw this post from mbork on paragraph filling. It’s a nice post and I’ll probably write about it later but today I want write about something else he mentioned in his post: unfill.el. It’s from Steve Purcell and has been around for a couple of years but I somehow missed it.

Most of my Emacs buffers are set to wrap text, which is usually what you want to do but for writing buffers, such as my blog posts, I use visual line mode and don’t want any filling. More often than you’d think I would, I find myself writing a blog post or some other prose and discover that I’m filling text lines.

My usual solution to this is to let the line length to a large value and call fill-paragraph. That’s not very hard but it’s a pain and I should have automated it long ago but my laziness kicked in and I never did. Happily, Purcell has done this for me. It does the same thing I did manually but with a single key press. Even better, he provides the unfill=toggle function. If you call it once, it fills the paragraph. If you call it again, it unfills the paragraph. That’s nice because you can bind unfill-toggle to Meta+q, or whatever you usually bind the fill command to, and get both commands for the price of one. In the mean time, I’ve installed unfill.el and bound Meta+q to unfill-toggle. One more tiny nub sanded down.

Update [2026-01-17 Sat 15:57]: unfill.org → unfill.el

Posted in General | Tagged | Leave a comment

The Emacs OS: The Unix Way Vs. The Emacs Way

Chris Maiorana has decided to take the old joke about Emacs being an operating seriously. Or at least at face value. He has planned a series of posts where he compares the Unix way of doing things to the Emacs way.

The first post in the series compares directory listings. That’s a fundamental function for any operating system, of course, so it makes sense—if you’re comping operating systems—to see how they handle that task.

Maiorana’s answer is to look at the various outputs from the Unix ls command and compare them to the results from Dired. There’s not much to compare, of course, because the Dired listings are generated from the underlying ls command. The difference is how you handle options. In Unix this is done through command line options. In Emacs, you change the Dired listing after it’s first displayed with buffer specific commands as usual in Emacs.

The real difference is in the power that Dired provides. You can’t do anything that you couldn’t do in Unix but with Dired it’s all one command. You think of the listing as just another Emacs buffer that you operate on in the usual ways or perhaps bring bespoke commands to bear.

I don’t really believe in the Emacs as OS paradigm—although I sometimes pretend I do. A more accurate description is that those of us who live in Emacs tend to treat it as if it were a shell. With Emacs, there is seldom any need to drop into an actual shell to get things done and even if you do, Emacs can provide you with several including it own eshell.

I’ll be interested to see Maiorana’s subsequent posts on the subject. I’m interested in exploring the extent to which Emacs can be claimed to be an operating system.

Posted in General | Tagged | Leave a comment

A New Package.el Feature

One of the problems with the ELPA package manager is that you never know what you’re getting when you upgrade. The package manager tells you what packages can be upgraded and you can choose to upgrade or not but you don’t know what’s changed.

Happily, a new feature has just been committed. Now you can examine a diff between the old and new versions to get an idea of what has changed. It’s not ideal if you can’t read Elisp but at least those who do read it can get an idea of how the new version differs from the previous.

It’s not a big thing, I suppose, but it does show how Emacs is continuing to improve and make its users’ lives better. This new capability probably won’t be available until the next release but it’s something to look forward to.

Posted in General | Tagged | Leave a comment

Running Emacs As A Service

Matthias over at Ahoi Blog makes an observation that I’ve also made many times: Discussion about Emacs startup times ends as soon as you run Emacs as a daemon. The startup is instantaneous and if you prefer a Vim-like way of operating where you start and stop Emacs each time you need it you can have it. Of course, Emacs doesn’t really stop. It’s still running as a daemon and will pop up a new frame for you whenever you need one.

With this model, the Emacs startup time is absorbed into the system boot time, which presumably happens rarely. The question is, how to get the daemon started. If you want to have it happen at boot time, the exact method depends on your operating system.

Matthias shows how to do this in Linux. It’s a little finicky because of systemd but really just amounts to making an entry in a configuration file. You can see the details in his post. The other issue is how to start, stop, and interact with the Emacs daemon when it’s running. Matthias has a simple script that automates all that so that you don’t worry about the intricacies of systemctl and journalctl.

The other possibility is to simply never exit Emacs. That’s what I do. I run it in its own workspace so I don’t have to worry about hiding it when it’s not in use. I also start server mode so that I can instantly pop up a frame (either GUI or terminal) if I want to for some reason. I really do think this is the best solution but others obviously disagree. If you like to bring up your editor when you need it, quit when you don’t, and your editor is Emacs, you should take a look at Matthias’ post. It will tell you how to run Emacs the way you want to and you’ll never have to think about startup time again.

Posted in General | Tagged | Leave a comment