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: Stefan Monnier
Subject: Re: ispell.el, flyspell.el: better ispell/aspell switching
Date: Wed, 23 Apr 2008 16:40:25 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

>>>>> "Agustin" == Agustin Martin <address@hidden> writes:

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

Gracias, installed with the following changelog:

    * 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.
    (ispell-find-aspell-dictionaries): Use ispell-aspell-dictionary-alist.
    (ispell-maybe-find-aspell-dictionaries): Remove.
    Calls replaced by (ispell-set-spellchecker-params) calls.
    (ispell-have-aspell-dictionaries): Remove.
    * flyspell.el: Replace ispell-maybe-find-aspell-dictionaries by
    ispell-set-spellchecker-params.

Please notice the format and use of present tense.


        Stefan




reply via email to

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