From 106f286285660597846656b494d7249e3b08bead Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 21 Aug 2021 09:51:54 +0200 Subject: [PATCH] Include symlinks in custom file listings, even if they are dangling When listing files, it's not relevant whether the file is readable or whether a symbolic link points to a non-existing file. What matters is that the file itself exists, either as a file or as a symbolic link. This is relevant when using `git annex find` to list files matching some search criteria. --- site-lisp/db-utils.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site-lisp/db-utils.el b/site-lisp/db-utils.el index 3137133..c6d6957 100644 --- a/site-lisp/db-utils.el +++ b/site-lisp/db-utils.el @@ -354,8 +354,8 @@ output, separated by \\n, when called with (list-of-files (cl-remove-if-not (lambda (entry) (and (not (string-empty-p entry)) - (file-exists-p entry) - (file-readable-p entry))) + (or (file-exists-p entry) + (file-symlink-p entry)))) (split-string (shell-command-to-string command) "\n")))) (dired (cons "Command output" list-of-files))))