|
Re: a ergonomic emacs keyboard shortcut layout: msg#00057emacs.macintosh.osx
On Aug 13, 2007, at 1:39 AM, Peter Dyballa wrote: I think your Elisp code is not correctly counting the "self-insert" commands when I enter there's nothing much to the elisp program that counts commands. http://xahlee.org/emacs/command-frequency.el (it's not written by me, btw) the key to this short program is just: (add-hook 'post-command-hook 'command-frequency-record) the command-frequency-record simply add the value of the buildin var “this-command” to a keyed list. The only thing i found odd is that it lumps commands backward-kill- word, kill-word, kill-line, kill-region, all into just kill-region. it turns out, this is intentional of emacs's “this-command”. (thanks to Katsumi Yamaoka). Quote from lisp doc: « — Variable: this-command This variable records the name of the command now being executed by the editor command loop. ... Some commands set this variable during their execution, as a flag for whatever command runs next. In particular, the functions for killing text set this-command to kill-region so that any kill commands immediately following will know to append the killed text to the previous kill. » See the relevant docs here http://xahlee.org/elisp/Command-Overview.html http://xahlee.org/elisp/Command-Loop-Info.html If anyone can contribute a patch to command-frequency.el that'd be super! you wrote: «...The relation of text input to commands of 1:2 looks strange to me ...» i wondered about that too. But it appears to be a fact. That is, if you count cursor moving commands (such as pressing arrow key), one actually do that a lot than typing. See this report: http://xahlee.org/emacs/ergonomic_emacs_keybinding.html middle, quote: ----------------- Better Shortcut Layout vs Better Key Layout On the subject of keyboarding ergonomics, a user may wonder whether switching from QWERTY to Dvorak provides a better improvement than switching from a lousy to better keyboard shortcut layout. (Assuming that he does only one of the above.) Of my Emacs Commands Frequency study, 37% of key strokes involves data entry (that is, calling the commands “self-insert-command” and “newline” (pressing return), while the rest 63% are calling all other commands. This seems counter-intuitive, because one might think typing should probably be the bulk of activity and moving cursor and deleting text or other commands are only done few times per minute. If we include commands invoked by the Backspace key as data entry, then 40% are data entry, while 60% are editing commands. Still surprising. Going one step further, if we consider the next group of most used commands of moving the cursor by the smallest unit (i.e. previous-line (C-p), next-line (C-n), backward-char (C-b), forward- char (C-f) (also invoked by the physical arrow keys)) as part of data entry, then, 64% are data entry and 36% are other command calls. This data seems to indicate, that a better shortcut layout is as important as a better key layout, at least for computer programing related text-editing tasks done in emacs. ----------------- Xah xah@xxxxxxxxxx ∑ http://xahlee.org/ Am 07.08.2007 um 23:49 schrieb xah lee: Recently i've done some studies on emacs command frequency and come up I think your Elisp code is not correctly counting the "self-insert" commands when I enter M-x som TAB comm TAB or do work in *shell* buffer with UNIX commands or type y(es) or n(o) to answer questions. Commands like exit-minibuffer or newline or nil seem to be formal ones I don't ever type. The relation of text input to commands of 1:2 looks strange to me ... -- GReetings Pete If all else fails read the instructions. - Donald Knuth ---------------------------- Info ----------------------------- List Post: <mailto:macosx-emacs@xxxxxxxxxxxxxxxxx> List Archives: <http://dir.gmane.org/gmane.emacs.macintosh.osx> ☄ ---------------------------- Info ----------------------------- List Post: <mailto:macosx-emacs@xxxxxxxxxxxxxxxxx> List Archives: <http://dir.gmane.org/gmane.emacs.macintosh.osx> |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: a ergonomic emacs keyboard shortcut layout: 00057, Peter Dyballa |
|---|---|
| Next by Date: | Re: a ergonomic emacs keyboard shortcut layout: 00057, xah lee |
| Previous by Thread: | Re: a ergonomic emacs keyboard shortcut layouti: 00057, Peter Dyballa |
| Next by Thread: | question: remapping accented character: 00057, Marc Shapiro -- at work |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |