diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2015-07-09 07:23:36 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2015-07-09 07:23:36 +0200 |
commit | 2ae34305061c2bb34197fc33eddc1970faf62bb8 (patch) | |
tree | 8cd04f2e3fd27dd56196b4a5019ae8a4efa430a7 /helm.el | |
parent | 9bad864c748fbdf14dda947cf90397859d823a89 (diff) |
Move helm-file-completion-source-p to helm.el.
Diffstat (limited to 'helm.el')
-rw-r--r-- | helm.el | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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))) |