Video: Emacs Tools for Writers

Derek Taylor has a nice video that talks about Emacs tools for writers. It’s a nice recapitulation of a post by Scott Nesbitt that I wrote about back in May of 2018. Taylor discusses pretty much the same tools as Nesbitt but since it’s a video you get to see them in action. The tools the video considers are:

  • Org-mode
  • Spell Checking with flyspell
  • Word counting with wc-mode
  • Grammar checking with writegood-mode
  • Distraction free writing with writeroom-mode

The word counting package, wc-mode, is a little confusing because there are two packages with that name. Taylor appears to be using this one, which doesn’t seem much different from the built-in count-words command. I prefer to use Benjamin Beckwith’s version, which has a more flexible display and provides a running count. If you’re doing almost any type of (non-coding) writing, you probably need a word counting function.

I’ve never felt the need for a “blank page” writing environment but if you’re the type of writer who doesn’t want to see anything on the screen except the words you write, you should definitely consider writeroom-mode. It gives you a screen with no status bars or other distractions and has the text nicely centered on the screen.

Finally, if you’re pining for your eighth grade English teacher’s nagging about grammar, you can try writegood-mode. I definitely don’t want that but it does have some functions that gauge the “readability” of your prose.

The video is just over 12 minutes—a little less if you skip the shout outs at the end—so plan accordingly. If you use Emacs for writing and aren’t familiar with these tools, it’s definitely something you should watch.

Posted in General | Tagged , | Leave a comment

Bozhidar Batsov on Emacs 27.1

For those of you who find NEWS files a little bit TL;DR, Bozhidar Batsov has a nice post that discusses the highlights of the Emacs 27.1 release. It’s a good way to see what’s new and important in the release. If you haven’t upgraded yet, the post should be helpful in your evaluation of the pros and cons.

Batsov feels that most people will find the JSON parsing and associated LSP support the best part of the update. I like support for arbitrary sized integers and the use of lexical binding by default the most. That’s probably because I hardly ever interact with JSON so I’m sure my preferences are a minority opinion.

I’m at one with Batsov in being glad that the developers can now devote all their energies to Emacs 28 with its native compilation. That, I think, will be one of the most significant changes to Emacs in years. It will be much like SBCL Common Lisp and other major Lisp compilers: write in Lisp, have it compiled to native code, and run at speed.

In the mean time, Emacs 27.1 brings many outstanding improvements that will enhance the Emacs experience. These are truly exciting times to be an Emacs user.

Posted in General | Tagged | Leave a comment

Steve Yegge on Emacs and Google

It’s not Friday but Steve Yegge offers us some juicy red meat with a splendid rant on Google’s constant deprecation of their APIs. His main thesis is that backward compatibility is the hallmark of successful software systems that last for decades. He explains in detail how Google fails to provide this and offloads the cost of keeping things running to their customers. It’s a great and entertaining diatribe and you should definitely spend a few minutes reading it.

The reason this is of interest to Irreal—other than that any post by Yegge is worthwhile—is that he proffers Emacs and its developers as an example of doing things right. Emacs, he says, does have the notion of obsolescence but for Emacs that means the old API is inferior in some way and a new, better one has taken its place but that the old API is still available. Your old software keeps working even when Emacs provides a better way of doing things. As Yegge puts it,

“[W]hen [Emacs developers] make an API obsolete, they are basically saying: “You really shouldn’t use this approach, because even though it works, it suffers from various deficiencies which we enumerate here. But in the end it’s your call.”

He also notes that Emacs code he wrote in 1995 is still working.

As a final note, I offer his description of Emacs, which alone makes the post worth reading:

a sort of hybrid between Windows Notepad, a monolithic-kernel operating system, and the International Space Station. It’s a bit tricky to explain, but in a nutshell, Emacs is a platform written in 1976 (yes, almost half a century ago) for writing software to make you more productive, masquerading as a text editor.

Good stuff.

Posted in General | Tagged , | Leave a comment

RMF: Emacs and Vim Are Not Line Editors

