From f2012e51e393d89cd3a49d2eeabc38f41876bb6d Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Wed, 30 Oct 2024 08:23:10 -0400 Subject: add emacsconf-delete-from-all --- emacsconf.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'emacsconf.el') diff --git a/emacsconf.el b/emacsconf.el index 1e9ddcf..551031c 100644 --- a/emacsconf.el +++ b/emacsconf.el @@ -1876,5 +1876,19 @@ tracks with the ID in the cdr of that list." (concat "ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 " (shell-quote-argument (expand-file-name filename))))))) +(defun emacsconf-delete-from-all (files) + "Delete FILES from all the directories." + (interactive (list (dired-get-marked-files))) + (dolist (dir (list emacsconf-cache-dir emacsconf-backstage-dir + (expand-file-name "cache" emacsconf-res-dir) + emacsconf-public-media-directory)) + (dolist (file files) + (when (and dir (file-exists-p (expand-file-name (file-name-nondirectory file) + dir))) + (delete-file (expand-file-name (file-name-nondirectory file) + dir)) + (message "Deleting %s from %s" + (file-name-nondirectory file) dir))))) + (provide 'emacsconf) ;;; emacsconf.el ends here -- cgit v1.2.3