From: Ian Dunn <dunni@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: [ELPA] New package: Auto Correct Mode
Date: Mon, 04 Sep 2017 21:04:29 -0400 [thread overview]
Message-ID: <87pob66jmq.fsf@escafil> (raw)
In-Reply-To: <jwvk21ennc7.fsf-monnier+gmane.emacs.devel@gnu.org> (Stefan Monnier's message of "Mon, 04 Sep 2017 18:17:59 -0400")
>>>>> "Stefan" == Stefan Monnier <monnier@iro.umontreal.ca> 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
prev parent reply other threads:[~2017-09-05 1:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-27 16:06 [ELPA] New package: Auto Correct Mode Ian Dunn
2017-08-27 16:34 ` Eli Zaretskii
2017-08-27 18:23 ` Ian Dunn
2017-08-27 18:43 ` Eli Zaretskii
2017-08-27 19:19 ` John Wiegley
2017-08-28 0:29 ` Ian Dunn
2017-09-02 20:58 ` Ian Dunn
2017-09-03 20:48 ` John Wiegley
2017-09-04 13:47 ` Ian Dunn
2017-09-04 22:17 ` Stefan Monnier
2017-09-05 1:04 ` Ian Dunn [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pob66jmq.fsf@escafil \
--to=dunni@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.