tmalsburg / guess-language.el

Emacs minor mode that detects the language you're typing in. Automatically switches spell checker. Supports multiple languages per document.
115 stars 14 forks source link

defcustom to set the trigrams path #18

Closed humitos closed 7 years ago

humitos commented 7 years ago

I added a new defcustom to be able to customize the trigrams directory. By default, it uses the one where the library is installed.

Let me know any comment, please.

Thank you!

tmalsburg commented 7 years ago

Hi, thanks for the PR. Can I ask why you need this feature?

humitos commented 7 years ago

Yeah. Maybe it's very specific to my own (strange) configuration. I don't know, but I will explain it here so you can decide what to do.

My setup is like this (~/.emacs.d):

...
├── startup.d
│   ├── 01git-gutter.el
│   ├── 02flyspell.el.disabled
│   ├── 99material-theme.el
│   ├── ace-jump-mode.el
│   ├── any-ini-mode.el
│   ├── auto-complete.el.disabled
...
...
├── packages
│   ├── ace-jump-mode.el -> ../vendor/ace-jump-mode/ace-jump-mode.el
│   ├── ace-jump-mode.elc
│   ├── any-ini-mode.el -> ../vendor/any-ini-mode/any-ini-mode.el
│   ├── any-ini-mode.elc
│   ├── apiwrap.el -> ../vendor/apiwrap.el/apiwrap.el
│   ├── apiwrap.elc
│   ├── async.el -> ../vendor/emacs-async/async.el
│   ├── async.elc
│   ├── autopair.el -> ../vendor/autopair/autopair.el
│   ├── autopair.elc
│   ├── avy.el -> ../vendor/avy/avy.el
│   ├── avy.elc
│   ├── browse-at-remote.el -> ../vendor/browse-at-remote/browse-at-remote.el
│   ├── browse-at-remote.elc
...
...
└── vendor
    ├── ace-jump-mode
    ├── any-ini-mode
    ├── apiwrap.el
    ├── autopair
    ├── avy
    ├── browse-at-remote
    ├── buftra.el
    ├── company-mode
...
...

So, as this plugins is looking for trigrams folder at the same path that the .el file, it fails. Two solutions:

  1. create a symlink to trigrams also from packages
  2. allow the plugin to configure the path of trigrams

As I thought that this should be something configurable because this same issue could affect other people, I wrote the PR.

Now, you know the background and can judge by yourself :)

tmalsburg commented 7 years ago

Sure, we can add this. Thanks for the PR.

humitos commented 7 years ago

Thank you so much. I appreciate it :)