emacs-devel
[Top][All Lists]
Advanced

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

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


From: Agustin Martin
Subject: Re: ispell.el, flyspell.el: better ispell/aspell switching
Date: Mon, 21 Apr 2008 19:15:19 +0200
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

On Thu, Apr 17, 2008 at 09:38:51PM -0400, Stefan Monnier wrote:

> I think it's perfectly fine to include it in ispell.el (it doesn't have
> to be limited to the use of distro's tho, so I'd rather not use the word
> "distro".  As a general rule, variables and functions should take names
> that describe what they do rather than in what context they'll be used)

Thanks, I now notice that this may also be used systemwide by sysadmins
for e.g., non-standard dicts, so removing the 'distro' word completely and
using ``ispell-initialize-spellchecker-hook'' instead.

> 
> > I think this is better done as currently, just in the middle, that
> > is, after parsed aspell dicts, but before base-dicts. You do not know where
> > things come from if things are done at the end, and if you need to check it
> > you may end reusing half of the function.
> 
> Is it ever necessary/important to distinguish whether it comes from the
> base or fom the parsed dicts?

I think that only in the function.

> > If the problem is about using a hook there, something like
> 
> No, the problem is the dynamically scoped variables.  But if there's no
> easy way to do without them, it's OK to use such things.  Just use more
> descriptive names, and be sure to document them in the hook's docstring.

Thanks for all the suggestions, I am attaching updated patches. Feel free to
change if you think there are better names or ways of doing things.


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'',
``ispell-initialize-spellchecker-hook''
New variables and hook: 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.2.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]