Ed is a line editor. QED is a line editor. Even Edlin is a line editor. Vim and Emacs are not: they’re visual or full-screen editors.

This Red Meat Friday offering may not exercise most of you but I find it annoying that people offering advice on technical job hunting can’t get a fundamental distinction like this correct.

Posted in General | Tagged | Leave a comment

Screenshots in Emacs on macOS

Diego Zamboni has a post that describes how to add a screenshot to an Org buffer. The post considers the problem from the point of view of macOS but is easily adapted to other operating systems. He uses the org-download package, which can take screenshots, but he doesn’t use that feature. Zamboni prefers to take the screenshot from outside Emacs and store it in the clipboard. From there he can use org-download to import in into his document.

I seldom need to put a screenshot in a document and if I did, I’d probably just use org-download in the standard way. Still, I imagine it’s pretty easy to make a case for taking the screenshot outside of Emacs. If you have that use case, Zamboni’s post is a useful way to make things as easy as possible.

Posted in General | Tagged , | Leave a comment

PDFs and the Web

The Nielsen Norman Group has an interesting article on PDFs and the Web and why they should never be read online. The article says that the group first reported this conclusion 20 years ago and nothing that’s happened in the mean time has changed their minds.

I was really surprised by their vehemence. They describe PDFs as “unfit for human consumption” and give a long list of reasons why this is so. Their main point is not that PDFs, per se, are bad but that they should never be used when you could use a Web page instead.

I’ve heard that sentiment expressed before and didn’t understand it then either. I’m not arguing that you should build a Web site out of PDFs—of course—but it’s also not true that PDFs have no place on the Web. Some examples: a whole or part of a book, a legal document, formal reports, and theses. I’m sure there are others.

I also don’t think their reasons are well founded. For instance, they claim that PDFs are (very) slow to load and give an example of a restaurant menu that took 3 minutes to load. I’ve loaded entire books in just a few seconds and most PDFs that I’ve looked at load faster than the HTML pages—with all their JavaScript and tracking scripts—that link to them. I don’t find their other reasons any more convincing.

Still, they say that users hate PDFs. That doesn’t sound right to me but maybe that’s because I don’t feel that way. Perhaps I’m wrong. What do you think?

Posted in General | Tagged | Leave a comment

Emacs 27.1 Has Been Released

That was speedy. After only two weeks since the release of the Emacs-27.1-RC1, the final 27.1 is available. I’m happy to say that this post is being written with it and I haven’t experienced any problems at all.

There’s a bunch of new changes—all documented in the NEWS file—but what I like the most is that Emacs Lisp finally has arbitrary precision integers. Your favorite new feature will probably differ.

As usual, thanks the Eli, John, Nico, and all the other developers who made this possible. These guys are really heroes, doing a lot of hard work for no pay. If you meet one of them IRL, be sure to buy them a beer.

Posted in General | Tagged | Leave a comment

Troubleshooting Mu4e Update

Recently, I wrote about my adventures in troubleshooting Mu4e. This is an update on what I discovered and what I did to resolve the problem. The chances are good that this won’t be of interest to anyone but I’m writing it down in case someone else has the same type of problems now or in the future.

The first thing I did was turn mu4e-index-cleanup off and mu4e-index-lazy-check on to speed up the reindexing. That turned out to be key to understanding what was going on. I noticed that with mu4e-index-cleanup off 2–3 thousand entries were being added to the store each time mu ran. That explained why mds (the spotlight indexer) was being kicked off each time mu ran. I turned mu4e-index-cleanup back on and the indexing was a bit faster than before I began with just mu4e-index-lazy-check on but mu was still running much longer than it should.

Next I noticed that mu.log in ~/.cache/mu/ had several entries like

2020-08-08 08:38:11 [WARN] cannot access /Users/jcs/Maildir/icloud/Trash/cur/1596883130.32552_36.Manfred:2,DS#T: No such file or directory

and that some entries in the Trash mailbox had impossible dates of 1969. There was obviously some problem in the Trash mailbox that was causing problems with the indexing.

