From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: Minor mode hook run when mode is deactivated? Date: Thu, 08 Oct 2020 16:33:43 +0200 Message-ID: <878scgait4.fsf@fastmail.fm> References: <87d01tr5l1.fsf@fastmail.fm> <87h7r5b4j5.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12046"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.5; emacs 27.1.50 Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 08 16:35:49 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQX1J-00031g-FH for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 08 Oct 2020 16:35:49 +0200 Original-Received: from localhost ([::1]:38474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQX1I-0006U9-Fo for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 08 Oct 2020 10:35:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQWzO-0005JF-Lp for help-gnu-emacs@gnu.org; Thu, 08 Oct 2020 10:33:50 -0400 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:54249) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQWzM-0006wZ-Fi for help-gnu-emacs@gnu.org; Thu, 08 Oct 2020 10:33:50 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id DBA90C64; Thu, 8 Oct 2020 10:33:46 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 08 Oct 2020 10:33:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= references:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; s=fm1; bh=Lh9Nr5uGvvk5jZAMuIaENLdx9j iDpWEE11OUs5wiIuU=; b=P+fuJ5ZqE0j6zlfiVDOx+WqaZVPA4WCAR/BxsfzDhR SqUTmCYIRLZKrn3rlg0W2HH+Hk3vrrMFj2uGeDZASh+ZAAdM61NGdXFDOgJwzIj0 0fcuDUHD8F5TNF7qkPmeDheXpJG1TsFB9v9szXxrOubAFSvAidqvA7eXQb2YfQmh g6FR3tMPbFrD2MWjYK3WoTJeax17GZGrrXffHTYvf2UPLqpIyvKWb8PqwWUpKuzy rMv2zFyscHfUNxoa9iae0H2vVBkEah2bQzepOHgAsoth1dTCOIxXaf7F6zBmcDyW 8/C0QxDsI0xpyULQK3iDOC35QQ+XjOfR1Q82SKImxYWw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Lh9Nr5 uGvvk5jZAMuIaENLdx9jiDpWEE11OUs5wiIuU=; b=VhWFYu25y9MXs3QHKQuj0G BStib0dvraS36cE1TopayrwppgmkGL8YMDgbeGAmNz8435M1dnl4whqLvZFuHuSi cToT+m17DpcD2OypRNzRDpxD4DiBy54dWtTwmgPQs0FrsUtL5k3q0kBZvFfS5Kat 7M+FSWCcDGw/KDDFeB1ojE8X91RywavgTM3oN9Uy6HHkqRpn7vbkbJxcOotF/ubt FhMXVnWVyB6at6MCC9wZqlFUXPBqUPY/xJHt405eABkf3Qw56SoRkTr3gamrK8wv cA+UtE3Rq5WhbxDUxGFkLyio2eg8PI3XYbfi12hTjfh3rYIYVOrGSC5Hw4ypzOcw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrgeelgdehudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpehffgfhvffujgffkfggtgesthdtredttdertdenucfhrhhomheplfhoohhsthcu mfhrvghmvghrshcuoehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmheqne cuggftrfgrthhtvghrnhephfduffeuhfdulefhgfelueekgeduveettdduudfhfeetueeg vdevtdduudfgffefnecukfhppeelhedrledtrddvvdegrddvudegnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhoohhsthhkrhgvmhgvrhhs sehfrghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: from Swift.fastmail.com (ip5f5ae0d6.dynamic.kabel-deutschland.de [95.90.224.214]) by mail.messagingengine.com (Postfix) with ESMTPA id E16A6306467D; Thu, 8 Oct 2020 10:33:45 -0400 (EDT) In-reply-to: Received-SPF: pass client-ip=64.147.123.25; envelope-from=joostkremers@fastmail.fm; helo=wout2-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/08 10:33:47 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:124376 Archived-At: On Thu, Oct 08 2020, Stefan Monnier wrote: >> That makes sense, but it does mean that you cannot put a minor >> mode onto >> another minor mode hook.[1] > > And expect this minor mode to be enabled/disabled along with the > "parent" minor mode? no, indeed! No, not at all. :-) I added an extra hook variable that got run in the body of `define-minor-mode` when deactivating the "parent" mode, which I used to turn off the "child" minor mode. I was just surprised that the "child" mode was then immediately reactivated again. >> Which is OK, I was just surprised that I wasn't able to find >> anything about >> this in the documentation. Is in there and I just didn't >> search well enough, >> or should it perhaps be added? > > `C-h o -mode-hook RET` should say that it is run both when > leaving > and entering. So either your specific hook failed to mention > it, No, it's there. I just never bothered to look, because I it's a mode that I wrote myself. :-) I didn't realize that the mode hook gets a default doc string. > or you > looked in some other part of the doc. In either case it sounds > like you > found a documentation bug, so please report it (it's important > then to > say exactly where you looked for that info). I'll report it as a documentation bug, then. Thanks for your reply. -- Joost Kremers Life has its moments