emacs-devel
[Top][All Lists]
Advanced

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

ispell.el, flyspell.el: better ispell/aspell switching


From: Agustin Martin
Subject: ispell.el, flyspell.el: better ispell/aspell switching
Date: Fri, 4 Apr 2008 14:02:17 +0200
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

Hi,

I come back with a rewritten approach for a problem in current ispell.el and
flyspell.el when switching spellchecker in an emacs session.

The problem is as follows, when in an emacs run aspell is used for the first
time, ispell-dictionary-alist is filled with the aspell values, and if
ispell-program-name is customized or changed to ispell during that emacs run
it inherits the aspell values, thus failing if there was an aspell entry
with the same name. Since ispell is still (rarely) needed for pseudo-encodings
like [\'a -> รก] I think this should not happen and all ispell values should
be restored in such case. Also current behavior is too ispell/aspell
centric, in case support for another spellchecker is ever added.

In the proposed attached patches (ispell-maybe-find-aspell-dictionaries) is
replaced by (more neutral) new (ispell-set-spellchecker-params) function.
That function will check if spellchecker is changed and fill
``ispell-dictionary-alist'' with the appropriate values. As written it has
support for info provided by distros. Patches are mostly as currently used
in Debian, with some comments rewritten, and a naive check for [:alpha:]
used (instead of just discarding that for xemacs as in Debian). Keeping
those xemacs checks saves me a couple of patches, please leave them there if
possible.

ispell.el:
==========
(ispell-set-spellchecker-params): 
  New function to make sure right params and dictionary alists are used
  after spellchecker changes.

``ispell-aspell-dictionary-alist'', ``ispell-last-program-name'':
  New variables: used by (ispell-set-spellchecker-params)

(ispell-find-aspell-dictionaries)
  Modified to use ``ispell-aspell-dictionary-alist''

(ispell-maybe-find-aspell-dictionaries)
  Removed. Calls replaced by (ispell-set-spellchecker-params) calls.

(ispell-have-aspell-dictionaries)
  Removed.

flyspell.el:
============
(ispell-maybe-find-aspell-dictionaries)
  Calls replaced by (ispell-set-spellchecker-params) calls.

-- 
Agustin

Attachment: ispell.el_ispell-set-spellchecker-params.diff
Description: Text Data

Attachment: flyspell.el_ispell-set-spellchecker-params.diff
Description: Text Data


reply via email to

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