unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Michael Slass <miknrene@drizzle.com>
Subject: Re: capturing commands
Date: Thu, 17 Oct 2002 01:43:46 GMT	[thread overview]
Message-ID: <m3it01on17.fsf@localhost.localdomain> (raw)
In-Reply-To: aokvek$kib$1@solaria.cc.gatech.edu

merik <merik@cc.gatech.edu> writes:

>Have a Pan Galactic Gargleblaster and read Michael Slass's shiznit
>
>> Barry Margolin <barmar@genuity.net> writes:
><snip, some stuff that i'm thankful for>
>
>I'm a n00b here so I wanted to know how I can could actually implement 
>this becuase i've seen the view-lossage and was hoping to use the 
>open-dribble-file but I don't know how.

M-x open-dribble-file RET
then type the file name when prompted.

That will save all your keystrokes to your file.



If you want to save the names of all your commands to a file, try
adding this to your .emacs

(defvar emacs-command-log
        (find-file "~/my-emacs-commands"))

(defun log-last-command ()
  (save-excursion
    (let ((com (prin1-to-string last-command))
          (deactivate-mark nil))
      (set-buffer emacs-command-log)
      (goto-char (point-max))
      (insert "\n" com))))

(add-hook 'post-command-hook 'log-last-command)


This will fill a file in your home directory called
"my-emacs-commands" with a list of all the commands you run.  You can
look at the list by switching to the my-emacs-commands buffer.  Emacs
will ask you if you want to save the file each time you quit.

You will find the vast majority of these will be self-insert-command,
which is what's ordinarily run when you hit a key which produces a
printing character.

NB -

0) This is very lightly tested, so use at your own risk

1) The my-emacs-commands file will grow WITHOUT BOUNDS, so truncate it
   now and again.

2) this will degrade your emacs performance since all the code in
   log-last-command must run each time you do anything.  When you've
   got the info you want, delete (or comment out) the above code.


-- 
Mike Slass

  reply	other threads:[~2002-10-17  1:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-16 22:08 capturing commands merik
2002-10-16 22:22 ` Barry Margolin
2002-10-16 23:14   ` Michael Slass
2002-10-17  0:15     ` merik
2002-10-17  1:43       ` Michael Slass [this message]
2002-10-18  3:29         ` Artist
2002-10-18  7:40           ` Bernd Wolter
2002-10-18 16:28             ` Clemens Fischer
2002-10-17 15:03 ` D. Goel
2002-10-18 18:03   ` kgold
2002-10-18 19:31     ` D. Goel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3it01on17.fsf@localhost.localdomain \
    --to=miknrene@drizzle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).