summaryrefslogtreecommitdiff
path: root/helm-man.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2013-09-16 08:36:24 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2013-09-16 08:36:24 +0200
commit18afad0409f32831cdbf7906b58db2088edc02b5 (patch)
tree00c470224ad8ff168d6566dc5f28c31c6451c083 /helm-man.el
parentd8fb1153704ba0b7852c2ed8e10b1bcca65de261 (diff)
* helm-man.el (helm-man-default-action): Issue #285 Fix using completion for man files and man.
Diffstat (limited to 'helm-man.el')
-rw-r--r--helm-man.el32
1 files changed, 16 insertions, 16 deletions
diff --git a/helm-man.el b/helm-man.el
index f202e79b..4ca476ff 100644
--- a/helm-man.el
+++ b/helm-man.el
@@ -43,20 +43,20 @@ source.")
(defun helm-man-default-action (candidate)
"Default action for jumping to a woman or man page from helm."
- (if (eq helm-man-or-woman-function 'Man-getpage-in-background)
- (funcall helm-man-or-woman-function candidate)
- (let ((wfiles (mapcar
- 'car (woman-file-name-all-completions candidate))))
- (condition-case err
- (if (> (length wfiles) 1)
- (woman-find-file
- (helm-comp-read
- "ManFile: " wfiles :must-match t))
- (woman candidate))
- ;; If woman is unable to format correctly
- ;; use man instead.
- (error (kill-buffer) ; Kill woman buffer.
- (Man-getpage-in-background candidate))))))
+ (let ((wfiles (mapcar
+ 'car (woman-file-name-all-completions candidate))))
+ (condition-case err
+ (if (> (length wfiles) 1)
+ (let ((file (helm-comp-read
+ "ManFile: " wfiles :must-match t)))
+ (if (eq helm-man-or-woman-function 'Man-getpage-in-background)
+ (manual-entry (format "-l %s" file))
+ (woman-find-file file)))
+ (funcall helm-man-or-woman-function candidate))
+ ;; If woman is unable to format correctly
+ ;; use man instead.
+ (error (kill-buffer) ; Kill woman buffer.
+ (Man-getpage-in-background candidate)))))
(defvar helm-source-man-pages
'((name . "Manual Pages")
@@ -74,12 +74,12 @@ source.")
(filtered-candidate-transformer
. (lambda (candidates source)
(sort candidates #'helm-generic-sort-fn)))
- (action . (("Show with Woman" . helm-man-default-action)))
+ (action . (("Display Man page" . helm-man-default-action)))
;; Woman does not work OS X
;; http://xahlee.org/emacs/modernization_man_page.html
(action-transformer . (lambda (actions candidate)
(if (eq system-type 'darwin)
- '(("Show with Man" . man))
+ '(("Display Man page" . man))
actions)))))
;;;###autoload