From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ian Dunn Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package: Auto Correct Mode Date: Mon, 04 Sep 2017 21:04:29 -0400 Message-ID: <87pob66jmq.fsf@escafil> References: <87zialc7wx.fsf@escafil> <87lglw6cmr.fsf@escafil> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1504573538 27390 195.159.176.226 (5 Sep 2017 01:05:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 5 Sep 2017 01:05:38 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 05 03:05:22 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dp2Ik-00064u-R0 for ged-emacs-devel@m.gmane.org; Tue, 05 Sep 2017 03:05:14 +0200 Original-Received: from localhost ([::1]:56257 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dp2Ir-0005XJ-MO for ged-emacs-devel@m.gmane.org; Mon, 04 Sep 2017 21:05:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dp2Ih-0005VR-Gp for emacs-devel@gnu.org; Mon, 04 Sep 2017 21:05:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dp2Ic-0000cy-OL for emacs-devel@gnu.org; Mon, 04 Sep 2017 21:05:11 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44632) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dp2Ic-0000ct-Kg; Mon, 04 Sep 2017 21:05:06 -0400 Original-Received: from [2604:6000:1010:176:da4d:3352:bae5:f50e] (port=43990 helo=escafil) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dp2Ic-00031u-BD; Mon, 04 Sep 2017 21:05:06 -0400 In-Reply-To: (Stefan Monnier's message of "Mon, 04 Sep 2017 18:17:59 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:217935 Archived-At: >>>>> "Stefan" == Stefan Monnier 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