From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Newsgroups: gmane.emacs.help Subject: Re: Emacs command frequencies: Date: Wed, 12 Nov 2008 20:07:28 -0800 (PST) Organization: http://groups.google.com Message-ID: <8d3cd3b6-82be-4987-a83a-176781c362b7@c36g2000prc.googlegroups.com> References: <74160b46-e541-436a-a776-c8bd53d6cd55@o4g2000pra.googlegroups.com> <1f28a20e-0c9f-4478-a85c-27ae40ed7fc9@v16g2000prc.googlegroups.com> <4d476218-bd76-4d41-8a12-1428dfba9e9b@s9g2000prg.googlegroups.com> <1226211980.88912@nntp.acecape.com> <7a377b0d-9a02-4cd9-947a-8f04676fad8c@z28g2000prd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1226563214 23152 80.91.229.12 (13 Nov 2008 08:00:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Nov 2008 08:00:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 13 09:01:15 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L0X8a-0001i1-3o for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Nov 2008 09:01:14 +0100 Original-Received: from localhost ([127.0.0.1]:35158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0X7S-0007fD-0I for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Nov 2008 03:00:02 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!c36g2000prc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 222 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1226549249 20011 127.0.0.1 (13 Nov 2008 04:07:29 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 13 Nov 2008 04:07:29 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c36g2000prc.googlegroups.com; posting-host=24.6.185.159; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:164384 X-Mailman-Approved-At: Thu, 13 Nov 2008 02:58:42 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:59723 Archived-At: Hi Nikolaj, Interesting thoughts. On Nov 12, 3:28 am, Nikolaj Schumacher wrote: > Xah wrote: > > here's my top commands... started maybe few months ago. > > Some notes on this. (Some opinions, and some theses. The latter > will point to some missing data that could influence the > interpretation.) > > - Clearly some individual commands are very common and need to be comfort= able. > > - Some commands are infrequent enough, that making them comfortable would > be a waste of time. One could argue that they should be focused on > being easy to remember. I think that are probably all those beyond the > top 25. > > - I am very careful when rebinding default keys. Not because I think the > defaults are excellent, but because once you rebind one, you likely have > to rebind many more. Unfortunately, this makes rebinding common keys > less worthwhile. You can't just rebind the top 25, you'll have to > rebind many more. If you want to use M-x or C-c, it would even be > thousands. somehow i solved this. I've been using my ergonomic binding map for about 2 years now. In the beginning several of modes override my keys, and then i wasn't sure how to reclaim them with hook, especially in more fundamental modes like minibuffer, shell, isearch. I pretty much just accepted these inconveniences. I just used the default binding or physical keys when in minibuffer. Overall, i'm still much happier because most of the time keystroke happens not in these special modes. But it turned out to be quite simple to solve them with a hook as my elisp knowledge increased. Of course one worries about consequences of rebinding keys in minibuffer... but actually not problem has turned up. One may worry that modes will constantly reclaim keybindings but actually not so. Occationally a mode will reclaim about 2 or 3 in the Meta+=E2=80=B9letter=E2=80=BA space, that is easily fixed with a hook. Now = with experience, the these keys are very predicable (thanks to emacs keybinding convention) and recently i learned that minor mode takes precedence over global keymap... so in the very near future i'll make my ergo map a minor mode which should avoid many hooks. (for those who wants to try, the elisp code is here: http://xahlee.org/emacs/ergonomic_emacs_keybinding.html ) > - A very important aspect is repeated keystrokes. Clearly, a lot of > next-lines are consecutive, meaning they are easier to type the second > time around. So as far as finger strain goes, they're slightly > over-represented in the statistic. Yeah. > - Commands that are repeated frequently should have the highest priority > for one-button keys. Yeah. > That's why I personally think save-buffer and > kill-this-buffer would be a waste for single keys. I think there are sufficient availale simple shortcut positions to allow these common commands to have a easy shortcut. there are some 26 simple Meta+key positions and another 26 Ctrl+key positions. Counting the top number keys and other misc symbol keys would add about 15 to each. Now if you look at the most used commands... the top 5 or 6 makes up a big majority... then the rest commands gradual out. There is only one sharp gap after top 10th command or so. in fact, with my ergo map, since most frequently used commands are now on the Meta+key space, the Ctrl+key space is pretty much empty now. So, commands like Open, Close, Save, now go there with modern stardard shortcuts with Ctrl. (i put frequently used commands on the Alt+=E2=80=B9ke=E2=80=BA space inste= ad of Ctrl +=E2=80=B9key=E2=80=BA space is because in general Alt is easier to press t= han Ctrl because Alt is right under thumb, involving a natural inward curl of the thumb, while Ctrl is pinky, involving some un-natural stretch or bending of the pinky, further, thumb is the most powerful finger, pinkie the weakest.) so, on one hand i have most used commands in the most easy to press Alt space, on the other hand we can support the standard shortcuts for Open, Save, Close, Print in the Ctrl space. this is like 2 birds with one shot. > On the other hand > other-window has a terrible default for the same reason. yeah. > - There are also commands that presumably appear in groups. Clearly this > is the case for letter input. You'll often type hundreds of them in a > row without using anything else. And you do so with a high speed. So > it's important that they go well with each other. The same goes for > navigation commands. They are often used in rapid succession and should > be usable without much finger movement. Yeah. The cursor keys. I have the cursor keys under the right hand home position. And the other group is delete single char left/right, and delete word left/ right, which i have on the left hand on D F E R keys with Alt. Another group is copy cut paste undo, which is the Z X C V keys. I have them with Alt, but with Ctrl can also be supported to be compatible with modern standards. The drawback is of course duplication, but we have enough spaces. In my ergo map, some 70% of Ctrl+letter positions are empty. (one could consider moving many =E2=80=9CCtrl+key key=E2=80=9D seque= nce into =E2=80=9CCtrl+key=E2=80=9D space but that calls more extensive remapping) > Other commands (like > save-buffer or find-file) are usually executed on their own, during > typing pauses. That's why I think they can get away with a less > comfortable shortcut, while some less used commands should take priority. > > - Another possible conclusion to draw from high frequency of certain > commands (especially if repeated often), is that they aren't efficient. > That's why I replaced most of my usage of other-window with my > window-numbering-mode. It replaces several invocations by a single one. > I often feel I should use next-line with a prefix, but holding my finger > on C-n is so much less trouble. (That's why I was thrilled to find > move-to-window-line recently. It saves me about 10-30 C-n each time I us= e > it.) one thing i noticed is that, although emacs has extensive number of shortcuts (about 700), from my observation of emacs users in online forums or irc thru my now 10 years of emacs using, and from my own experience and study on emacs keybinding and system in the past 3 years, i find that vast majority of dedicated emacs users (say, over 2 years of emacs using in full time day job), do not use most of these. Maybe using them once in few months. A few emacs users may use particular command, but others never did. Put in simple words, vast majority of emacs users do not use or know vast majority of existing keybindings. There are only maybe less than 30 keybindings that are commonly used daily by all. > And don't forget about backspace and return. Those are some terrible key= s. > (At least those L-shaped return keys.) I've replaced them with C-h and > C-m and couldn't be happier. ultimately, when studying keyboard shortcut in depth, one runs into the design problems of the keyboard's physical layout itself. For example, the Backspace, Enter keys as you cited, among others. The Kinesis keyboard fixed these problems. For example, it has about 4 keys for each thumb in location below a PC keyboard's space bar. They are used for Backspace, Enter, Alt, Ctrl, Page Up/Down, Home/End. (as far as i know it is patented, and is the reason i guess no other keyboard manufacture followed, in particular Microsoft, of which is rather innovative in keyboard design) (see =E2=80=A2 =E2=80=9CKeyboard Hardware Design Flaws=E2=80=9D http://xahlee.org/emacs/keyboard_problems.html =E2=80=A2 A Review of The Microsoft Natural Ergonomic Keyboard 4000 http://xahlee.org/emacs/ms_keyboard/ms_natural_keyboard.html ) > The same goes for the keys between 0 and > backspace. On my dvorak layout those are [{ and ]}, and I've moved them > to alt+, alt+., alt+/, alt+=3D system-wide. I've also switched ( and ) > with < and >. This really helps "the weakest finger". my own solution for these, is to have map them in the Hyper key space with right hand's homerow keys. The hyper is the Windows key on my Microsoft keyboard used with Mac OS X. For example, i have these (with dvorak layout): (global-set-key (kbd "H-d") (lambda () (interactive) (insert "=C2=AB=C2=BB"= ) (backward-char 1))) (global-set-key (kbd "H-h") (lambda () (interactive) (insert "{}") (backward-char 1))) (global-set-key (kbd "H-t") (lambda () (interactive) (insert "()") (backward-char 1))) (global-set-key (kbd "H-n") (lambda () (interactive) (insert "[]") (backward-char 1))) (global-set-key (kbd "H-s") (lambda () (interactive) (insert "=E2=80=9C=E2= =80=9D") (backward-char 1))) (global-set-key (kbd "H-D") (lambda () (interactive) (insert "=E2=80=B9=E2= =80=BA") (backward-char 1))) (global-set-key (kbd "H-T") (lambda () (interactive) (insert "=E3=80=8E=E3= =80=8F") (backward-char 1))) (global-set-key (kbd "H-N") (lambda () (interactive) (insert "=E3=80=8C=E3= =80=8D") (backward-char 1))) (global-set-key (kbd "H-S") (lambda () (interactive) (insert "=E2=80=98=E2= =80=99") (backward-char 1))) (global-set-key (kbd "H-g") (lambda () (interactive) (insert "+"))) (global-set-key (kbd "H-c") (lambda () (interactive) (insert "=3D"))) (global-set-key (kbd "H-r") (lambda () (interactive) (insert "\"\"") (backward-char 1))) Xah =E2=88=91 http://xahlee.org/ =E2=98=84