[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ELPA] New package: Auto Correct Mode
From: |
Ian Dunn |
Subject: |
Re: [ELPA] New package: Auto Correct Mode |
Date: |
Mon, 04 Sep 2017 21:04:29 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
>>>>> "Stefan" == Stefan Monnier <address@hidden> writes:
>> (if auto-correct-mode (run-hooks
>> 'auto-correct-activate-functions) (run-hooks
>> 'auto-correct-deactivate-functions)))
Stefan> BTW, these are regular hooks (i.e. called with no arguments
Stefan> and only for their side-effects), so their name should
Stefan> preferably end in "-hook" than in "-functions".
Stefan> Also, note that `auto-correct-mode` already runs (thanks to
Stefan> `define-minor-mode`) `auto-correct-mode-hook` every time the
Stefan> mode is changed (enabled or disabled), so the above two
Stefan> hooks aren't indispensable.
Stefan> E.g. you could use the patch below or simplify further by
Stefan> changing auto-correct--add/remove-support to only take a
Stefan> single argument. Or by dropping this altogether since the
Stefan> third party could simply add itself to auto-correct-hook
Stefan> directly, since that's a standard interface for minor modes.
I took it one step further and collapsed add/remove-support into just
handle-support. I also changed it to take a function of one argument that
indicates whether to activate or deactivate support.
I don't want to remove the support function entirely, since it's also got the
virtue of handling activation/deactivation when it gets called. Thus, flyspell
support will be immediately deactivated when I set the customization variable
to nil, or when some other package calls it for support.
Thanks for your input.
--
Ian Dunn