logoalt Hacker News

dantillbergtoday at 2:07 PM1 replyview on HN

Emacs key sequences are similarly stateful, and GP may hate that just as much, even if the state is temporary.

For my part, in emacs I would often try ctrl-x-s to save, but miss the x. When I repeat the attempt, emacs register the complete but unknown key sequence ctrl-s-x followed by the start of a new key sequence with ctrl-s. I consider this similarly stateful because the behavior of "ctrl-s" changes entirely depending on what keystroke (if any) preceded it.


Replies

jerftoday at 2:23 PM

I don't like that aspect of emacs, but if you are a heavy-duty editor user it becomes difficult to arrange a consistent set of emacs shortcuts that aren't modal that don't conflict with anything else, because there's so many things you might want to do and so many pre-existing keyboard shortcuts that you can conflict with, not just in emacs but in your window manager. As a simple for-instance, I've got four or five keyboard shortcuts I added in the last year for dealing with the Claude windows in emacs that I've been using (the package defines a couple dozen, it's just about five I use a lot), and I didn't even try to figure out how to make them anything other than "C-c c $something" because it's hard to find somewhere they can go in any sort of pattern that makes any sense and doesn't conflict with anything. Fortunately most Unix window managers seem to leave the Windows key alone, but of course if I try to bring that to Windows it would fail miserably.

I did remap my heaviest hitters a long time ago to single strokes, though. Most notably, start macro, end macro, and replay macro all got coveted non-modal shortcuts.