emacs-devel
[Top][All Lists]
Advanced

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

{ispell,flyspell}.el and coexistence of ispell and aspell


From: Agustin Martin
Subject: {ispell,flyspell}.el and coexistence of ispell and aspell
Date: Thu, 28 Sep 2006 12:06:13 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Hi,

I have been playing with a rather unusual process, having ispell and aspell
dict for the same language and using the ispell one after having previously
selected aspell. This changes ispell-dictionary-alist to the aspell
one and can produce some problems in that unusual case, as well as in others
where ispell is used after aspell.

a) Run emacs with aspell as default

  After ispell.el is loaded, ispell-library-directory is nil, because that
  is what ispell-check-version returns for aspell.

  ispell-change-dictionary shows the full aspell list as expected.

b) Customize ispell-program-name to ispell.

  ispell-change-dictionary shows the full aspell list, including many dicts
  non available for ispell, because ispell-library-directory is nil.

  ispell-library-directory and so ispell-valid-dictionary-list are again set
  to the right value after an spellchecking command involving a call to
  ispell-init-process is issued, but this is not fully correct because values
  for the ispell dict options having an aspell dict with the same name are
  still the aspell ones, which have overriden the original ones, and the
  original values are lost. This can lead to errors in the ispell call
  (first need to kill aspell process, see below).

  Furthermore, if an aspell process was active, and the dictionary selected
  after ispell-program-name customization has the same name than the
  previous aspell one, aspell process is not killed and no new ispell process
  is started, aspell is still in use.

I am attaching a couple of patches for ispell.el and flyspell.el with the
setup I am trying here. It relies on a new (ispell-initialize-program-params)
function that is run when an spellchecking command is called for the first
time or after ispell-program-name change. Two alists of dicts are maintained
separately, original list is now ispell-base-dictionary-alist and aspell one
is ispell-aspell-dictionary-alist, filled when needed from
(ispell-initialize-program-params) through a call to
(ispell-find-aspell-dictionaries). ispell-dictionary-alist is an alist whose
value is set from (ispell-initialize-program-params) according to
ispell-really-aspell value. Also (ispell-initialize-ispell) takes care of
killing old ispell process when ispell-program-name is changed.

Calls to (ispell-maybe-find-aspell-dictionaries) are replaced by calls to this
(ispell-initialize-program-params) function, as well as a call to
(ispell-check-version) in (flyspell-large-region).

I think something like this is better for the future, if some other
spellchecker is to be supported (hunspell, that also supports an -a option,
comes to my mind), a function to get correct dict list and some code in
(ispell-initialize-program-params) should help.

Let me know if this is reasonable, so I provide a changelog entry.

Comments? 

-- 
Agustin

Attachment: flyspell.el_ispell-initialize-program-params.diff
Description: Text document

Attachment: ispell.el_ispell-initialize-program-params.diff
Description: Text document


reply via email to

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