unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Speck (Spell checker for Emacs)
@ 2015-04-17 22:55 Alexander Shukaev
  2015-04-18 11:10 ` tomas
  2015-04-18 15:19 ` Eli Zaretskii
  0 siblings, 2 replies; 25+ messages in thread
From: Alexander Shukaev @ 2015-04-17 22:55 UTC (permalink / raw)
  To: help-gnu-emacs

Greetings,

I've installed Speck recently, but could not get it to work unfortunately.
Would anybody who is using it be so kind to assist me with it?  I have the
following configuration:

(use-package speck
  :ensure
  :defer
  :commands
  (speck-mode)
  :init
  (setq speck-hunspell-program (executable-find "hunspell"))
  (setq speck-hunspell-coding-system (quote utf-8))
  (setq speck-hunspell-dictionary-alist
        (quote (("en" . "en_US")
                ("ru" . "ru_RU"))))
  (setq speck-hunspell-language-options
        (quote (("en" utf-8 nil nil nil)
                ("ru" utf-8 nil nil nil))))
  (setq speck-hunspell-default-dictionary-name "en")

  (add-hook 'text-mode-hook 'speck-mode)
  (add-hook 'prog-mode-hook 'speck-mode)
  :config)


In any buffer where Speck is enabled then, I see the following error:

Error running timer `speck-windows': (error "Process speck not running)


​Any ideas what could be done here?  Thank you.

Kind regards,
Alexander​


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-17 22:55 Alexander Shukaev
@ 2015-04-18 11:10 ` tomas
  2015-04-18 12:24   ` Alexander Shukaev
  2015-04-18 15:19 ` Eli Zaretskii
  1 sibling, 1 reply; 25+ messages in thread
From: tomas @ 2015-04-18 11:10 UTC (permalink / raw)
  To: Alexander Shukaev; +Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, Apr 18, 2015 at 12:55:41AM +0200, Alexander Shukaev wrote:
> Greetings,
> 
> I've installed Speck recently, but could not get it to work unfortunately.
> Would anybody who is using it be so kind to assist me with it?  I have the
> following configuration:

[...]

> Error running timer `speck-windows': (error "Process speck not running)
> 
> 
> Any ideas what could be done here?  Thank you.

Just a shot in the dark: do you have hunspell installed? (this is actually the
spell checker doing the heavy lifting behind the scenes). The error message
seems to hint in this direction.

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlUyO4oACgkQBcgs9XrR2kYSegCfXBuOVHzOd1tbpvYzct1xG4NU
kzEAn3DtwxKveckkq3lkOttRgHnEJXcm
=zs8q
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-18 11:10 ` tomas
@ 2015-04-18 12:24   ` Alexander Shukaev
  2015-04-18 13:15     ` tomas
  0 siblings, 1 reply; 25+ messages in thread
From: Alexander Shukaev @ 2015-04-18 12:24 UTC (permalink / raw)
  To: tomas; +Cc: help-gnu-emacs

>
> Just a shot in the dark: do you have hunspell installed? (this is actually
> the
> spell checker doing the heavy lifting behind the scenes). The error message
> seems to hint in this direction.
>

​Of course I have it installed.  I'm quite sure that if speck could not
find it, then it would report completely different error message.  This one
does not seem to be related.​


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-18 12:24   ` Alexander Shukaev
@ 2015-04-18 13:15     ` tomas
  2015-04-18 13:56       ` Alexander Shukaev
  0 siblings, 1 reply; 25+ messages in thread
From: tomas @ 2015-04-18 13:15 UTC (permalink / raw)
  To: Alexander Shukaev; +Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, Apr 18, 2015 at 02:24:49PM +0200, Alexander Shukaev wrote:
> >
> > Just a shot in the dark: do you have hunspell installed? (this is actually
> > the
> > spell checker doing the heavy lifting behind the scenes). The error message
> > seems to hint in this direction.
> >
> 
> Of course I have it installed.

Sorry: didn't want to ruffle your feathers. It was a shot in the dark,
after all. It's difficult to hit a target if one doesn't see it .-)

> I'm quite sure that if speck could not find it, then it would report
> completely different error message.
> This one does not seem to be related.

Probably. I've found the one "embedded" message:

> Error running timer `speck-windows': (error "Process speck not running)

The message "Process %s not running" might come from send_process, a (C)
function which tries to send stuff to a sub-process. It issues an error
message like this if this process is gone.

