From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Should mode commands be idempotent? Date: Sat, 23 Sep 2017 10:17:21 -0400 Message-ID: References: <5358b04b-70cb-bbaf-1887-bd83613e9c2b@gmail.com> <00b0c4e4-a02f-8c9f-ef52-7ad5a65798d1@gmail.com> <81dcceb4-f939-1d63-0c31-0926a5dad823@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1506176262 29074 195.159.176.226 (23 Sep 2017 14:17:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 23 Sep 2017 14:17:42 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 23 16:17:38 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 1dvlFP-00072c-Nc for ged-emacs-devel@m.gmane.org; Sat, 23 Sep 2017 16:17:35 +0200 Original-Received: from localhost ([::1]:35106 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvlFW-0004sS-Qk for ged-emacs-devel@m.gmane.org; Sat, 23 Sep 2017 10:17:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvlFN-0004pw-He for emacs-devel@gnu.org; Sat, 23 Sep 2017 10:17:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvlFK-0000HQ-Bg for emacs-devel@gnu.org; Sat, 23 Sep 2017 10:17:33 -0400 Original-Received: from [195.159.176.226] (port=33557 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dvlFK-0000HD-4J for emacs-devel@gnu.org; Sat, 23 Sep 2017 10:17:30 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dvlF9-0006Ag-2Z for emacs-devel@gnu.org; Sat, 23 Sep 2017 16:17:19 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 13 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:m15X2ufoKsG/7xrFLhfHcLidXyE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:218728 Archived-At: > It isn't even obvious that the current behavior (even with your patch) is > what we want, anyway: what if I have another mode foo-mode that touches the > same variables as visual-line-mode? Then I can run (visual-line-mode), > (foo-mode), (visual-line-mode -1), and then which state should I be in? > There's a more general problem here, and it's not an easy one :/ I know. We need something along the same lines as add-function but for arbitrary values rather than only for functions. It was pretty close to the top of my todo list recently (close enough that I thought about it, but not close enough to get usable code out of it). Stefan