Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In Emacs 24 at least (I can't check a prior version right now), the docstring for <code>view-lossage</code> states:</p> <blockquote> <p>Display last 300 input keystrokes.</p> <p>To record all your input on a file, use `open-dribble-file'.</p> </blockquote> <p>And <kbd>C-h</kbd><kbd>f</kbd> <code>open-dribble-file</code> <kbd>RET</kbd> tells me:</p> <blockquote> <p>open-dribble-file is an interactive built-in function in `C source code'.</p> <p>(open-dribble-file FILE)</p> <p>Start writing all keyboard characters to a dribble file called FILE. If FILE is nil, close any open dribble file. The file will be closed when Emacs exits.</p> </blockquote> <p>So simply add something like the following to your .emacs file:</p> <pre class="lang-lisp prettyprint-override"><code>(open-dribble-file (expand-file-name "~/.emacs.d/lossage.txt")) </code></pre> <p>Experimentally this clobbers the file if it already exists, so you'll need to deal with that.</p> <p>Here's one approach. It accounts for multiple Emacs sessions by using <code>make-temp-name</code> to generate a semi-random filename for the dribble file, and then appends the contents of that to a primary lossage log file when Emacs exists. (If Emacs crashes, it would leave behind the temp file for you to deal with manually.)</p> <pre class="lang-el prettyprint-override"><code>(defmacro my-persistent-dribble-file (file) "Append the dribble-file for this session to persistent lossage log FILE." `(let* ((persistent-file (expand-file-name ,file)) (temporary-file (make-temp-name (concat persistent-file "-"))) (persistent-arg (shell-quote-argument persistent-file)) (temporary-arg (shell-quote-argument temporary-file)) (append-dribble-command (format "cat %s &gt;&gt;%s &amp;&amp; rm %s" temporary-arg persistent-arg temporary-arg))) (open-dribble-file temporary-file) (eval `(add-hook 'kill-emacs-hook (lambda () (shell-command ,append-dribble-command)))))) (my-persistent-dribble-file "~/.emacs.d/lossage") </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload