summaryrefslogtreecommitdiff
path: root/helm.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2015-07-09 07:23:36 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2015-07-09 07:23:36 +0200
commit2ae34305061c2bb34197fc33eddc1970faf62bb8 (patch)
tree8cd04f2e3fd27dd56196b4a5019ae8a4efa430a7 /helm.el
parent9bad864c748fbdf14dda947cf90397859d823a89 (diff)
Move helm-file-completion-source-p to helm.el.
Diffstat (limited to 'helm.el')
-rw-r--r--helm.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/helm.el b/helm.el
index 295f76ab..79128eaa 100644
--- a/helm.el
+++ b/helm.el
@@ -880,6 +880,13 @@ precedence on :default.")
(defvar helm-truncate-lines nil
"[Internal] Don't set this globally, it is used as a local var.")
(defvar helm--prompt nil)
+(defvar helm--file-completion-sources
+ '("Find Files" "Read File Name" "Read File Name History"
+ "Files from Current Directory")
+ "Sources that use the *find-files mechanism can be added here.
+Sources generated by `helm-mode' don't need to be added here, it will
+be done automatically.
+You should not modify this yourself unless you know what you do.")
;; Utility: logging
@@ -4924,10 +4931,16 @@ Argument ACTION if present will be used as second argument of `display-buffer'."
(unless (helm-end-of-source-p)
(helm-next-line))))))
+(defun helm-file-completion-source-p ()
+ "Return non--nil if current source is a file completion source."
+ (or minibuffer-completing-file-name
+ (let ((cur-source (cdr (assoc 'name (helm-get-current-source)))))
+ (cl-loop for i in helm--file-completion-sources
+ thereis (string= cur-source i)))))
+
(defun helm-mark-all ()
"Mark all visible unmarked candidates in current source."
(interactive)
- (require 'helm-files)
(with-helm-window
(let ((nomark (assq 'nomark (helm-get-current-source)))
(follow (if helm-follow-mode 1 -1)))