Present - Programming - Random Keybindings Considered Harmful

Random Keybindings Considered Harmful

Under the Unix versions of the Netscape and Mozilla Web browsers, for example, fill-in fields in forms recognize a subset of the default bindings for the Emacs editor. ... This choice helps people who know Emacs, and leaves others no worse off than an arbitrary, idiosyncratic command set would have.

Eric Raymond

Unfortunately, it does leave others worse off. The two interfaces collide gracelessly: Ctrl-A, Ctrl-W, Ctrl-N, and Ctrl-V all do potentially surprising things. Since Ctrl-A duplicates the functionality of Home, "Select All" must be changed to Alt-A. This may have worked better in Netscape 4, when all of the shortcuts used Alt, but with Mozilla's switch to Ctrl, it's no longer consistent with the rest of the Edit menu. Ctrl-W can either delete a word or close a window, and the "delete word" action isn't even copying Emacs. It's probably from standard Unix console handling instead. In a similar vein, Ctrl-N only sometimes opens a new window. If someone realizes that cursor movement is Emacs-like, they'll be surprised when Ctrl-V invokes Paste instead of PageDown.

By throwing in this random set of keybindings, the predictability of the interface decreases, exactly contrary to the Principle of Least Astonishment. It increases complexity in both the application itself and the user's mental model of it, for no benefit. Worse, it's unknown whether these Emacs bindings are present on other platforms by simple inspection; since they're invisible, their absence is as well.

If it needs to be implemented, it should be an extension. Then those who really want it can choose to install it and break things consciously.


This page is Copyright 2003 C. Daelhousen <> and covered by the legal page for the Present.