From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Michael Slass Newsgroups: gmane.emacs.help Subject: Re: capturing commands Date: Thu, 17 Oct 2002 01:43:46 GMT Organization: AT&T Broadband Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035015834 2992 80.91.224.249 (19 Oct 2002 08:23:54 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 19 Oct 2002 08:23:54 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 182otk-0000m8-00 for ; Sat, 19 Oct 2002 10:23:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 182Zei-0005Wl-00; Fri, 18 Oct 2002 12:07:20 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn13feed!wn11feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!sccrnsc03.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-Lines: 58 Original-NNTP-Posting-Host: 12.228.27.239 Original-X-Complaints-To: abuse@attbi.com Original-X-Trace: sccrnsc03 1034819026 12.228.27.239 (Thu, 17 Oct 2002 01:43:46 GMT) Original-NNTP-Posting-Date: Thu, 17 Oct 2002 01:43:46 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:106135 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2742 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2742 merik writes: >Have a Pan Galactic Gargleblaster and read Michael Slass's shiznit > >> Barry Margolin writes: > > >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