BOM Characters From Windows Files

It’s been a slow day on the Intertubes for Irreal material but I do have something that might interest those of you who have the misfortune to be running Emacs on Windows. Just the other day, we discussed the sad fact that Emacs on Windows can be slow. Despite the tone that my posts on Windows often take, I do want Windows users to be able to enjoy all the benefits that Emacs offers.

One of the problems with Window/Unix interaction is that they made slightly different decisions about file formats. That mostly manifests itself in Windows using CR LF for EOL while Unix uses LF. This isn’t just a matter of Microsoft’s contrariness. The choice of CR LF was reasonable at the time.

Over at the Emacs subreddit, BrainFuckPlusPlus talks about another problem with using Emacs on Windows. He’s an Emacs user working in a shop dominated by VSCode users. Apparently VSCode saves files with a BOM sequence starting the file and he was trying to get Emacs to ignore the BOM by setting the Emacs coding method. He found a solution but that solution caused problems in another area.

That brings up another remarkable aspect of this story. BrainFuckPlusPlus’s question was answered by Eli Zaretskii, the main Emacs maintainer. This was an obscure question on reddit, not the Emacs-Devel mailing list, and yet Zaretskii took notice and explained what BrainFuckPlusPlus should do to resolve it.

Zaretskii, like most FOSS maintainers, doubtlessly has a job and a family demanding first claim on his time but he still found a few minutes to help an Emacs user with an arcane problem. It’s yet another demonstration that Eli and the other devs don’t get nearly enough credit.

Posted in General | Tagged | Leave a comment

One Line Per Sentence

Chris Maiorana has another thought provoking post that advocates the use of one line sentences. The idea is that each sentence ends not just with a period but with a newline. That seems a little unnatural but has a lot to recommend it.

I don’t do that anymore but I used to. I wrote two books where every sentence was a separate line. This was before my Emacs days so I was using Vim but it worked pretty much like it would in Emacs. If the sentence was long, the line would wrap to fit on the screen but the wrap was virtual, much like Emacs’ visual-line-mode. Actually, using visual-line-mode means that paragraphs rather than sentences are the single lines but no one ever thinks of it that way.

I no longer remember why I used the one-line-per-sentence method for my books. It probably had something to do with the fact that they were written with Groff but as Maiorana says, there are lots of good reasons to recommend it. You can check his post for some of those reasons.

As with most things, Emacs—and in particular Org mode—has you covered. There are commands for moving between sentences and for moving those sentences up and down. That makes it easy to switch sentences around while you’re editing. None of that depends on one line per sentence, of course, but works seamlessly if you prefer that way of working.

My view is that Emacs and Org mode do away with a lot of the reasons to use one line per sentence but, of course, you like it for some of the reasons Maiorana offers or for others, Emacs has you covered. Even if you have to mix methods, Emacs will work the same way.

Posted in General | Tagged | Leave a comment

Why SICP Matters

All you Irreal oldtimers know that I’m a fanatical fan of Abelson’s and Sussman’s Structure and Interpretation of Computer Programs (SICP). It is, I think, arguably the best computer science book ever written. You oldtimers also know how bitterly disappointed I was when MIT abandoned SICP and the course built around it. I’ve never accepted nor found convincing the rationale for that change.

I discovered SICP late in my career and even though I was well past the age when fundamental change was supposed to be possible, it completely changed the way I thought about and approached our craft. It was literally a life changer.

In 2011, to celebrate MIT’s 150th birthday, Brian Harvey, a Berkeley professor, was asked to write an article on why SICP was important. Here it is. It is, at the same time, inspiring, bittersweet, and infuriating.

It’s inspiring because it states clearly and convincingly why SICP is the right thing and how much better it is than other introductory courses that spend most of the semester discussing the syntax of whatever (non-Scheme) language de jour they’re using.

It’s bittersweet because Harvey recounts how SICP affected his students even though some of them didn’t realize its profound effect until years later. That would be fine except that in his essay Harvey wondered if SICP would survive his retirement. Sadly it didn’t—see his post.

Finally, it’s infuriating precisely because the fight was lost. All the people who wanted to talk about robots and program in Python won. Robots and Python are important things to learn about but they don’t teach you how to think about programming. They mainly teach you how to use libraries. That’s also important, of course, but shouldn’t we teach students about fundamentals and how to think about programming? Apparently not.

If you care at all about SICP and the culture that it engendered, take a look at Harvey’s essay.

