diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2015-05-12 10:29:23 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2015-05-12 10:29:23 +0200 |
commit | dc170e15ab99154c1a79a32c35c6ee4bc62f4783 (patch) | |
tree | 9950b496304371730dc47f0f29ad5cffc396f01f /helm-man.el | |
parent | 6dfed2c94f79ffd5104cd86811735da4624d1de3 (diff) |
Simplify initialization of cache.
* helm-man.el: Don't use woman-file-name, but only
the needed functions to setup cache.
Diffstat (limited to 'helm-man.el')
-rw-r--r-- | helm-man.el | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/helm-man.el b/helm-man.el index 1b4c52c0..6ae05aba 100644 --- a/helm-man.el +++ b/helm-man.el @@ -21,9 +21,14 @@ (require 'helm) (defvar woman-topic-all-completions) +(defvar woman-manpath) +(defvar woman-path) +(defvar woman-expanded-directory-path) (declare-function woman-file-name "woman.el" (topic &optional re-cache)) (declare-function woman-file-name-all-completions "woman.el" (topic)) (declare-function Man-getpage-in-background "man.el" (topic)) +(declare-function woman-expand-directory-path "woman.el" (path-dirs path-regexps)) +(declare-function woman-topic-all-completions "woman.el" (path)) (declare-function helm-generic-sort-fn "helm-utils.el" (S1 S2)) (defgroup helm-man nil @@ -66,10 +71,12 @@ source.") (require 'woman) (require 'helm-utils) (unless helm-man--pages - (setq helm-man--pages - (progn - (woman-file-name "" t) - (mapcar 'car woman-topic-all-completions)))) + (setq woman-expanded-directory-path + (woman-expand-directory-path woman-manpath woman-path)) + (message "Building completion list of all manual topics...") + (setq woman-topic-all-completions + (woman-topic-all-completions woman-expanded-directory-path)) + (setq helm-man--pages (mapcar 'car woman-topic-all-completions))) (helm-init-candidates-in-buffer 'global helm-man--pages)) :persistent-action #'ignore :filtered-candidate-transformer |