So your best bet now might be to try to find out whether Emacs actually
starts an external hunspell process and whether this process survives for
long enough to be useful.

How to do this depends of course on your operating system. BTW: the version
of Emacs (and of speck) you're using might help others help you.

HTH
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlUyWPUACgkQBcgs9XrR2kYqvwCfaTYF9PiCvuSF/YB0xDXTBUkQ
0a8Amwd9ph1A+Xpa5BvaIrDzDtPiu0kU
=V/IW
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-18 13:15     ` tomas
@ 2015-04-18 13:56       ` Alexander Shukaev
  2015-04-18 14:13         ` tomas
  0 siblings, 1 reply; 25+ messages in thread
From: Alexander Shukaev @ 2015-04-18 13:56 UTC (permalink / raw)
  To: tomas; +Cc: help-gnu-emacs

>
> Sorry: didn't want to ruffle your feathers. It was a shot in the dark,
> after all. It's difficult to hit a target if one doesn't see it .-)
>

​No worries ;)​


> So your best bet now might be to try to find out whether Emacs actually
> starts an external hunspell process and whether this process survives for
> long enough to be useful.
>

​I see...  Have to think about how to do it better.​

How to do this depends of course on your operating system. BTW: the version
> of Emacs (and of speck) you're using might help others help you.
>

​I'm on Windows, Emacs 25.0.50.1 (from MSYS2), Speck is the latest one
(2014.08.30).

Thank you,
Alexander​


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-18 13:56       ` Alexander Shukaev
@ 2015-04-18 14:13         ` tomas
  2015-04-18 14:46           ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: tomas @ 2015-04-18 14:13 UTC (permalink / raw)
  To: Alexander Shukaev; +Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, Apr 18, 2015 at 03:56:00PM +0200, Alexander Shukaev wrote:
> >
> > Sorry: didn't want to ruffle your feathers. It was a shot in the dark,
> > after all. It's difficult to hit a target if one doesn't see it .-)
> >
> 
> No worries ;)

OK :-)

> > So your best bet now might be to try to find out whether Emacs actually
> > starts an external hunspell process [...]

> I see...  Have to think about how to do it better.

[...]

> I'm on Windows, Emacs 25.0.50.1 (from MSYS2), Speck is the latest one
> (2014.08.30).

I can't help you with that very much: I'm a Windows analphabet and have
very little clue about process management there. Perhaps more knowledgeable
folks can chime in.

There's a chapter in the Emacs documentation dedicated to process management
under Windows: either locally in your Emacs installation, accessible with
C-h i, then Microsoft Winows > Windows Processes, or as HTML in the 'net:

https://www.gnu.org/software/emacs/manual/html_node/emacs/Windows-Processes.html#Windows-Processes

There is a way to list all processes Emacs "thinks" are running as its
sub-processes: M-x list-processes (M-x usually is Alt-x, depending on
your keyboard mapping).

hth
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlUyZpoACgkQBcgs9XrR2kYaoQCfeWn6ZqX0VDuAzBQSYhIK7GY0
sHQAnAmPl2hOlDbCTaRkrZ/Uh+8Gm/un
=yXhn
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-18 14:13         ` tomas
@ 2015-04-18 14:46           ` Eli Zaretskii
  0 siblings, 0 replies; 25+ messages in thread
From: Eli Zaretskii @ 2015-04-18 14:46 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sat, 18 Apr 2015 16:13:46 +0200
> From: tomas@tuxteam.de
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> There's a chapter in the Emacs documentation dedicated to process management
> under Windows: either locally in your Emacs installation, accessible with
> C-h i, then Microsoft Winows > Windows Processes, or as HTML in the 'net:
> 
> https://www.gnu.org/software/emacs/manual/html_node/emacs/Windows-Processes.html#Windows-Processes

That's largely irrelevant to the issue at hand: most of that node
talks about the peculiarities of running DOS programs from Emacs
running on Windows 9X.  I'm quite sure neither happens in this case.



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-17 22:55 Alexander Shukaev
  2015-04-18 11:10 ` tomas
@ 2015-04-18 15:19 ` Eli Zaretskii
  2015-04-18 16:16   ` Alexander Shukaev
  1 sibling, 1 reply; 25+ messages in thread
