From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Should mode commands be idempotent? Date: Tue, 19 Sep 2017 18:29:09 -0400 Message-ID: References: <5358b04b-70cb-bbaf-1887-bd83613e9c2b@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1505860201 8565 195.159.176.226 (19 Sep 2017 22:30:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 19 Sep 2017 22:30:01 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 20 00:29:56 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 1duR1g-0001wn-5y for ged-emacs-devel@m.gmane.org; Wed, 20 Sep 2017 00:29:56 +0200 Original-Received: from localhost ([::1]:45712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duR1n-0004YJ-Gx for ged-emacs-devel@m.gmane.org; Tue, 19 Sep 2017 18:30:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duR19-0004Xz-RN for emacs-devel@gnu.org; Tue, 19 Sep 2017 18:29:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duR14-00029G-Vf for emacs-devel@gnu.org; Tue, 19 Sep 2017 18:29:23 -0400 Original-Received: from [195.159.176.226] (port=50222 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1duR14-00027u-Ok for emacs-devel@gnu.org; Tue, 19 Sep 2017 18:29:18 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1duR0t-0008Ny-AK for emacs-devel@gnu.org; Wed, 20 Sep 2017 00:29:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 10 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:KFIhVGhVPYQYdWJHEtCc760a3Oo= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:218548 Archived-At: > Is there a way inside of a minor mode to check if it was already > enabled before the current call, short of having a second variable > for that? It shouldn't be needed: the idempotence should emerge naturally from the way the code is written, rather than being the result of special tests to detect that particular situation. Stefan