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.
This commit is contained in:
Daniel - 2021-08-21 09:51:54 +02:00
parent a3fd8f77b2
commit 106f286285
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
1 changed files with 2 additions and 2 deletions

View File

@ -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))))