From: Eli Zaretskii @ 2015-04-18 15:19 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sat, 18 Apr 2015 00:55:41 +0200
> From: Alexander Shukaev <haroogan@gmail.com>
> 
> I've installed Speck recently, but could not get it to work unfortunately.
> Would anybody who is using it be so kind to assist me with it?

I'm not using it, but I downloaded it and took a look.

> I have the following configuration:
> 
> (use-package speck
>   :ensure
>   :defer
>   :commands
>   (speck-mode)
>   :init
>   (setq speck-hunspell-program (executable-find "hunspell"))
>   (setq speck-hunspell-coding-system (quote utf-8))
>   (setq speck-hunspell-dictionary-alist
>         (quote (("en" . "en_US")
>                 ("ru" . "ru_RU"))))
>   (setq speck-hunspell-language-options
>         (quote (("en" utf-8 nil nil nil)
>                 ("ru" utf-8 nil nil nil))))
>   (setq speck-hunspell-default-dictionary-name "en")
> 
>   (add-hook 'text-mode-hook 'speck-mode)
>   (add-hook 'prog-mode-hook 'speck-mode)
>   :config)
> 
> 
> In any buffer where Speck is enabled then, I see the following error:
> 
> Error running timer `speck-windows': (error "Process speck not running)
> 
> 
> ​Any ideas what could be done here?  Thank you.

It sounds like speck.el "needs work" to be able to work out of the box
with Hunspell.  The problem is this default:

  (defcustom speck-hunspell-library-directory (speck-hunspell-binary-directory)
    "Name of Hunspell library directory.
  This should specify the absolute name of the directory where the
  Hunspell dictionaries reside.  The default value is the directory where
  the Hunspell executable resides."

What it means is that speck.el will instruct Hunspell to look for
dictionaries in the same directory where the Hunspell executable
resides, which is never going to work with a "normal" installation of
Hunspell.

Customize that variable to point to share/hunspell subdirectory of the
directory where you installed Hunspell, and the package will start
working for you.




^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-18 15:19 ` Eli Zaretskii
@ 2015-04-18 16:16   ` Alexander Shukaev
  2015-04-18 16:33     ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: Alexander Shukaev @ 2015-04-18 16:16 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

>
> It sounds like speck.el "needs work" to be able to work out of the box
> with Hunspell.  The problem is this default:
>
>   (defcustom speck-hunspell-library-directory
> (speck-hunspell-binary-directory)
>     "Name of Hunspell library directory.
>   This should specify the absolute name of the directory where the
>   Hunspell dictionaries reside.  The default value is the directory where
>   the Hunspell executable resides."
>
> What it means is that speck.el will instruct Hunspell to look for
> dictionaries in the same directory where the Hunspell executable
> resides, which is never going to work with a "normal" installation of
> Hunspell.
>
> Customize that variable to point to share/hunspell subdirectory of the
> directory where you installed Hunspell, and the package will start
> working for you.
>

Thank you for looking into it.​

I've modified configuration in the following way:​

​  (setq speck-engine 'Hunspell)
  (setq speck-hunspell-program (executable-find "hunspell"))
  (setq speck-hunspell-coding-system 'utf-8)
  (setq speck-hunspell-language-options
        '(("en" utf-8 nil nil nil)))
  (setq speck-hunspell-library-directory
        (expand-file-name "share/hunspell"
                          (file-name-directory
                           (directory-file-name
                            (file-name-directory speck-hunspell-program)))))
  (setq speck-hunspell-default-dictionary-name "en")​

​and the error still remains...​

Regards,
Alexander


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-18 16:16   ` Alexander Shukaev
@ 2015-04-18 16:33     ` Eli Zaretskii
  2015-04-18 16:36       ` Alexander Shukaev
  0 siblings, 1 reply; 25+ messages in thread
From: Eli Zaretskii @ 2015-04-18 16:33 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sat, 18 Apr 2015 18:16:29 +0200
> From: Alexander Shukaev <haroogan@gmail.com>
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> (setq speck-hunspell-library-directory
> (expand-file-name "share/hunspell"
> (file-name-directory
> (directory-file-name
> (file-name-directory speck-hunspell-program)))))

Shouldn't that be "../share/hunspell" ?

Anyway, it worked for me once that variable pointed to the right
directory, so I'm quite sure this is culprit.



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-18 16:33     ` Eli Zaretskii
@ 2015-04-18 16:36       ` Alexander Shukaev
  2015-04-18 16:41         ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: Alexander Shukaev @ 2015-04-18 16:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

