branch: externals/xeft
commit 951db71170edd77c42a0054f9e24840a13168a4a
Author: Yuan Fu <caso...@gmail.com>
Commit: Yuan Fu <caso...@gmail.com>

    Fix default-extension format and add a recursive option
    
    * xeft.el (xeft-default-extension):
    (xeft-filename-fn):
    (xeft-recursive):
    (xeft--file-list):
---
 xeft.el | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/xeft.el b/xeft.el
index 58fa6c76c3..5c1ded008a 100644
--- a/xeft.el
+++ b/xeft.el
@@ -67,13 +67,13 @@
   '((t . (:inherit highlight :extend t)))
   "Face for highlighting in the preview buffer.")
 
-(defcustom xeft-default-extension ".txt"
-  "The default extension for new files created by xeft.."
+(defcustom xeft-default-extension "txt"
+  "The default extension for new files created by xeft."
   :type 'string)
 
 (defcustom xeft-filename-fn
   (lambda (search-phrase)
-    (concat search-phrase xeft-default-extension))
+    (concat search-phrase "." xeft-default-extension))
   "A function that takes the search phrase and returns a filename."
   :type 'function)
 
@@ -85,6 +85,11 @@ indexed in the database, simply delete the database and start
 xeft again."
   :type '(list string))
 
+(defcustom xeft-recursive nil
+  "If non-nil, xeft searches for file recursively.
+Xeft doesn’t follow symlinks and ignores inaccessible directories."
+  :type 'boolean)
+
 ;;; Compile
 
 (defun xeft--compile-module ()
@@ -420,7 +425,9 @@ search phrase the user typed."
                 "." (file-name-base file)))
           (not (member (file-name-extension file)
                        xeft-ignore-extension))))
-   (directory-files xeft-directory t nil t)))
+   (if xeft-recursive
+       (directory-files-recursively xeft-directory "" nil t)
+     (directory-files xeft-directory t nil t))))
 
 (defvar-local xeft--need-refresh t
   "If change is made to the buffer, set this to t.

Reply via email to