From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Should mode commands be idempotent? Date: Tue, 26 Sep 2017 11:50:13 -0700 (PDT) Message-ID: <44241233-0da3-4536-ab64-4071ecbfdac5@default> References: <9f11a3c6-b113-4bf6-9dab-f894b2ad77b5@default> <55da155a-03b1-d3ed-4036-12e5a60fa26c@gmail.com> <950166e7-2766-8a3e-1bc2-a93a356f652c@gmail.com> <118feee3-5787-43b7-9c9b-06907a16a448@default> <2564c62e-a419-45d8-809f-433a6f7c3808@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1506451833 31300 195.159.176.226 (26 Sep 2017 18:50:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 26 Sep 2017 18:50:33 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: John Wiegley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 26 20:50:26 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 1dwuw4-0007cc-TY for ged-emacs-devel@m.gmane.org; Tue, 26 Sep 2017 20:50:25 +0200 Original-Received: from localhost ([::1]:50746 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwuwC-0005Gk-CL for ged-emacs-devel@m.gmane.org; Tue, 26 Sep 2017 14:50:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwuw4-0005FC-DH for emacs-devel@gnu.org; Tue, 26 Sep 2017 14:50:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwuw1-0002mQ-6F for emacs-devel@gnu.org; Tue, 26 Sep 2017 14:50:24 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:51223) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dwuw0-0002m2-Uo for emacs-devel@gnu.org; Tue, 26 Sep 2017 14:50:21 -0400 Original-Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v8QIoHrH002983 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Sep 2017 18:50:18 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v8QIoH1K018208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Sep 2017 18:50:17 GMT Original-Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v8QIoFF3032325; Tue, 26 Sep 2017 18:50:16 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6776.5000 (x86)] X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 141.146.126.69 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:218808 Archived-At: > >> FWIW, I can't off the top of my head think of a reason why (foo-mode 1= ) > >> followed by (foo-mode 1) should do something different than just calli= ng > >> it once. >=20 > > Just what do you have in mind, for the meaning here of > > "do something different"? Are we saying that the state > > of the Emacs session after the second call should be > > identical to the state after the first call? Just what > > kind of "identical" would be meant? >=20 > Yes, idempotence: calling it N times is the exact same as calling it once= . Good luck with such a guideline. The state of an Emacs session is _never_ exactly the same after each time you turn on a mode - any mode, any session. So many things change... If you don't want to specify what can and cannot change, to be able to satisfy the guideline, then the guideline is effectively useless. This isn't Haskell. (And even for Haskell the session state changes.)