>
> > (setq speck-hunspell-library-directory
> > (expand-file-name "share/hunspell"
> > (file-name-directory
> > (directory-file-name
> > (file-name-directory speck-hunspell-program)))))
>
> Shouldn't that be "../share/hunspell" ?
>

​Those are equivalent.​


> Anyway, it worked for me once that variable pointed to the right
> directory, so I'm quite sure this is culprit.
>

​Weird.  That's all you did to configure it?​


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-18 16:36       ` Alexander Shukaev
@ 2015-04-18 16:41         ` Eli Zaretskii
  2015-04-18 16:56           ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: Eli Zaretskii @ 2015-04-18 16:41 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sat, 18 Apr 2015 18:36:35 +0200
> From: Alexander Shukaev <haroogan@gmail.com>
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
>     Anyway, it worked for me once that variable pointed to the right
>     directory, so I'm quite sure this is culprit.
> 
> ​Weird. That's all you did to configure it?​

Yes.  But I don't think I used some of your customizations,
e.g. these:

  (setq speck-hunspell-language-options
        (quote (("en" utf-8 nil nil nil)
                ("ru" utf-8 nil nil nil))))

Anyway, you don't need to rely on me, just step with Edebug through
speck-hunspell-start-process, and see how Hunspell is invoked.  Then
try the same from the shell prompt, and see if it works.




^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-18 16:41         ` Eli Zaretskii
@ 2015-04-18 16:56           ` Eli Zaretskii
  2015-04-18 17:20             ` Alexander Shukaev
  0 siblings, 1 reply; 25+ messages in thread
From: Eli Zaretskii @ 2015-04-18 16:56 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sat, 18 Apr 2015 19:41:15 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > Date: Sat, 18 Apr 2015 18:36:35 +0200
> > From: Alexander Shukaev <haroogan@gmail.com>
> > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> > 
> >     Anyway, it worked for me once that variable pointed to the right
> >     directory, so I'm quite sure this is culprit.
> > 
> > ​Weird. That's all you did to configure it?​
> 
> Yes.

Btw, I tried that in "emacs -Q"; did you?




^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-18 16:56           ` Eli Zaretskii
@ 2015-04-18 17:20             ` Alexander Shukaev
  2015-04-18 17:34               ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: Alexander Shukaev @ 2015-04-18 17:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

​It might sound weird, but here is where I've got so far.  First of all, it
was important to change

(expand-file-name "share/hunspell" ...


to

(expand-file-name "share/hunspell/" ...


​because in `speck-hunspell-start-process' it does a naive `concat' what
results in a wrong path to dictionary of course.

Secondly, even after that, it still reported the same error.  However, when
I `edebug-defun' the `speck-hunspell-start-process', then after exiting
debugger there are no more errors.  Even if I type `speck-mode', get into
debugger, and immediately `q' out of it, it works (i.e. no more errors) and
[en] is in green color in the mode line.  It smells like there is some sort
of concurrency issue here because when I enter debug, it's like I make
somebody to wait for something important to happen.  Accordingly, if I run
`speck-mode' without `speck-hunspell-start-process' being instrumented with
`edebug-defun', I get errors and [en] appears in another color.  So that
would be the first thing to investigate.

Lastly, when I said that it works I only meant that there are no more
errors and I see [en] in green color in the mode line, but nothing is
actually highlighted in the buffer, while clearly there are wrongly spelled
words.  When it works for you, does speck automatically highlight
misspelled words?  That would be the second thing to investigate.

Kind regards,
Alexander


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-18 17:20             ` Alexander Shukaev
@ 2015-04-18 17:34               ` Eli Zaretskii
  2015-04-18 19:44                 ` Alexander Shukaev
  0 siblings, 1 reply; 25+ messages in thread
