branch: externals/xeft commit 24ddfefc307037a0dc418c9bc3d80cc1e0b450f9 Author: Yuan Fu <caso...@gmail.com> Commit: Yuan Fu <caso...@gmail.com>
Allow following symlinks when recursively listing files (issue#6) * xeft.el (xeft-recursive): Add a new possible value 'follow-symlinks'. (xeft--file-list): Follow symlinks if xeft-recursive is 'follow-symlinks'. --- xeft.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/xeft.el b/xeft.el index e083302176..b5f126925e 100644 --- a/xeft.el +++ b/xeft.el @@ -219,12 +219,16 @@ point at the beginning of body text (ie, end of title)." Xeft doesn’t follow symlinks and ignores inaccessible directories. Customize ‘xeft-directory-filter’ to exclude -subdirectories. +subdirectories. Set this variable to ‘follow-symlinks’ to follow +symlinks, note that this might lead to infinite recursion. Changing this variable along doesn’t remove already-indexed files from the database, you need to delete the database on disk and let xeft recreate it." - :type 'boolean) + :type '(choice (const :tag "No" nil) + (const :tag "Yes" t) + (const :tag "Yes, and follow symlinks" + follow-symlinks ))) (defcustom xeft-file-list-function #'xeft--file-list "A function that returns files that xeft should search from. @@ -732,7 +736,8 @@ files and directories and check for ‘xeft-ignore-extension’." xeft-file-filter (if xeft-recursive (directory-files-recursively - xeft-directory "" nil xeft-directory-filter) + xeft-directory "" nil xeft-directory-filter + (eq xeft-recursive 'follow-symlinks)) (directory-files xeft-directory t nil t))))