Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As of today, they are docsets named for example Ruby_on_Rails_4 or Ruby_on_Rails_5 that contains a top level directory in their archived named "Ruby on Rails". This causes multiple problems.
When using helm-dash-ensure-package-installed, helm-dash checks for Ruby_on_Rails_4 in the docsets path but it does not find it as it is named after the top directory in the archive, "Ruby on Rails".
It's not possible to install both Ruby_on_Rails_4 and Ruby_on_Rails_5 docsets.
To fix this, this pull requests refactors the code for helm-dash-install-docset and helm-dash-async-install-docset to share more codes by making the synchronous function call the asynchronous function. To simplify the asynchronous function, macros are used as they are expanded at compile time and so can be used in the async-start lambda. With this in place, the install function is made to strip the top level directory of a docset tarball and install in a directory named after the original docset name. The helm-dash-docset-installedp function is updated to check for the right name.
The helm-dash-ensure-docset-installed function is also changed to use the asynchronous install method to avoid blocking the Emacs initialization process.