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: Fri, 22 Sep 2017 08:54:23 -0700 (PDT) Message-ID: References: < > <<9f11a3c6-b113-4bf6-9dab-f894b2ad77b5@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 1506095985 5037 195.159.176.226 (22 Sep 2017 15:59:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 22 Sep 2017 15:59:45 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 22 17:59:40 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 1dvQMd-00011G-Sn for ged-emacs-devel@m.gmane.org; Fri, 22 Sep 2017 17:59:40 +0200 Original-Received: from localhost ([::1]:59681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvQMl-0004Ao-8e for ged-emacs-devel@m.gmane.org; Fri, 22 Sep 2017 11:59:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvQHh-0007ps-6Z for emacs-devel@gnu.org; Fri, 22 Sep 2017 11:54:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvQHc-0004e2-CF for emacs-devel@gnu.org; Fri, 22 Sep 2017 11:54:33 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:47366) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dvQHc-0004dV-2w; Fri, 22 Sep 2017 11:54:28 -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 v8MFsQcU024324 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Sep 2017 15:54:26 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 v8MFsPlC009846 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Sep 2017 15:54:26 GMT Original-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v8MFsPJY021608; Fri, 22 Sep 2017 15:54:25 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:218687 Archived-At: > Users expect major modes to be idempotent. Any time one is not, it > will cause them surprises. We should treat that as a bug and fix it > to be idempotent. Yes. You're talking about code distributed with Emacs, no doubt. And any 3rd-party library (if there were any) that might have such a mode function would be well advised to make clear to its users that the function is not idempotent, and explain why: what to expect and why. > As for minor modes, it has been pointed out (by Stefan?) that multiple > hooks could enable the same major mode, and the result should be the > same as if just one hook did so. My question for this thread is this: Is this proposal (add an explicit rule or convention stating that mode functions should be idempotent) a solution looking for a problem? Has someone actually reported a problem that s?he ran into by encountering an actual mode function that was not idempotent?