Posted in General | Tagged , | Leave a comment

Casual Suite

Charles Choi has made good on a promise he made in his post announcing a name change for some of his early Casual packages. In that post, he said he was going to bundle all the current and future Casual extensions into a single package.

He’s honored that pledge and the new Casual Suite is available for download on MELPA. It’s the best of both worlds. If you want all the current and future porcelains, you can install the Casual Suite package. If, like me, you prefer to load only some of them, you can do that too because the individual porcelains are available on MELPA too.

As I’ve said before, these packages are a real win. The only time you need to invoke them is when you want to use some aspect of the target UI that you seldom need and don’t remember the shortcut for. The menus are never shown unless you explicitly call them.

Posted in General | Tagged | Leave a comment

The Emacs 30 Release Cycle Has Started

Eli Zaretskii has announced the start of the Emacs 30 release cycle. What that means is that Eli has created the emacs-30 release branch and restricted commits to it to bug fixes that don’t affect low level code. This is the start of the process where what will become Emacs 30 starts undergoing refinement and polish.

Eli says that he hopes to release the first pretest in about a month. After that, barring any show stoppers, the release of Emacs 30.1 won’t be far behind.

If you don’t mind living on the bleeding edge, download and install the emacs-30 branch and report any problems to the development team. You’ll be helping all of us get a better Emacs 30.1 faster by doing so.

I know I always say this but it can’t be said enough: thanks to Eli and the other devs who work so hard to benefit us all. I’d double their salary but it would stay the same.

Posted in General | Tagged | Leave a comment

PSA: Emergency Emacs/Org Release

Stefan Kangas writes to tell us about an emergency Emacs release to version 29.4. This is the result of a recently discovered Org mode problem, that you can read about here. Both projects have offered updates. The Org mode announcement says that you should update either Org or Emacs. The Emacs announcement says you should update both so I am updating both.

I’ve updated Emacs and am in the process of updating Org. Right now it is stuck “checking Org-2.7.5” so I fired up my old version of Emacs to write this.

If you’re an Org user, you need to do something. The safest thing, I guess, is to update both. That’s what I’m doing and when I’m done, I will have the latest Emacs and Org. This is a pain but, really, we hardly ever have this sort of thing with Emacs or Org. Compared with my other apps that have an update every week or so, that’s not bad.

Afterword

Org finally finished but then Org wouldn’t run correctly. I blew away my Elpa directory and let Emacs rebuild everything on startup. Still no joy. Finally, I removed the new Org from Elpa, started Emacs with a -q to prevent it from loading the builtin Org, and installed the new Org. That worked and everything is fine now. You’d think I’d remember about doing that when I have problems with loading a package, but no. Maybe next time.

Update [2024-06-23 Sun 12:08];

Ihor Radchenko has clarified that the fix is entirely in the Org code so there is no need to update Emacs unless you want to run the builtin Org. You need only update one or the other.

Posted in General | Tagged , | Leave a comment

The Hours That Programmers Keep

An enduring stereotype about hackers—as opposed to those who program only as a day job—is that they get up at noon, start programming in the late afternoon, and keep programming for most of the night. Many of us, me included, are preternaturally night people. But that mostly works for young people. Once you get a bit older and start your own family, keeping those hours is a non-starter.

But the question arises: is this stereotype accurate or is it a legend perpetrated by a few outliers? Ivan Bessarabov decided to find out. That’s not as hard as you might think. His idea was to check the times that some famous open source programmers made commits to GitHub.

The results weren’t surprising. They were, in fact, just what you’d expect. Some, perhaps many, programmers from this subset did adhere to the stereotype but others—Linus Torvalds, for example—work on a normal day schedule.

None of this really matters at all except as a cautionary tale for those anal micromanagers who want everybody to be in the office for a set of fixed hours. Still, it is interesting and I’d be interested in a wider survey. One could, of course, just look at all the GitHub repositories and parse out the individual contributors but some of those will doubtless be people working at places like Red Hat and contributing as part of their day jobs.

I’m not sure how you’d filter for those programmers who can work whatever hours they choose. Even then, you’d get lots of people, like Linus, who can theoretically work whenever they like but have family responsibilities that limit their actual available work times.

I’m sure, that with enough effort, this could be done but it’s probably not important enough to be worth the effort. As for me, I’d be working into the night except that, you know, family.

Posted in General | Tagged | Leave a comment

