From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: How to successively log stuff to a file? Date: Tue, 04 Feb 2014 13:36:05 +0100 Message-ID: <87wqhb5a2y.fsf@rosalinde.fritz.box> References: <87wqhbaho3.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1391517386 5385 80.91.229.3 (4 Feb 2014 12:36:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Feb 2014 12:36:26 +0000 (UTC) Cc: emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 04 13:36:33 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WAfEp-00044F-L9 for ged-emacs-devel@m.gmane.org; Tue, 04 Feb 2014 13:36:27 +0100 Original-Received: from localhost ([::1]:52108 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAfEp-00045x-7x for ged-emacs-devel@m.gmane.org; Tue, 04 Feb 2014 07:36:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAfEf-00045n-2B for emacs-devel@gnu.org; Tue, 04 Feb 2014 07:36:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAfEX-0005JN-OC for emacs-devel@gnu.org; Tue, 04 Feb 2014 07:36:17 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:57914) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAfEX-0005JF-EV for emacs-devel@gnu.org; Tue, 04 Feb 2014 07:36:09 -0500 Original-Received: from rosalinde.fritz.box ([89.245.104.193]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0Lkwpt-1VchSU0Z89-00aphx for ; Tue, 04 Feb 2014 13:36:07 +0100 In-Reply-To: <87wqhbaho3.fsf@web.de> (Michael Heerdegen's message of "Tue, 04 Feb 2014 00:41:00 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Provags-ID: V03:K0:YLNvaR9CDw48S0LxIj/y9ieeUZvZyNIz2PQRntScDD6k5J8aqZa 19OiX8AnoQebhjeEI5aJMyKipChsLsxFUrYnzenef3tYOqS8pp+BxEtzHfwYz8DnDnaxSVr ZiX8EsiTqvd35oBQW33TkHAHf8zMahtR5dl9tBwdb5rq6RtRsR9kPKRyDCIZCEbu+pOaApE slvELQs8YvGHnZr/C9TrQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.17.21 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:169383 Archived-At: On Tue, 04 Feb 2014 00:41:00 +0100 Michael Heerdegen wrote: > Hello, > > I have written a little library for logging stuff, i.e. hit keys and > executed commands, messages, and file loads [1]. > > I want that you can define a dribble file where all my logged output > would be written to. That would be a good help to reconstruct what you > did before a crash, or for writing bug reports (Yes, I know about > `open-dribble-file', but it's in C). > > What is the smartest way to do that (in LISP, of course)? > > I could save the buffer content to a file regularly. To have a complete > log after crashes, I would have to save the buffer after each > keystroke. This seems very dumb. > > There is also `write-region'. But that prints a message in the echo > area after each call, i.e. in my case, after each hit key. You can suppress the message: write-region is an interactive built-in function in `C source code'. (write-region START END FILENAME &optional APPEND VISIT LOCKNAME MUSTBENEW) Write current region into specified file. [...] If VISIT is neither t nor nil nor a string, that means do not display the "Wrote file" message. Steve Berman