unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Problems with ispell/flyspell
@ 2005-12-21 22:11 Stefan Monnier
  2005-12-22  0:00 ` Agustin Martin
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2005-12-21 22:11 UTC (permalink / raw)



I recently started to get problems with flyspell that seem to be due to
ispell.el.  Basically, the main symptom is that flyspell doesn't do anything
(none of the incorrect spellings are highlighted).
Most likely the problem is caused by the second problem below (because the
error is signalled while running flyspell-post-command-hook and it thus
causes post-command-hook to be set to nil).

- when I start flyspell-mode, I tend to get an error of the form:

   "Error: no word lists can be found for the language fr_CH"

  this error is raised in ispell-init-process by
  (error "%s" (mapconcat 'identity ispell-filter "\n"))

- later on, while using flyspell, I get errors of the form
  "wrong-argument-type, string, nil" because
  in ispell-find-aspell-dictionaries, (assoc "en" ispell-dictionary-alist)
  has returned nil, which caused ispell-dictionary-alist to have an entry of
  the form (nil), so when ispell-current-dictionary is nil,
  (ispell-get-decoded-string 1) returns nil, so ispell-get-casechars returns
  nil, so flyspell-get-casechars returns nil, so flyspell-get-word
  does a (looking-at nil) which signals an error.

This is on a machine where I have both ispell and aspell installed
(as I just discovered), in case it matters.

~-0% ispell -v
@(#) International Ispell Version 3.1.20 10/10/95, patch 1
...
~-0% aspell -v
@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.4)
~-0% 

All this is somewhat mostly reproducible, tho it doesn't seem to be
100% deterministic.


        Stefan

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

* Re: Problems with ispell/flyspell
  2005-12-21 22:11 Problems with ispell/flyspell Stefan Monnier
@ 2005-12-22  0:00 ` Agustin Martin
  2005-12-22  1:43   ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Agustin Martin @ 2005-12-22  0:00 UTC (permalink / raw)


On Wed, Dec 21, 2005 at 05:11:54PM -0500, Stefan Monnier wrote:
> - when I start flyspell-mode, I tend to get an error of the form:
> 
>    "Error: no word lists can be found for the language fr_CH"

My first impression is that you are using aspell and fr_CH locale
and did not explicitely select any dict (and have no aspell
fr_CH dict available). What happens if you explicitely select
a dict by means of ispell-change-dictionary?

> - later on, while using flyspell, I get errors of the form
>   "wrong-argument-type, string, nil" because
>   in ispell-find-aspell-dictionaries, (assoc "en" ispell-dictionary-alist)
>   has returned nil, which caused ispell-dictionary-alist to have an entry of
>   the form (nil), so when ispell-current-dictionary is nil,
>   (ispell-get-decoded-string 1) returns nil, so ispell-get-casechars returns
>   nil, so flyspell-get-casechars returns nil, so flyspell-get-word
>   does a (looking-at nil) which signals an error.

and also have no aspell english dict installed. Probably a reasonable
fallback should be added for default in case an english dict is not
available. Does the problem persist if you have an aspell english dict
installed?

> This is on a machine where I have both ispell and aspell installed
> (as I just discovered), in case it matters.

Which one is the surprise? Note that for emacs-cvs ispell.el, if aspell
is installed it is the default, even if it has no dictionaries available
for the desired language. You will need to explicitely set
ispell-program-name to ispell if you want it.

Hope this helps

-- 
Agustin

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

* Re: Problems with ispell/flyspell
  2005-12-22  0:00 ` Agustin Martin
@ 2005-12-22  1:43   ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2005-12-22  1:43 UTC (permalink / raw)
  Cc: emacs-devel

> On Wed, Dec 21, 2005 at 05:11:54PM -0500, Stefan Monnier wrote:
>> - when I start flyspell-mode, I tend to get an error of the form:
>> 
>> "Error: no word lists can be found for the language fr_CH"

> My first impression is that you are using aspell and fr_CH locale
> and did not explicitely select any dict (and have no aspell
> fr_CH dict available). What happens if you explicitely select
> a dict by means of ispell-change-dictionary?

Usually nothing, probably because post-command-hook has already been set
to nil.

>> - later on, while using flyspell, I get errors of the form
>> "wrong-argument-type, string, nil" because
>> in ispell-find-aspell-dictionaries, (assoc "en" ispell-dictionary-alist)
>> has returned nil, which caused ispell-dictionary-alist to have an entry of
>> the form (nil), so when ispell-current-dictionary is nil,
>> (ispell-get-decoded-string 1) returns nil, so ispell-get-casechars returns
>> nil, so flyspell-get-casechars returns nil, so flyspell-get-word
>> does a (looking-at nil) which signals an error.

> and also have no aspell english dict installed. Probably a reasonable
> fallback should be added for default in case an english dict is not
> available.  Does the problem persist if you have an aspell english dict
> installed?

No, that fixed it.  So it seems the problem showed up because Debian split
the English dict into a separate package which `apt-get upgrade'
didn't install.

But, yes, there should be a better fallback in case there's no English
dictionary.  An option maybe is to just use the fallback that's already
there: the first entry in ispell-dictionary-alist-1.

>> This is on a machine where I have both ispell and aspell installed
>> (as I just discovered), in case it matters.
> Which one is the surprise?

Neither: the surprise is that *both* are installed.


        Stefan

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

end of thread, other threads:[~2005-12-22  1:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-21 22:11 Problems with ispell/flyspell Stefan Monnier
2005-12-22  0:00 ` Agustin Martin
2005-12-22  1:43   ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).