emacs/var/elfeed/db/data/ce/ced59c010da691ccd4b0e3110d6e412339a31077
2022-01-03 12:49:32 -06:00

4 lines
1.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>John D. Cook who, among other things, publishes the <a href="https://twitter.com/TeXtip">TeX Tips</a> Twitter feed, is an Emacs user and has a useful tip for <a href="https://www.johndcook.com/blog/2021/12/12/deleting-files-in-dired/">cleaning up “garbage files”</a>. Garbage files are intermediate files that can easily be regenerated. Examples are the <code>.log</code> and <code>.aux</code> files generated by TeX and LaTeX.</p>
<p>The secret is to type <kbd>%</kbd> <kbd>&amp;</kbd> in Dired. It will mark the garbage files for deletion that can subsequently be deleted by typing <kbd>x</kbd>. This being Emacs, what constitutes a “garbage file” is, of course, configurable. The <kbd>%</kbd> <kbd>&amp;</kbd> invokes <code>dired-flag-garbage-files</code> which flags files that match the regular expression in <code>dired-garbage-files-regexp</code>.</p>
<p>I vaguely remember this and I think I even wrote about it some time in the past. The problem is that if you dont use it a lot, its hard to rediscover. It is, in fact, on the <a href="https://www.gnu.org/software/emacs/refcards/pdf/dired-ref.pdf">Dired Reference Card</a> but the explanation is “flag various intermediate files”, which is technically correct but doesnt suggest what its really used for.</p>
<p>In any event, its good to be reminded of it especially if you use LaTeX or some other application that generates intermediate files that you dont want to save. Its also another reason to learn and use Dired if you arent already.</p>