From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Should mode commands be idempotent? Date: Wed, 20 Sep 2017 09:01:49 -0400 Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: blaine.gmane.org Content-Type: text/plain; charset=Utf-8 X-Trace: blaine.gmane.org 1505923014 19770 195.159.176.226 (20 Sep 2017 15:56:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 20 Sep 2017 15:56:54 +0000 (UTC) Cc: emacs-devel@gnu.org To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 20 17:56:50 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 1duhMm-0004l2-Ct for ged-emacs-devel@m.gmane.org; Wed, 20 Sep 2017 17:56:48 +0200 Original-Received: from localhost ([::1]:49169 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duhMt-0004eE-QP for ged-emacs-devel@m.gmane.org; Wed, 20 Sep 2017 11:56:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duh3H-0004wv-Du for emacs-devel@gnu.org; Wed, 20 Sep 2017 11:36:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duh3G-0005MJ-Jm for emacs-devel@gnu.org; Wed, 20 Sep 2017 11:36:39 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41723) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dugcr-0003Hb-05; Wed, 20 Sep 2017 11:09:21 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1duedR-0002C5-O6; Wed, 20 Sep 2017 09:01:49 -0400 In-reply-to: (message from Philipp Stephani on Tue, 19 Sep 2017 19:58:28 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:218585 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > I think it's generally expected that mode commands (both major and minor) > are reasonably idempotent, i.e. calling them twice should have the same > effects as calling them once (unless using 'toggle, of course). However, I > couldn't find this requirement in the manual, should it be added to the > "Modes" section? This is the intended behavior, and has been all along. It would be good to say so explicitly. For major modes, as long as they work exclusively by setting buffer-local variables and other per-buffer values (which they should), kill-all-local-variables takes care of this automatically. -- Dr Richard Stallman President, Free Software Foundation (gnu.org, fsf.org) Internet Hall-of-Famer (internethalloffame.org) Skype: No way! See stallman.org/skype.html.