emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ispell.el does not recover well after wrong aspell dict selection [patch


From: Agustin Martin
Subject: ispell.el does not recover well after wrong aspell dict selection [patch]
Date: Wed, 8 Feb 2006 12:03:00 +0100
User-agent: Mutt/1.5.11+cvs20060126

Hi,

I am noticing a problem arising when aspell is used as ispell-program-name
and a non existent dict is selected. After issuing an spellchecking command
and getting the error message, is no longer possible to change dictionary.

E.g., if english aspell dict is not present and I try to spellcheck

-----------------------------------------------------------------
any

Local Variables:
ispell-local-dictionary: "american"
End:
-----------------------------------------------------------------

M-x ispell-word
  Starting new Ispell process [american] ...
  ispell-init-process: Error: The file "/usr/lib/aspell/american" can not be
  opened for reading.
M-x ispell-change-dictionary francais
  Starting new Ispell process [american] ...
  ispell-init-process: Error: The file "/usr/lib/aspell/american" can not be
  opened for reading.

Dict is no changed. The reason for this is that in
(ispell-change-dictionary) function (ispell-accept-buffer-local-defs) is
called before dict is changed. That function calls
(ispell-buffer-local-words) that tries to start a new ispell process with
the old (wrong) dict value, producing the error, because dict is not yet
changed, and so remains unchanged.

Since seems that the only reason to call (ispell-accept-buffer-local-defs)
is to get ispell-local-dictionary value if present in 'Local Variables',
calling (ispell-buffer-local-dict) instead, as in attached patch, should
work.

(ispell-change-dictionary)
Call ispell-buffer-local-dict instead of ispell-accept-buffer-local-defs

-- 
Agustin

Attachment: ispell.el.use-ispell-buffer-local-dict.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]