d12frosted / flyspell-correct

Distraction-free words correction with flyspell via selected interface.
Other
203 stars 14 forks source link

Package should not depend on installation order #11

Closed d12frosted closed 8 years ago

d12frosted commented 8 years ago

Recently I introduced pretty controversial change in https://github.com/d12frosted/flyspell-correct/commit/40bdd2f817b018685cb39bcbaf961717f1acf074.

It's just a quick workaround and I am looking into proper solution.

In short, flyspell-correct must be byte compiled after helm. In some setups there is no way to force specific order of package installation. So flyspell-correct ends up in situation where helm-build-sync-source is nil. So you have to recompile flyspell-correct in order to fix runtime error.

The proper way of solving such issues is setting helm dependency in 'Package Requires' block. But flyspell-correct doesn't know which package will be used by user. So it's pretty lame to depend on all possible packages (ivy, helm and popup).

One solution would be to divide this package into 4 different - one base package flyspell-correct-generic and three other depending on generic package - flyspell-correct-ivy, flyspell-correct-helm and flyspell-correct-popup. It's very likely that I'll do so, but I would like to hear more on available solutions (if any).

kaushalmodi commented 8 years ago

Try asking this on help-gnu-emacs@gnu.org.

manuel-uberti commented 8 years ago

Could it be related to this warning (from Helm's README)?

WARNING: Helm upgrades from MELPA repository encountered errors because of the way package.el fetched and compiled updates for existing packages. To get around these errors, Helm adds Async as a dependency package install. Async forces compilation in a clean environment, which solves those compilation errors. Since async has other benefits as well, both for Helm and other packages, we recommend installing async even for Helm installs using git. See FAQ for details.

Just asking, because I have no issues using Ivy.

d12frosted commented 8 years ago

Ok, I've asked on help-gnu-emacs@gnu.org, cause I don't see any other solutions.

As per async package. I don't quite understand how to use it. And I am not sure that it would solve my problem. But I'll take a closer look soon.

d12frosted commented 8 years ago

I've divided this package to several of them. Now waiting for them to be available on MELPA.

d12frosted commented 8 years ago

P. S. I hope this would be the only breaking change.

manuel-uberti commented 8 years ago

Thanks for the solution. It might be breaking, but I'm happy to have only what's needed for Ivy. :)

d12frosted commented 8 years ago

It's already part of MELPA.

manuel-uberti commented 8 years ago

Thanks, it works like a charm:

(use-package flyspell-correct-ivy           ; Better interface for corrections
  :ensure t
  :after flyspell
  :bind (:map flyspell-mode-map
              ("C-c $" . flyspell-correct-word-generic)))
d12frosted commented 8 years ago

Great! You could also try flyspell-correct-previous-word-generic (#13).