dash-docs icon indicating copy to clipboard operation
dash-docs copied to clipboard

Update usage documentation

Open TsarFox opened this issue 4 years ago • 7 comments
trafficstars

With the "Rust" docset installed, (dash-docs--run-query "Rust" "String::new") errors with Wrong type argument: listp, "Rust", and (dash-docs-search "String::new") returns nil. When I edebug dash-docs-search, (dash-docs-maybe-narrow-docsets pattern) returns nil, which seems to cause the search to exit early. This seems to be because there are no open "database connections".

TsarFox avatar Dec 16 '20 20:12 TsarFox

I'm not getting anything back from any docset either. Did you get anywhere here?

       (use-package
         dash-docs
         ;;:custom
         ;;(dash-docs-browser-func 'eww-readable-url)
         :config
         (setq dash-docs-common-docsets '("C++" "Emacs Lisp" "Docker"))
         (setq dash-docs-docsets '("C++" "Emacs Lisp" "Docker"))
         (defun my-dash (w)
           (interactive (cons (symbol-or-region-at-point-as-string-or-prompt) nil))
           (message "docsets are: %s" dash-docs-docsets)
           (message "%s" (dash-docs-search w)))
         :bind ("C-c d" . 'my-dash))

rileyrg avatar Jan 15 '21 14:01 rileyrg

No, sadly. I have begun writing my own Emacs interface to dasht. Perhaps I will publish the package to MELPA when it is done.

TsarFox avatar Jan 17 '21 19:01 TsarFox

Jakob writes:

No, sadly. I have begun writing my own Emacs interface to dasht. Perhaps I will publish the package to MELPA when it is done.

that would be great. I removed the helm interface, but now can't get anything.

rileyrg avatar Jan 17 '21 20:01 rileyrg

I'm not sure how you're trying to use it, but (dash-docs--run-query "Rust" "String::new") is not going to work, as the first parameter is not expected to be a string.

(dash-docs-search "String::new") will return a list with all the results for the active docsets.

The public methods are helm-dash and helm-dash-at-point (and the equivalents for ivy)

kidd avatar Jan 18 '21 09:01 kidd

Raimon Grau writes:

I'm not sure how you're trying to use it, but (dash-docs--run-query "Rust" "String::new") is not going to work, as the first parameter is not expected to be a string.

(dash-docs-search "String::new") will return a list with all the results for the active docsets.

The public methods are helm-dash and helm-dash-at-point (and the equivalents for ivy)

Im not using helm. I tred dash-docs-search and assumed that would integrate with minuibuffer candidate selection/filtering, Maybe I expected too much. Appreciate your reply, I'll clean it out and start afresh,

rileyrg avatar Jan 18 '21 10:01 rileyrg

our story with the completion systems is a bit weird... we started supporting only helm, and then ivy. but there's no direct support for basic completing-read (I think).

If you want plain completing-read support, I think (dash-docs-search "String::new") is a good starting point. To narrow the docsets to only one, probably wrapping in a let, overwritting them to the docset you want. (It's been a while since I touched this code, so I might be wrong on some of what I just wrote :p )

kidd avatar Jan 18 '21 12:01 kidd

My apologies; the two frontends to this package do indeed work. Though I believe the "Usage" section of the README should be updated accordingly. That is how I came up with the examples in my initial report.

TsarFox avatar Jan 27 '21 14:01 TsarFox