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: Sun, 24 Sep 2017 10:26:48 -0700 (PDT) Message-ID: References: < <<9f11a3c6-b113-4bf6-9dab-f894b2ad77b5@default> < <55da155a-03b1-d3ed-4036-12e5a60fa26c@gmail.com> 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 1506274022 2449 195.159.176.226 (24 Sep 2017 17:27:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 24 Sep 2017 17:27:02 +0000 (UTC) To: =?utf-8?B?Q2zDqW1lbnQgUGl0LUNsYXVkZWw=?= , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 24 19:26:57 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 1dwAgC-0000EP-Ir for ged-emacs-devel@m.gmane.org; Sun, 24 Sep 2017 19:26:56 +0200 Original-Received: from localhost ([::1]:38877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwAgJ-0002N0-T5 for ged-emacs-devel@m.gmane.org; Sun, 24 Sep 2017 13:27:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwAgD-0002Mj-F0 for emacs-devel@gnu.org; Sun, 24 Sep 2017 13:26:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwAgA-0002mo-Bg for emacs-devel@gnu.org; Sun, 24 Sep 2017 13:26:57 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:46107) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dwAgA-0002lz-2h for emacs-devel@gnu.org; Sun, 24 Sep 2017 13:26:54 -0400 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v8OHQoPv006373 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 24 Sep 2017 17:26:50 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v8OHQnaj019545 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 24 Sep 2017 17:26:50 GMT Original-Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v8OHQnZ8018630; Sun, 24 Sep 2017 17:26:49 GMT In-Reply-To: <55da155a-03b1-d3ed-4036-12e5a60fa26c@gmail.com> 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: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 156.151.31.81 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:218751 Archived-At: > > Has someone actually reported a problem that s?he ran into by > > encountering an actual mode function that was not idempotent? >=20 > I think I mentioned visual-line-mode; the fact that it's not > idempotent is a concrete (though minor) problem for me. I enable > it in a hook, and a major mode that I use enables it too. Due to > the way visual-line-mode works, disabling it after this doesn't > restore my original settings. `visual-line-mode' is distributed with Emacs. It sounds like what you report about it is a bug. Or is `visual-line-mode' intentionally doing what it does, to have some state be different for different times it is turned on? If not - if its non-idempotence is just an unintentional behavior (a mistake), then it is just a bug that needs to be fixed. That Emacs chooses to have its distributed modes be idempotent is one thing. That some 3rd-party code might also mistakenly (unintentionally) prove to be non-idempotent is another, but similar thing. Such cases represent things to fix. That is different from establishing a convention that modes should never, intentionally or unintentionally, be non-idempotent.