From a1f0acfd87d817fe5b2dd979bdac3540ae1f13b9 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Tue, 24 Aug 2021 10:18:36 +0200 Subject: [PATCH] Add custom function to list git-annex files via dired This can already be done by using `db/dired-from-shell-command`, but it's more convenient to have a specific command for this. --- site-lisp/db-utils.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/site-lisp/db-utils.el b/site-lisp/db-utils.el index dd4178a..d4a86b6 100644 --- a/site-lisp/db-utils.el +++ b/site-lisp/db-utils.el @@ -362,6 +362,16 @@ output, separated by \\n, when called with (message "No files return by command “%s”" command) (dired (cons "Command output" list-of-files))))) +(defun db/dired-from-git-annex (matching-options) + "Display files found by git annex with MATCHING-OPTIONS. +This runs “git annex find” with MATCHING-OPTIONS (a string) in +`default-directory' and displays the resulting set of files using +`dired'." + (interactive (list (read-string (format "Matching Options (in %s): " + default-directory)))) + (db/dired-from-shell-command (format "git annex find . %s" matching-options) + default-directory)) + (defun db/system-open (path) "Open PATH with default program as defined by the underlying system." (cond