Skip to content

Commit

Permalink
Merge branch 'vspinu-format'
Browse files Browse the repository at this point in the history
  • Loading branch information
areina committed Sep 7, 2015
2 parents a52e26f + 9e6aa63 commit 8c84587
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions helm-dash.el
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
(require 'helm-multi-match)
(require 'json)
(require 'xml)
(require 'format-spec)

(defgroup helm-dash nil
"Search Dash docsets using helm."
Expand Down Expand Up @@ -67,6 +68,14 @@ path. You can use `expand-file-name' function for that."
of docsets are active. Between 0 and 3 is sane."
:group 'helm-dash)

(defcustom helm-dash-candidate-format "%d %n (%t)"
"Format of the displayed candidates.
Available formats are
%d - docset name
%n - name of the token
%t - type of the token"
:group 'helm-dash)

(defcustom helm-dash-enable-debugging t
"When non-nil capture stderr from sql commands and display in a
buffer. Setting this to nil may speed up querys."
Expand Down Expand Up @@ -375,8 +384,16 @@ Ex: This avoids searching for redis in redis unless you type 'redis redis'"
docset-type
(helm-dash-sub-docset-name-in-pattern helm-pattern (car docset))))))

(defun helm-dash--candidate (docset x)
(cons (format "%s %s" (car docset) (cadr x)) (list (car docset) x)))
(defun helm-dash--candidate (docset row)
"Return a list extracting info from DOCSET and ROW to build a helm candidate.
First element is the display message of the candidate, rest is used to build
candidate opts."
(message (format "%s" docset))
(cons (format-spec helm-dash-candidate-format
(list (cons ?d (car docset))
(cons ?n (cadr row))
(cons ?t (car row))))
(list (car docset) row)))

(defun helm-dash-result-url (docset-name filename &optional anchor)
"Return the full, absolute URL to documentation: either a file:// URL joining
Expand Down

0 comments on commit 8c84587

Please sign in to comment.