diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2015-05-12 13:43:48 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2015-05-12 13:43:48 +0200 |
commit | 398e63485f4fc25ff4393223b58d2e6cf9258f8f (patch) | |
tree | 7cba5063b623fdee6edffa8f03bea5271f4f50d2 /helm-man.el | |
parent | dc170e15ab99154c1a79a32c35c6ee4bc62f4783 (diff) |
Make init function for man.
* helm-man.el (helm-man--init): New.
Diffstat (limited to 'helm-man.el')
-rw-r--r-- | helm-man.el | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/helm-man.el b/helm-man.el index 6ae05aba..cc6baa75 100644 --- a/helm-man.el +++ b/helm-man.el @@ -65,19 +65,20 @@ source.") (error (kill-buffer) ; Kill woman buffer. (Man-getpage-in-background candidate))))) +(defun helm-man--init () + (require 'woman) + (require 'helm-utils) + (unless helm-man--pages + (setq woman-expanded-directory-path + (woman-expand-directory-path woman-manpath woman-path)) + (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)) + (defvar helm-source-man-pages (helm-build-in-buffer-source "Manual Pages" - :init (lambda () - (require 'woman) - (require 'helm-utils) - (unless helm-man--pages - (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)) + :init #'helm-man--init :persistent-action #'ignore :filtered-candidate-transformer (lambda (candidates _source) |