yonglehou / ergoemacs

Automatically exported from code.google.com/p/ergoemacs
0 stars 0 forks source link

Improve command-frecuency #22

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Reported by davidcapello on 2009-09-13

Modify command-frecuency:
- discriminate commands by major mode;
- do not record keyboard macros (sometimes, a chunk of text is recorded, 
and that text could be private), just record well known-symbols;

This issue is related to:
http://code.google.com/p/emacs2010/issues/detail?id=21

Original issue reported on code.google.com by xah...@gmail.com on 15 Sep 2009 at 7:47

GoogleCodeExporter commented 9 years ago
Hi David,

I'm not sure about the output of the command frequency.

I just tried it. It output like this:

    126   45.99%  (text-mode . self-insert-command)
     41   14.96%  (text-mode . next-line)
     10    3.65%  (fundamental-mode . self-insert-command)
      9    3.28%  (text-mode . newline)
      7    2.55%  (fundamental-mode . previous-history-element)
      6    2.19%  (dired-mode . next-line)
      6    2.19%  (fundamental-mode . execute-extended-command)
      4    1.46%  (fundamental-mode . backward-kill-word)
      3    1.09%  (text-mode . cua-delete-region)
      3    1.09%  (text-mode . undo)
      3    1.09%  (text-mode . backward-paragraph)
...

now commands are scattered among modes. As it is, this kinda defeats the 
purpose of 
measuring frequency of commands. For example, it shouldn't matter where undo is 
called, it is still the same command.

I think storing extra data about the command's mode is very good , but the 
command 
command-frequency itself should output the same data as before.

We might add a mode-frequency, which gives us mode use frequency stat. So that 
command-frequency still output the same as before.

Alternatively, we modify mode-frequency command so that it output by command's 
frequency, but generate subtree of the distributed frequency of each command's 
use in 
modes. Something like this:

    126   45.99%  self-insert-command
                    90% text-mode
                    10% fundamental-mode
     41   14.96%  next-line
                    52% text-mode
                    40% dired-mode
                     8% emacs-lisp-mode
      ...

I think i much prefer command-frequency behavior stay the same. Possibly, if 
user 
gives a optional arg, then it'll output the above richer info, and a separate 
command 
mode-frequency for frequency of modes.

Original comment by xah...@gmail.com on 15 Sep 2009 at 7:48

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
> but the command command-frequency itself should output the same data as 
before.

Yeah. I'm agree.

There is another big issue: What happen if you have two different instances of 
Emacs 
running and overwriting .emacs.frequencies file? This is a issue to solve.

Original comment by davidcapello on 17 Sep 2009 at 1:58

GoogleCodeExporter commented 9 years ago
some issues partially fixed in r199, by David Capello. Not tested yet (Xah Lee).

Original comment by xah...@gmail.com on 17 Sep 2009 at 9:54

GoogleCodeExporter commented 9 years ago

Original comment by davidcapello on 18 Sep 2009 at 2:12

GoogleCodeExporter commented 9 years ago

Original comment by davidcapello on 3 Oct 2009 at 2:36