I thought about deleting Maildir and downloading everything again from the IMAP server. There were a couple of problems with that, though. First it takes a long time and can be fussy. Second, I was worried that it might affect the renaming of posts and the links that point to them.

I finally just deleted the Trash mailbox, reinitialized the Xapian database, and ran index. That has apparently fixed all the problems. Mu4e is speedy again and even the CPU load has decreased from about 7% to 2%–3% when the system is idling.

I was lucky that the problems were in the Trash mailbox rather than in the one that holds all my saved emails. Regardless, if you have similar problems, I hope this post will help you track down what’s going on.

Posted in General | Tagged , | Leave a comment

A Proposal to Ban Adtech

A really great article by Gilad Edelman in Wired asks Why Don’t We Just Ban Targeted Advertising? The article is from March but I somehow missed it and it’s definitely worth writing about. Even without going into any details at all, almost everyone would agree that getting rid of targeted advertising and the malignant adtech industry that depends on it would increase the goodness in the world significantly.

But, it turns out, there are some specific beneficial outcomes that we could expect from getting rid of targeted ads. When you see the list

  • Privacy
  • Less hate and fallacious content
  • Less political manipulation and election interference
  • A possibly revitalized journalism industry
  • Less discrimination

it’s hard to believe that merely banning adtech would have a positive effect on all those areas but the article makes a pretty good case for it.

But what about the content providers? If we take away their advertising, wouldn’t all their content disappear? The article concludes no. Even Google—the chief adtech offender, along with Facebook—still earns 60% of its income from non-targeted ads and, of course, most serious research into the matter concludes that targeted ads aren’t really that much more effective (about 4% more).

Edelman concedes that banning adtech may be a “cure-some” rather than a cure-all but that it’s an excellent start in restoring the Internet to a better time before the advertisers starting surveilling everything we do and selling our most private activities to anyone willing to pay.

Posted in General | Tagged | Leave a comment

The Frame Patch

As I mentioned yesterday in my post about the just announced Emacs 27.1-RC2, Álvaro Ramírez left a comment to my post A Shortcut Manager for My Emacs-centric Workstation. In that post, I said that I was using yequake to pop up an Org-mode capture buffer from anywhere in the system. Jack Baty commented that yequake didn’t return to the previous application after yequake was terminated. I’d noticed that too and after a bit of research discovered that this is a macOS problem but that it could be (sort of) fixed by inhibiting Emacs from returning that the last frame when a new frame is deleted.

You can follow the discussion in the comments to the post but the TL;DR is that the fix involves a patch to frame.c. Since Emacs 27.1-RC2 had just been released, I decided to compile it with the patch and try things out. If you’d like to do the same thing, here’s the patch (against the RC2 release).

--- frame.c.orig	2020-08-07 13:54:20.000000000 -0400
+++ frame.c	2020-08-07 13:56:35.000000000 -0400
@@ -2056,15 +2056,6 @@
 		}
 	    }
 	}
-#ifdef NS_IMPL_COCOA
-      else
-	/* Under NS, there is no system mechanism for choosing a new
-	   window to get focus -- it is left to application code.
-	   So the portion of THIS application interfacing with NS
-	   needs to know about it.  We call Fraise_frame, but the
-	   purpose is really to transfer focus.  */
-	Fraise_frame (frame1);
-#endif
 
       do_switch_frame (frame1, 0, 1, Qnil);
       sf = SELECTED_FRAME ();

I said “(sort of) fixed” above because there are still two problems. First, I run Emacs and Safari in full screen mode. When I call yequake from one of them, it comes up in a different desktop. Safari doesn’t return to the Safari desktop. Oddly, with Emacs things work perfectly. The second problem is that even when yequake does return to the proper desktop, the previous application does not receive focus. Again, these problems are because of the way macOS works but the patch does help a lot.

It’s easy to try it out if you compile your own Emacs. If you get your Emacs from Homebrew, you can load the patched version with

brew install emacs-plus@27 --with-no-frame-refocus ...

Ramírez says that it should work with Emacs 26 too. Of course, if you’re not on macOS, you don’t have the problem at all.

Posted in General | Tagged | Leave a comment