From: Eli Zaretskii @ 2015-04-18 17:34 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sat, 18 Apr 2015 19:20:14 +0200
> From: Alexander Shukaev <haroogan@gmail.com>
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> ​It might sound weird, but here is where I've got so far. First of all, it was
> important to change
> 
>     (expand-file-name "share/hunspell" ...
> 
> to
> 
>     
>     (expand-file-name "share/hunspell/" ...

I did that without even thinking; it's always safe to have a trailing
slash.

> Secondly, even after that, it still reported the same error.

Not here, it didn't.

> Lastly, when I said that it works I only meant that there are no more errors
> and I see [en] in green color in the mode line, but nothing is actually
> highlighted in the buffer, while clearly there are wrongly spelled words. When
> it works for you, does speck automatically highlight misspelled words?

Of course.  How else would I know it "worked"?

Anyway, here's the full recipe that works for me in Emacs 24.5:

 . emacs -Q

 . Insert this into *scratch*:

   (setq speck-hunspell-program (executable-find "hunspell"))
   (setq speck-hunspell-coding-system (quote utf-8))
   (setq speck-hunspell-dictionary-alist
	 (quote (("en" . "en_US")
		 ("ru" . "ru_RU"))))
   (setq speck-hunspell-default-dictionary-name "en")

 . Mark all of the above and type "M-x eval-region RET"

 . Type "M-x set-variable RET speck-hunspell-library-directory RET"
   and type the correct directory, with the trailing slash, in quotes,
   at the prompt.

 . M-x speck-mode RET

Now type some mis-spelled word followed by a blank, and wait for a
second: the mis-spelled word will be marked with a red underline.




^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-18 17:34               ` Eli Zaretskii
@ 2015-04-18 19:44                 ` Alexander Shukaev
  2015-04-18 20:22                   ` Alexander Shukaev
  0 siblings, 1 reply; 25+ messages in thread
From: Alexander Shukaev @ 2015-04-18 19:44 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

>
> Anyway, here's the full recipe that works for me in Emacs 24.5:
>
>  . emacs -Q
>
>  . Insert this into *scratch*:
>
>    (setq speck-hunspell-program (executable-find "hunspell"))
>    (setq speck-hunspell-coding-system (quote utf-8))
>    (setq speck-hunspell-dictionary-alist
>          (quote (("en" . "en_US")
>                  ("ru" . "ru_RU"))))
>    (setq speck-hunspell-default-dictionary-name "en")
>
>  . Mark all of the above and type "M-x eval-region RET"
>
>  . Type "M-x set-variable RET speck-hunspell-library-directory RET"
>    and type the correct directory, with the trailing slash, in quotes,
>    at the prompt.
>
>  . M-x speck-mode RET
>
> Now type some mis-spelled word followed by a blank, and wait for a
> second: the mis-spelled word will be marked with a red underline.
>

​Yep, same problem, errors about process​

​not running.  Sigh...​


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-18 19:44                 ` Alexander Shukaev
@ 2015-04-18 20:22                   ` Alexander Shukaev
  0 siblings, 0 replies; 25+ messages in thread
From: Alexander Shukaev @ 2015-04-18 20:22 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

​Alright, I think I've nailed it.  The important bit was to

(setq speck-hunspell-library-directory "")

​
Quite unexpected, isn't it?  The reason is that if you run manually

hunspell -a -d "<absolute-path>/share/hunspell/en_US-large" -B


​it reports error:

Can't open affix or dictionary files for dictionary named "
> ​
> <absolute-path>/share/hunspell/en_US-large".
> ​
>

​There are only 2 ways to supply the dictionary properly, either:

​hunspell -a -d "en_US-large" -B​


or

hunspell -a -d "../share/hunspell/en_US-large" -B


I'm not sure whether this is related to MSYS2 Hunspell or applies in
general, but anyway that means we should configure it as follows:

(setq speck-hunspell-library-directory "")


or

(setq speck-hunspell-library-directory "../share/hunspell/")


However, the 2nd variant will not work due to

Setting current directory: permission denied, ../share/hunspell/


As a result, the only variant is

(setq speck-hunspell-library-directory "")


and as soon as I do it, it finally works just fine!

Here is the complete configuration:

(setq speck-engine 'Hunspell
      speck-hunspell-program (executable-find "hunspell")
      speck-hunspell-library-directory
      (if (eq system-type 'windows-nt)
          ""
        (expand-file-name "share/hunspell/"
                          (file-name-directory
                            (directory-file-name
                            (file-name-directory speck-hunspell-program)))))
      speck-hunspell-default-dictionary-name "en"
      speck-hunspell-dictionary-alist '(("en" . "en_US-large"))
      speck-hunspell-language-options '(("en" utf-8 nil nil))
      speck-hunspell-coding-system 'utf-8)


Thanks to Tomas and especially Eli for assistance.  Hope this helps
somebody in future.

Kind regards,
Alexander


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
@ 2015-04-21 10:34 martin rudalics
  2015-04-21 12:18 ` Alexander Shukaev
                   ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: martin rudalics @ 2015-04-21 10:34 UTC (permalink / raw)
  To: haroogan; +Cc: help-gnu-emacs

 > It sounds like speck.el "needs work" to be able to work out of the box
 > with Hunspell.  The problem is this default:
 >
 >   (defcustom speck-hunspell-library-directory (speck-hunspell-binary-directory)
 >     "Name of Hunspell library directory.
 >   This should specify the absolute name of the directory where the
 >   Hunspell dictionaries reside.  The default value is the directory where
 >   the Hunspell executable resides."
 >
 > What it means is that speck.el will instruct Hunspell to look for
 > dictionaries in the same directory where the Hunspell executable
 > resides, which is never going to work with a "normal" installation of
 > Hunspell.

Initially, speck was written without Hunspell support.  I added it as
soon as the first executables for Windows appeared (that was quite some
time before any other Emacs Spell Checker was able to talk to Hunspell).
The customization variables are still from that early period, there was
no "normal" installation procedure at that time IIRC.  Moreover, I never
upgraded my spell engines since then.  So probably support is missing or
incorrect in this area.

 > As a result, the only variant is
 >
 > (setq speck-hunspell-library-directory "")

I faintly remember Xah Lee spending hours on setting up Hunspell for
Windows until he gave up.  Maybe that was the reason.

martin



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-21 10:34 Speck (Spell checker for Emacs) martin rudalics
@ 2015-04-21 12:18 ` Alexander Shukaev
  2015-04-21 15:19   ` Eli Zaretskii
  2015-04-22  9:33   ` martin rudalics
       [not found] ` <mailman.1265.1429618691.904.help-gnu-emacs@gnu.org>
  2015-04-21 15:10 ` Eli Zaretskii
  2 siblings, 2 replies; 25+ messages in thread
From: Alexander Shukaev @ 2015-04-21 12:18 UTC (permalink / raw)
  To: martin rudalics; +Cc: help-gnu-emacs

>
> Initially, speck was written without Hunspell support.  I added it as
> soon as the first executables for Windows appeared (that was quite some
> time before any other Emacs Spell Checker was able to talk to Hunspell).
> The customization variables are still from that early period, there was
> no "normal" installation procedure at that time IIRC.  Moreover, I never
> upgraded my spell engines since then.  So probably support is missing or
> incorrect in this area.


​What I wonder is why Speck is not so popular, it seems not so many people
use it or even know about it.  What do others use for spell checking?
Flyspell?  Personally, I have to admit that my experiences with Flyspell
are terrible as it is extremely slow and continuously stutters Emacs.  Even
`flyspell-lazy' does not help.  On the other hand, Speck seems to be
working truly (or almost truly) asynchronously and therefore I experience
no stutters or slowdowns.

By the way, do you have any recipe to teach Speck to spell check only text
in TeX files (i.e. skip commands)?

Regards,
Alexander


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
       [not found] ` <mailman.1265.1429618691.904.help-gnu-emacs@gnu.org>
@ 2015-04-21 12:57   ` Sebastien Vauban
  0 siblings, 0 replies; 25+ messages in thread
From: Sebastien Vauban @ 2015-04-21 12:57 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

Alexander Shukaev wrote:
>>
>> Initially, speck was written without Hunspell support.  I added it as
>> soon as the first executables for Windows appeared (that was quite some
>> time before any other Emacs Spell Checker was able to talk to Hunspell).
>> The customization variables are still from that early period, there was
>> no "normal" installation procedure at that time IIRC.  Moreover, I never
>> upgraded my spell engines since then.  So probably support is missing or
>> incorrect in this area.
>
>
> ​What I wonder is why Speck is not so popular, it seems not so many people
> use it or even know about it.  What do others use for spell checking?
> Flyspell?  Personally, I have to admit that my experiences with Flyspell
> are terrible as it is extremely slow and continuously stutters Emacs.  Even
> `flyspell-lazy' does not help.  On the other hand, Speck seems to be
> working truly (or almost truly) asynchronously and therefore I experience
> no stutters or slowdowns.

Speaking for myself (truism ;-)), I use flyspell when typing and I don't
experience any slowdown.

Of course, changing the language will take some time, depending on the
buffer length. Changing the language to FR. Back to English!

Demo: http://screencast.com/t/u3Y3XjBR7s.

Another reason for me to use Flyspell was its availability on Windows as
well, and Speck seemed complex to correctly tune when I looked at it,
but that (or I) may have changed...

Best regards,
  Seb

-- 
Sebastien Vauban


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-21 10:34 Speck (Spell checker for Emacs) martin rudalics
  2015-04-21 12:18 ` Alexander Shukaev
       [not found] ` <mailman.1265.1429618691.904.help-gnu-emacs@gnu.org>
@ 2015-04-21 15:10 ` Eli Zaretskii
  2 siblings, 0 replies; 25+ messages in thread
From: Eli Zaretskii @ 2015-04-21 15:10 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Tue, 21 Apr 2015 12:34:06 +0200
> From: martin rudalics <rudalics@gmx.at>
> Cc: help-gnu-emacs@gnu.org
> 
> Initially, speck was written without Hunspell support.  I added it as
> soon as the first executables for Windows appeared (that was quite some
> time before any other Emacs Spell Checker was able to talk to Hunspell).
> The customization variables are still from that early period, there was
> no "normal" installation procedure at that time IIRC.  Moreover, I never
> upgraded my spell engines since then.  So probably support is missing or
> incorrect in this area.

FWIW, when I was reading the Hunspell-related parts of Speck, I found
myself wondering time and again why its invocation is so complicated.
You don't really need to tell it where its dictionaries are, because
it already knows where to find them: that's what a correct
installation guarantees.

Likewise with encoding: you should use UTF-8 throughout, as that's the
native encoding for Hunspell; anything else it will need to convert.

Finally, Speck should really learn from ispell.el how to set up most
or all of the variables by asking Hunspell itself, instead of asking
the user to figure out how to do that by hand.

> I faintly remember Xah Lee spending hours on setting up Hunspell for
> Windows until he gave up.  Maybe that was the reason.

Upstream Hunspell is buggy, even today, and the Windows build is even
more so.  It needs non-trivial patches to work correctly.  (E.g., I
believe it still produces byte offsets instead of character offsets,
which won't work in Emacs with UTF-8 encoding.)  I suspect that people
who "gave up" on Hunspell simply used one of those "compile and
forget" Windows ports of Hunspell, made by people who never test their
ported binaries before they make them available for download.

Hunspell which has its bugs fixed and works correctly doesn't need any
setup with ispell.el/flyspell.el, and only a bit more so with Speck.



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-21 12:18 ` Alexander Shukaev
@ 2015-04-21 15:19   ` Eli Zaretskii
  2015-04-21 15:26     ` Alexander Shukaev
  2015-04-22  9:33   ` martin rudalics
  1 sibling, 1 reply; 25+ messages in thread
From: Eli Zaretskii @ 2015-04-21 15:19 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Tue, 21 Apr 2015 14:18:03 +0200
> From: Alexander Shukaev <haroogan@gmail.com>
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> ​What I wonder is why Speck is not so popular, it seems not so many people
> use it or even know about it.

I can tell you my reasons: because it's not bundled, and as result
suffers from being not quite up-to-date with the latest developments
in the modern spellers (see my previous message).

> What do others use for spell checking?  Flyspell?

Yes.

> Personally, I have to admit that my experiences with Flyspell
> are terrible as it is extremely slow and continuously stutters
> Emacs.

Try customizing flyspell-duplicate-distance to a small value, perhaps
even to zero.  I have found this minor and easy-to-give-up-on feature
to be one major reason for slowdown.

> Even `flyspell-lazy' does not help.  On the other hand, Speck seems
> to be working truly (or almost truly) asynchronously and therefore I
> experience no stutters or slowdowns.

But what Speck does has its downsides as well: if you are a fast
typist, you can be quite a few words after the mis-spelled one, before
the timer fires and the mistake is marked as such.  By contrast,
Flyspell shows the mistake immediately after the word is finished, so
you can easily correct/retype it.  TANSTAAFL.

> By the way, do you have any recipe to teach Speck to spell check only text
> in TeX files (i.e. skip commands)?

Another thing that "just works" with ispell.el and Flyspell.




^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-21 15:19   ` Eli Zaretskii
@ 2015-04-21 15:26     ` Alexander Shukaev
  0 siblings, 0 replies; 25+ messages in thread
From: Alexander Shukaev @ 2015-04-21 15:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

>
> > ​What I wonder is why Speck is not so popular, it seems not so many
> people
> > use it or even know about it.
>
> I can tell you my reasons: because it's not bundled, and as result
> suffers from being not quite up-to-date with the latest developments
> in the modern spellers (see my previous message).
>
> > What do others use for spell checking?  Flyspell?
>
> Yes.
>
> > Personally, I have to admit that my experiences with Flyspell
> > are terrible as it is extremely slow and continuously stutters
> > Emacs.
>
> Try customizing flyspell-duplicate-distance to a small value, perhaps
> even to zero.  I have found this minor and easy-to-give-up-on feature
> to be one major reason for slowdown.
>
> > Even `flyspell-lazy' does not help.  On the other hand, Speck seems
> > to be working truly (or almost truly) asynchronously and therefore I
> > experience no stutters or slowdowns.
>
> But what Speck does has its downsides as well: if you are a fast
> typist, you can be quite a few words after the mis-spelled one, before
> the timer fires and the mistake is marked as such.  By contrast,
> Flyspell shows the mistake immediately after the word is finished, so
> you can easily correct/retype it.  TANSTAAFL.
>
> > By the way, do you have any recipe to teach Speck to spell check only
> text
> > in TeX files (i.e. skip commands)?
>
> Another thing that "just works" with ispell.el and Flyspell.
>

​Thanks for these hints, Eli.  I'll definitely give it one more shot.​


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-21 12:18 ` Alexander Shukaev
  2015-04-21 15:19   ` Eli Zaretskii
@ 2015-04-22  9:33   ` martin rudalics
  2015-04-22 10:50     ` Alexander Shukaev
  1 sibling, 1 reply; 25+ messages in thread
From: martin rudalics @ 2015-04-22  9:33 UTC (permalink / raw)
  To: Alexander Shukaev; +Cc: help-gnu-emacs

 > By the way, do you have any recipe to teach Speck to spell check only text
 > in TeX files (i.e. skip commands)?

Try `speck-face-inhibit-list'.  Since speck works only on displayed
text, adding to that list the corresponding face assigned by font-lock
should work (conceptually).

martin



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: Speck (Spell checker for Emacs)
  2015-04-22  9:33   ` martin rudalics
@ 2015-04-22 10:50     ` Alexander Shukaev
  0 siblings, 0 replies; 25+ messages in thread
From: Alexander Shukaev @ 2015-04-22 10:50 UTC (permalink / raw)
  To: martin rudalics; +Cc: help-gnu-emacs

>
> Try `speck-face-inhibit-list'.  Since speck works only on displayed
> text, adding to that list the corresponding face assigned by font-lock
> should work (conceptually).


​Thank you, Martin, that worked perfectly!

Kind regards,
Alexander​


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2015-04-22 10:50 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-21 10:34 Speck (Spell checker for Emacs) martin rudalics
2015-04-21 12:18 ` Alexander Shukaev
2015-04-21 15:19   ` Eli Zaretskii
2015-04-21 15:26     ` Alexander Shukaev
2015-04-22  9:33   ` martin rudalics
2015-04-22 10:50     ` Alexander Shukaev
     [not found] ` <mailman.1265.1429618691.904.help-gnu-emacs@gnu.org>
2015-04-21 12:57   ` Sebastien Vauban
2015-04-21 15:10 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2015-04-17 22:55 Alexander Shukaev
2015-04-18 11:10 ` tomas
2015-04-18 12:24   ` Alexander Shukaev
2015-04-18 13:15     ` tomas
2015-04-18 13:56       ` Alexander Shukaev
2015-04-18 14:13         ` tomas
2015-04-18 14:46           ` Eli Zaretskii
2015-04-18 15:19 ` Eli Zaretskii
2015-04-18 16:16   ` Alexander Shukaev
2015-04-18 16:33     ` Eli Zaretskii
2015-04-18 16:36       ` Alexander Shukaev
2015-04-18 16:41         ` Eli Zaretskii
2015-04-18 16:56           ` Eli Zaretskii
2015-04-18 17:20             ` Alexander Shukaev
2015-04-18 17:34               ` Eli Zaretskii
2015-04-18 19:44                 ` Alexander Shukaev
2015-04-18 20:22                   ` Alexander Shukaev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).