🥩 Red Meat Friday: Is Emacs Slow For You

Over at the Emacs subreddit, MarkieAurelius has a mini-poll that asks: Is Emacs Slow For You? That’s a perennial question, of course. I last wrote about it a year ago. Not much has changed since then.

The same uninformed people are opining at the top of their lungs about how slow and unusable Emacs is and, of course, the ankle biters are as active as ever. The best contrary opinion was from danderzei who said “Emacs works as fast as I can type and think.” That’s been my experience too. Emacs is more than able to keep up with my typing even though I’m a reasonably good touch typist.

Many of the comments blame LSP for any perceived slowness. I program in C and Lisp so I’ve never seen the point of LSP and have never used it. It may be that it does slow things down. How this compares to other editors, if it actually happens, I don’t know. In this case, I’m able to get away with saying “I don’t care.”

The other cause of slowness appears to be running on Windows. Some commenters report that running Emacs under WSL resolves the problem for window users. I’m happy to say that I really don’t care about any Windows related problems.

Some commenters suggest that maybe having a lot of packages slows things down. I have a a moderate number—probably about 80—of packages installed and it doesn’t seem to affect the speed of my Emacs. It’s hard to see why having a lot of packages, per se, would have much effect unless they’re something like LSP that has to look at every keystroke.

So that’s it for another year. Emacs is (still) not slow in any way that matters for most users and you folks claiming otherwise are going to have to find something else to complain about.

Posted in General | Tagged , | Leave a comment

Which-key Moves To Core

I’ve been following the discussion on Emacs Devel about moving the excellent which-key app to Emacs core. Moving it to core was non-controversial. The only issue was whether they could get all the which-key contributors to assign their rights to the FSF before the Emacs 30 freeze. Happily, that appears to have happened and which-key will be part of Emacs version 30.

In a sense, it doesn’t really matter. As I’ve said before, the difference between core and third party packages is mostly political rather than practical. Still, there are some advantages to being in core. First, some users install Emacs on minimal systems or have to run old versions for one reason or another so they have to depend on whatever comes prepackaged with Emacs. Second, and more important to my mind, having a package in core aids in discoverability. It’s a lot easier to discover, say, which-key if it’s builtin and doesn’t have to be installed.

Regardless, if you aren’t already using which-key, you should start. It mostly stays out of the way but if you start a key sequence but don’t complete it within a preset time interval, which-key will pop up a menu in the minibuffer with the possible completions. It’s really great because you don’t have to worry about, say, all the rectangle commands. If you type Ctrl+x r and stop, which-key will tell you all the possible completions.

I’ve been using it for years and wouldn’t want to live without it. I’m happy to see it moved to core if only because a few more people will discover it.

Posted in General | Tagged | Leave a comment

Creative Writing With Emacs

Chris Maiorana has an interesting post on using Emacs for creative writing. The TL;DR was that a friend criticized his writing as being too “choppy” and speculated that it was because Emacs made it too easy to rearrange blocks of text. He took that criticism to heart and tried using Libreoffice Writer for his writing instead. The results were the same. It turns out that the problem was his and not his writing instrument. He solved the problem without reference to his editor and returned to Emacs.

It was an interesting story but it got me thinking about professional writers and the mechanics of their writing. Professional writers are notoriously fussy about their writing environment and have strongly held views on what’s right and works for them.

Some—Neal Stephensen and Tess Gerritsen, for example—write their stories in long hand and only later transcribe them with some sort of editor. Stephensen says he types so fast that he doesn’t have time to think carefully about what he’s writing. Gerritsen says she types faster than anyone she knows and that if she wrote on a word processor she would spend her time editing instead of writing.

Others, such as Vernor Vinge, Jerry Pournelle, and Charlie Stross use their editors exclusively. Pournelle, in particular, wrote several BYTE articles on the various editors he used for writing.

I don’t write novels but I do have strong opinions about the proper tools for writing. With all due respect to Stephensen and Gerritsen, two of my favorite writers, I could never write anything in longhand. First of all, my writing is terrible so I have to print, and that is so slow I’d get about 50 words a day done that way. I don’t do too much editing as I’m writing. Sometimes I’ll rewrite a sentence as I’m dong the initial draft but mostly editing happens on separate editing passes. Regardless, every bit of it happens in Emacs.

I’ve been fascinated by the writing process for as long as I can remember. Feel free to share your process.

Posted in General | Tagged | Leave a comment