From 84e3c91c5124ebbed52f5e2873c1bd48d3451028 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sun, 6 Mar 2022 22:16:46 +0100 Subject: [PATCH] [Emacs] Add function to remove junk files in conlanging org project --- org/config/emacs.org | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/org/config/emacs.org b/org/config/emacs.org index 6143da6..c6712e5 100644 --- a/org/config/emacs.org +++ b/org/config/emacs.org @@ -5148,6 +5148,26 @@ The project is then defined like so: "conlang-phundrak-com-pdf")) #+END_SRC +This project leaves a lot of junk files here and there. This is why I +have this command to remove them easily. +#+begin_src emacs-lisp +(defun phundrak/clean-conlanging-directory () + "Clean my conlanging directory from junk files." + (interactive) + (let ((files (directory-files-recursively phundrak//projects-conlanging-source + (rx (* print) + "." + (or "glo" + "html" + "ist" + "tex" + "pdf"))))) + (mapc (lambda (file) (delete-file file)) + (cl-remove-if (lambda (str) + (string-match-p (regexp-quote "headers.tex") str)) + files)))) +#+end_src + *** Org-ref and Bibtex configuration :PROPERTIES: :CUSTOM_ID: Packages-Configuration-Org-mode-org-ref-1h586cd085j0