On Tue, Aug 01 2023, Spencer Baugh wrote: > I think my "backgrounding" approach would be a perfect solution to this: > start out blocking the UI waiting for the diff, but let the user hit a > key to "background" it, to immediately create the window which will > receive the diff asynchronously. That works great both in fast and slow > diff-generation scenarios. I was wondering what would happen if Emacs would adopt a one-thread-per-command strategy, i.e. every command starts out in a new background thread. Just for fun I came up with the patch from below. Surprisingly, quite a few things worked. Like moving around in a buffer, switching buffers, M-x list-threads. Even C-x C-c. Not surprisingly, many things don't work. Like killing buffers. Anyway, just wanted to share this idea, in case somebody wants to write some actual code to give us some form of "background commands". It might not even require a total rewrite of Emacs. Helmut