Xah Lee, 2008-07
Here're some reason i think emacs should adopt the Alt+‹key› and Ctrl+‹key› notation throughout its documentation. (as opposed to emacs's M-‹key› and C-‹key› notation)
The Alt+‹key› or Ctrl+‹key› notation is universal among Windows and Linux. They account for about 95% of computers used world wide. Note that the word “Alt” and “Ctrl” are the exact labels printed on the Keys of PC Keyboards. PC Keyboard has probably more than 99% of market share.
Using a notation that contains the actual label on keyboard's keys is much easier to understand. A beginning computer user, can read the “Ctrl+‹key›” notation and figure out which keys to press. Emacs's notation of “M-‹key›” and “C-‹key›” requires a learning step, even for experienced programers. Even though it is a minor one, but learning steps add up the complexity.
(Apple's computers, which account for about %4 marke share today, also use a notation where the name or symbol appears on the labels of Apple keyboard's keys exactly. (OSX's documentation uses the notaton “Command-‹key›” and “Option-‹key›”. Application's menus shows them as “⌘‹key›” and “⌥‹key›”. Both the word “Command” and symbol “⌘” appear on the key's label, same for “Option” and “⌥”.)
By default on all major OSes in use (Windows and Linux and OSX), emacs maps its Meta to Alt key. So, practically speaking, the Meta key is the Alt key. (Aquamacs, perhaps the most widely used emacs distro on OSX, by default has Alt for Meta.)
The Meta key was one of the modifier key on obsolete keyboards used by lisp machines in the 1980s. (for photos and detail, see: Why Emacs's Keyboard Shortcuts Are Painful)
There is practically no keyboard today that has the Meta key. Sun Microsystem's keyboard has a key labeled with a diamond “◆”. Sun's official documentation refers to this key as Meta key. (e.g. search http://docs.sun.com/ on “Meta key”.) Sun's keyboards have a market share perhaps less than 0.01%.
For photos and more commentary on Sun's keyboard, see Computer keyboards Gallery.
Historically, a “Meta+‹key›” shortcut in emacs can also be invoked by “Esc ‹key›” or “Ctrl+[ ‹key›”. The design was that way mostly because at the time, many terminals do not have or support the Meta key, and Terminal is a primary application in computer use in the 1980s. The other reason is that, in emacs's implementation, the Meta+‹key› is simply a ASCII control character sequence. Today, perhaps all terminal↗, console↗, Command line interface↗ apps support Meta as Alt either by default or in a preference setting.
The ability of pressing Esc for Meta might be still useful for some people. Users who needed that feature could easily read about it in emacs doc. (I myself used “Esc ‹key›” exclusively during 1998-2004, mostly because it was a one-brainless solution that works on all telnet apps regardless of hardware, OS, or setup, and i frequently need to use different machine, OS, or remote servers.)
A argument from user interface perspective, is that multiple insignificant choices or options are not good because it increases complexity and causes the user to sidetrack their focus on tasks. KDE and Gnome, solved this problem for linuxes by adopting wholesale Microsoft Window's interface starting about 1998. (before KDE and Gnome, GUI apps on unix use a variety of “Windows Managers” that has incompatible User Interfaces, each claiming superiority.)
Note: Whether to use the “M-‹key›” or “Alt+‹key›” notation has little to do with “Esc ‹key›” feature.
PS Note that Microsoft Windows used to use the “Alt-‹key›” notation. Only in recent years they changed the minus sign to plus sign. Arguably, this is a good change because the plus sign better indicates key combination.
Here's a more precise description and clarification on exactly what is proposed.
Note that elisp keymacro syntax isn't in the proposed change, nor any elisp function such as “kbd”.
How many Emacs users do you know who, beyond their first day or two of Emacs use, have difficulty with the term Meta? I know of none, and I think only you who is irritated by it.
There are stories we sometimes see here, that people say how they love emacs once they got over the initial hurdle.
But we can look at the situation from the other way. For each such convert, there are perhaps one hundred or one thousand times more of people, who simply looked at emacs for 10 minutes, and refused to look at emacs again for the rest of their programing career.
Adopting the “Alt+‹key›” notation will create confusion in elisp's keyboard macro syntax. User will ask, why is Alt key represented by “M-” and not “A-”?
I don't think this is a problem.
The Alt+‹key› notation makes emacs easy to use for beginners. For advanced users or elisp programers who want to do keybinding, they can easily understand that the syntax “M-” stands for Meta and is by default mapped to the Alt key.
(Emacs geeks like to say, that if user can't understand “M-” for “Alt+”, then the user shouldn't use emacs. To quip the hardcore geeker: if someone interested in elisp get confused that “Alt+” is represented in lisp code as “M-” the perhaps he isn't fit to code elisp.)
Lisp itself has lots of unfixable baggage in its key macro syntax. For example, there's also Hyper, Super, with syntax “H-” and “s-” (Shift is “S-”). These keys doesn't exist today (but one can bind them just like Meta, of course). Further, there are quite a lot variations of the keyboard macro syntax. Here's a example of equivalent syntax for binding the Enter key:
; equivalent code for a named special key: Enter (global-set-key "\r" 'cmd) (global-set-key [?\r] 'cmd) (global-set-key [13] 'cmd) (global-set-key [(13)] 'cmd) (global-set-key [return] 'cmd) (global-set-key [?\^M] 'cmd) (global-set-key [?\^m] 'cmd) (global-set-key [?\C-M] 'cmd) (global-set-key [?\C-m] 'cmd) (global-set-key [(?\C-m)] 'cmd) (global-set-key (kbd "RET") 'cmd) (global-set-key (kbd "<return>") 'cmd)
(For detail, see: The Confusion of Emacs's Keystroke Representation.)
It is likely that half of emacs developers, can't explain fully every variation above in exacting detail.
There's also some syntax that compile but has no effect:
(global-set-key (kbd "M-S-b") 'cmd) ; compile but no effect
In summary, if we adopt Alt+key notation in manuals and menus, i do not think it introduces any confusion when it comes to the elisp coding or emacs customization related to keybindings. I think it actually makes it simpler. The logic is like this:
Related essays: