From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Wiegley Newsgroups: gmane.emacs.devel Subject: Re: Should mode commands be idempotent? Date: Tue, 26 Sep 2017 11:01:51 -0700 Message-ID: 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 X-Trace: blaine.gmane.org 1506448940 12150 195.159.176.226 (26 Sep 2017 18:02:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 26 Sep 2017 18:02:20 +0000 (UTC) User-Agent: Gnus/5.130016 (Ma Gnus v0.16) Emacs/26.0 (darwin) Cc: Stefan Monnier , emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 26 20:02:16 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 1dwuBS-0002jW-PT for ged-emacs-devel@m.gmane.org; Tue, 26 Sep 2017 20:02:14 +0200 Original-Received: from localhost ([::1]:50549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwuBa-0001aC-3A for ged-emacs-devel@m.gmane.org; Tue, 26 Sep 2017 14:02:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwuBE-0001SM-RR for emacs-devel@gnu.org; Tue, 26 Sep 2017 14:02:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwuBA-0007zh-Tp for emacs-devel@gnu.org; Tue, 26 Sep 2017 14:02:00 -0400 Original-Received: from mail-pg0-x22b.google.com ([2607:f8b0:400e:c05::22b]:55027) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dwuBA-0007z2-O3 for emacs-devel@gnu.org; Tue, 26 Sep 2017 14:01:56 -0400 Original-Received: by mail-pg0-x22b.google.com with SMTP id c137so6325106pga.11 for ; Tue, 26 Sep 2017 11:01:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:date:message-id:references :user-agent:mail-followup-to:mime-version; bh=sXNijU7Bq5Jf6PNJaI8yi5SY+vn/c2tUcPrslsFNCow=; b=Z+hOof744vwc/CNyurrNG91omUGMY32LJH+O0wUiwPXncVT5jf0KdkK7yAapfZ/BBc 4s/x0ejwg8RtjTgBC5awXOvbwSI9cZ9DYbgva6Ecsz/QeWqt2usx7/jjUSYaDlLTy4OX gRSCDGDCOql7SAjNDa2dTBi9XZUah2pPpf0ik6LECZffQ/kVNYmeUBvMwcNtPzr7XI/7 zK0T4QBfGkpM29IiNRBiWyw/a//MrN2DaJrw6eeqr+A/AY7cTtjlyt7TeRXC4YH5yAWH ayDL5hY3Ub6zK/2oYgJpoSnK9g7AhB18T4WLrU4Sa4nw/yyJajRe0ldFv1WMPm4CcFn5 P5Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:date:message-id :references:user-agent:mail-followup-to:mime-version; bh=sXNijU7Bq5Jf6PNJaI8yi5SY+vn/c2tUcPrslsFNCow=; b=CkueV/f+ezuimHZAaRWnSHTx9NFGSX2svlLP5V04CNfmgLhVTpthSCKSNyU6rgkWAI /DJwrjn255CMYBNRF/JYez2ox5AMCkDBzx8kuK3ivJWTIijEftbY3jtU6/WYrEPvDpMh cMLDxiJ/V/fibTDSYLk/kXrXWI3rom0JRbdKHyEX4PJbR2oVY4xdAk2xBDrd+cs7uODZ ub0EW+Y6DxtykhQHeMtLHdSTNt3wuUNhRUU6XiOiq4TF0ySUW+WCxVTIMj9d/m1B/zRO qLbDuKweH2+g9i8sc+alYnMLe4LNuRt8c0PEq6SodU+uSl2PWlbthja2LVv04HffNbnC wipA== X-Gm-Message-State: AHPjjUhyuwDmthsy/lw93930e8K3QXZqZc9McQeL93ewwODqnR0SO8OX j3GaWk2gwPNEZ1/r6vwntT7MRxIj X-Google-Smtp-Source: AOwi7QBz6T5iELHUxM7molrSfE3gd2a2g6yTz1HY13Z+Y4EyTQcPP4q5SD5ActCtHvnAvfl60ju+iA== X-Received: by 10.99.114.20 with SMTP id n20mr11647317pgc.448.1506448915289; Tue, 26 Sep 2017 11:01:55 -0700 (PDT) Original-Received: from Vulcan.local (76-234-69-149.lightspeed.frokca.sbcglobal.net. [76.234.69.149]) by smtp.gmail.com with ESMTPSA id h1sm18280268pgf.54.2017.09.26.11.01.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Sep 2017 11:01:54 -0700 (PDT) X-Google-Original-From: "John Wiegley" Original-Received: by Vulcan.local (Postfix, from userid 501) id 6BB51924FB7A; Tue, 26 Sep 2017 11:01:53 -0700 (PDT) In-Reply-To: <2564c62e-a419-45d8-809f-433a6f7c3808@default> (Drew Adams's message of "Tue, 26 Sep 2017 10:55:28 -0700 (PDT)") Mail-Followup-To: Drew Adams , Stefan Monnier , emacs-devel@gnu.org X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::22b 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:218804 Archived-At: >>>>> Drew Adams writes: >> 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 calling it >> once. > 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? Yes, idempotence: calling it N times is the exact same as calling it once. -- John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2