From 4f9231f413318cd733efe22b13fa41a0708bcccb Mon Sep 17 00:00:00 2001 From: "Jakob L. Kreuze" Date: Sat, 9 Feb 2019 19:20:36 -0500 Subject: Rename package --- README.md | 14 +++++------ dired-rmjunk.el | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ dired-rmshit.el | 73 --------------------------------------------------------- 3 files changed, 80 insertions(+), 80 deletions(-) create mode 100644 dired-rmjunk.el delete mode 100644 dired-rmshit.el diff --git a/README.md b/README.md index 3055635..93b03de 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# dired-rmshit +# dired-rmjunk -dired-rmshit is a port of Jakub Klinkovský's rmshit.py to Dired. The interactive -function, `dired-rmshit` will mark all files in the current Dired buffer that -match one of the patterns specified in `dired-rmshit-shitty-files`. The tool is -intended as a simple means for keeping one's home directory tidy -- removing -"junk" dotfiles. +dired-rmjunk is a port of Jakub Klinkovský's home directory cleanup tool to +Dired. The interactive function, `dired-rmjunk` will mark all files in the +current Dired buffer that match one of the patterns specified in +`dired-rmjunk-shitty-files`. The tool is intended as a simple means for keeping +one's home directory tidy -- removing "junk" dotfiles. -The original implementation of rmshit.py can be found at: +The script that this is based on can be found at: diff --git a/dired-rmjunk.el b/dired-rmjunk.el new file mode 100644 index 0000000..b0fe04d --- /dev/null +++ b/dired-rmjunk.el @@ -0,0 +1,73 @@ +;;; dired-rmjunk.el --- A home directory cleanup utility for Dired. -*- lexical-binding: t; -*- + +;; Copyright (C) 2019 Jakob L. Kreuze + +;; Author: Jakob L. Kreuze +;; Version: 1.0 +;; Package-Requires (dired) +;; Keywords: files matching +;; URL: https://git.sr.ht/~jakob/dired-rmjunk + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; dired-rmjunk is a port of Jakub Klinkovský's home directory cleanup tool to +;; Dired. The interactive function, `dired-rmjunk' will mark all files in the +;; current Dired buffer that match one of the patterns specified in +;; `dired-rmjunk-shitty-files'. The tool is intended as a simple means for +;; keeping one's home directory tidy -- removing "junk" dotfiles. + +;; The script that this is based on can be found at: +;; + +;;; Code: + +(defgroup dired-rmjunk () + "Remove shitty files with dired." + :group 'dired) + +(defcustom dired-rmjunk-shitty-files + '(".adobe" ".macromedia" ".recently-used" + ".local/share/recently-used.xbel" "Desktop" ".thumbnails" ".gconfd" + ".gconf" ".local/share/gegl-0.2" ".FRD/log/app.log" ".FRD/links.txt" + ".objectdb" ".gstreamer-0.10" ".pulse" ".esd_auth" ".config/enchant" + ".spicec" ".dropbox-dist" ".parallel" ".dbus" "ca2" "ca2~" + ".distlib" ".bazaar" ".bzr.log" ".nv" ".viminfo" ".npm" ".java" + ".oracle_jre_usage" ".jssc" ".tox" ".pylint.d" ".qute_test" + ".QtWebEngineProcess" ".qutebrowser" ".asy" ".cmake" ".gnome" + "unison.log" ".texlive" ".w3m" ".subversion" "nvvp_workspace") + "Default list of files to remove. Current as of f707d92." + :type '(list string)) + +;;;###autoload +(defun dired-rmjunk () + "Mark all shitty files in the current dired buffer. +'Shitty' is defined to be any file with a name matching one of +the patterns in `dired-rmjunk-shitty-files'." + (interactive) + (when (eq major-mode 'dired-mode) + (save-excursion + (let ((files-marked-count 0)) + (dolist (file (directory-files dired-directory)) + (when (member file dired-rmjunk-shitty-files) + (setq files-marked-count (1+ files-marked-count)) + (dired-goto-file (concat (expand-file-name dired-directory) file)) + (dired-flag-file-deletion 1))) + (message (if (zerop files-marked-count) + "No shitty files found :)" + "Shitty files marked.")))))) + +(provide 'dired-rmjunk) +;;; dired-rmjunk.el ends here diff --git a/dired-rmshit.el b/dired-rmshit.el deleted file mode 100644 index 6acf412..0000000 --- a/dired-rmshit.el +++ /dev/null @@ -1,73 +0,0 @@ -;;; dired-rmshit.el --- A port of Jakub Klinkovský's rmshit.py to Dired. -*- lexical-binding: t; -*- - -;; Copyright (C) 2019 Jakob L. Kreuze - -;; Author: Jakob L. Kreuze -;; Version: 1.0 -;; Package-Requires (dired) -;; Keywords: files matching -;; URL: https://git.sr.ht/~jakob/dired-rmshit - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; dired-rmshit is a port of Jakub Klinkovský's rmshit.py to Dired. The -;; interactive function, `dired-rmshit' will mark all files in the -;; current Dired buffer that match one of the patterns specified in -;; `dired-rmshit-shitty-files'. The tool is intended as a simple means -;; for keeping one's home directory tidy -- removing "junk" dotfiles. - -;; The original implementation of rmshit.py can be found at: -;; - -;;; Code: - -(defgroup dired-rmshit () - "Remove shitty files with dired." - :group 'dired) - -(defcustom dired-rmshit-shitty-files - '(".adobe" ".macromedia" ".recently-used" - ".local/share/recently-used.xbel" "Desktop" ".thumbnails" ".gconfd" - ".gconf" ".local/share/gegl-0.2" ".FRD/log/app.log" ".FRD/links.txt" - ".objectdb" ".gstreamer-0.10" ".pulse" ".esd_auth" ".config/enchant" - ".spicec" ".dropbox-dist" ".parallel" ".dbus" "ca2" "ca2~" - ".distlib" ".bazaar" ".bzr.log" ".nv" ".viminfo" ".npm" ".java" - ".oracle_jre_usage" ".jssc" ".tox" ".pylint.d" ".qute_test" - ".QtWebEngineProcess" ".qutebrowser" ".asy" ".cmake" ".gnome" - "unison.log" ".texlive" ".w3m" ".subversion" "nvvp_workspace") - "Default list of files to remove. Current as of f707d92." - :type '(list string)) - -;;;###autoload -(defun dired-rmshit () - "Mark all shitty files in the current dired buffer. -'Shitty' is defined to be any file with a name matching one of -the patterns in `dired-rmshit-shitty-files'." - (interactive) - (when (eq major-mode 'dired-mode) - (save-excursion - (let ((files-marked-count 0)) - (dolist (file (directory-files dired-directory)) - (when (member file dired-rmshit-shitty-files) - (setq files-marked-count (1+ files-marked-count)) - (dired-goto-file (concat (expand-file-name dired-directory) file)) - (dired-flag-file-deletion 1))) - (message (if (zerop files-marked-count) - "No shitty files found :)" - "Shitty files marked.")))))) - -(provide 'dired-rmshit) -;;; dired-rmshit.el ends here -- cgit v1.3