Skip to content

Commit

Permalink
Fix building sources (#25).
Browse files Browse the repository at this point in the history
* helm-descbinds.el (helm-descbinds-source-template): Removed.
(helm-descbinds-source): helm-descbinds-source-template is no more
needed here, just build the source directly.
  • Loading branch information
Thierry Volpiatto committed Sep 16, 2016
1 parent 7771aa5 commit 2007f68
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions helm-descbinds.el
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,6 @@ This function will be called with two arguments KEY and BINDING."
"A list of section order by name regexp."
:type '(repeat (regexp :tag "Regexp")))

(defcustom helm-descbinds-source-template
`((candidate-transformer . helm-descbinds-transform-candidates)
(filtered-candidate-transformer . helm-fuzzy-highlight-matches)
(persistent-action . helm-descbinds-action:describe)
(action-transformer . helm-descbinds-action-transformer)
(action . ,helm-descbinds-actions))
"A template of `helm-descbinds' source."
:type 'sexp)

(defvar helm-descbinds-Orig-describe-bindings (symbol-function 'describe-bindings))
(defvar helm-descbind--initial-full-frame helm-full-frame)

Expand Down Expand Up @@ -245,9 +236,14 @@ Provide a useful behavior for prefix commands."
(helm-descbinds-order-section b))))))

(defun helm-descbinds-source (name candidates)
(append (helm-build-sync-source name
:candidates candidates)
helm-descbinds-source-template))
(when (and name candidates)
(helm-build-in-buffer-source name
:candidates candidates
:candidate-transformer #'helm-descbinds-transform-candidates
:filtered-candidate-transformer #'helm-fuzzy-highlight-matches
:persistent-action #'helm-descbinds-action:describe
:action-transformer #'helm-descbinds-action-transformer
:action 'helm-descbinds-actions)))

;;;###autoload
(defun helm-descbinds (&optional prefix buffer)
Expand Down

0 comments on commit 2007f68

Please sign in to comment.