diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2016-06-02 17:02:04 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2016-06-02 17:02:04 +0200 |
commit | e52a46f1b44094ced1a4b9644a13a3052a77f68d (patch) | |
tree | 06f4bc05c86ee777700bee8aec894d1e2b32fd82 /helm-locate.el | |
parent | a66a2aee249d54c8a786e0bcb7f3d027c0718331 (diff) |
Move part of recursive dirs code to locate.
Diffstat (limited to 'helm-locate.el')
-rw-r--r-- | helm-locate.el | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/helm-locate.el b/helm-locate.el index 03289d60..206deb46 100644 --- a/helm-locate.el +++ b/helm-locate.el @@ -97,6 +97,11 @@ directories of this list with `helm-projects-find-files'." :group 'helm-locate :type '(repeat string)) +(defcustom helm-locate-recursive-dirs-command "locate -i -e -A --regex ^%s %s.*$" + "Command used in recursive directories completion in `helm-find-files'." + :type 'string + :group 'helm-files) + (defvar helm-generic-files-map (let ((map (make-sparse-keymap))) @@ -348,6 +353,26 @@ See also `helm-locate'." else do (funcall pfn db p) and collect db))) +;;; Directory completion for hff. +;; +(defclass helm-locate-subdirs-source (helm-source-in-buffer) + ((basedir :initarg :basedir + :initform nil + :custom string) + (subdir :initarg :subdir + :initform nil + :custom 'string) + (data :initform #'helm-locate-init-subdirs))) + +(defun helm-locate-init-subdirs () + (with-temp-buffer + (call-process-shell-command + (format helm-locate-recursive-dirs-command + (helm-attr 'basedir) + (helm-attr 'subdir)) + nil t nil) + (buffer-string))) + ;;;###autoload (defun helm-projects-find-files (update) "Find files with locate in `helm-locate-project-list'. |