Function: open-dribble-file
open-dribble-file is an interactive function defined in keyboard.c.
Signature
(open-dribble-file FILE)
Documentation
Start writing input events to a dribble file called FILE.
Any previously open dribble file will be closed first. If FILE is nil, just close the dribble file, if any.
If the file is still open when Emacs exits, it will be closed then.
The events written to the file include keyboard and mouse input events, but not events from executing keyboard macros. The events are written to the dribble file immediately without line buffering.
Be aware that this records ALL characters you type! This may include sensitive information such as passwords.
Probably introduced at or before Emacs version 16.
Key Bindings
Source Code
// Defined in /usr/src/emacs/src/keyboard.c
{
if (dribble)
{
block_input ();
emacs_fclose (dribble);
unblock_input ();
dribble = 0;
}
if (!NILP (file))
{
int fd;
Lisp_Object encfile;
file = Fexpand_file_name (file, Qnil);
encfile = ENCODE_FILE (file);
fd = emacs_open (SSDATA (encfile), O_WRONLY | O_CREAT | O_EXCL, 0600);
if (fd < 0 && errno == EEXIST
&& (emacs_unlink (SSDATA (encfile)) == 0 || errno == ENOENT))
fd = emacs_open (SSDATA (encfile), O_WRONLY | O_CREAT | O_EXCL, 0600);
dribble = fd < 0 ? 0 : emacs_fdopen (fd, "w");
if (dribble == 0)
report_file_error ("Opening dribble", file);
}
return Qnil;
}