From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: toggling a minor mode should not tell Customize that the value has been set Date: Sun, 06 Jan 2008 11:16:37 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1199636207 9786 80.91.229.12 (6 Jan 2008 16:16:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Jan 2008 16:16:47 +0000 (UTC) Cc: Emacs-Devel To: "Drew Adams" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 06 17:17:08 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JBYBP-0000fL-LI for ged-emacs-devel@m.gmane.org; Sun, 06 Jan 2008 17:17:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JBYB2-0004MU-Q7 for ged-emacs-devel@m.gmane.org; Sun, 06 Jan 2008 11:16:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JBYAy-0004Lk-Be for emacs-devel@gnu.org; Sun, 06 Jan 2008 11:16:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JBYAw-0004L4-Qw for emacs-devel@gnu.org; Sun, 06 Jan 2008 11:16:40 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JBYAw-0004L1-J7 for emacs-devel@gnu.org; Sun, 06 Jan 2008 11:16:38 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JBYAw-0007bE-D0 for emacs-devel@gnu.org; Sun, 06 Jan 2008 11:16:38 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CABeNgEfO+K+E/2dsb2JhbACnYw X-IronPort-AV: E=Sophos;i="4.24,250,1196658000"; d="scan'208";a="12337117" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 06 Jan 2008 11:16:38 -0500 Original-Received: from pastel.home ([206.248.175.132]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id MRW07838; Sun, 06 Jan 2008 11:16:38 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 98D4A7F7C; Sun, 6 Jan 2008 11:16:37 -0500 (EST) In-Reply-To: (Drew Adams's message of "Sun, 6 Jan 2008 00:01:12 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:86338 Archived-At: >> Because M-x foo-mode RET on such global minor-modes isn't much different >> from M-x customize-variable RET foo-mode RET .... -> Set for >> current session. > "isn't much different" How so? What do you mean by that? It has the same user-visible effect of enabling/disabling the mode in the current session. > But _why_ should they be treated similarly? That is the question. Because they have the same effect in all other respects. > Logically and a priori, it isn't much the _same_, I'd say. In which way is it different? >> > What was the rationale behind this behavior? Why should toggling >> >> The rationale is that Custom does not like it when Elisp code modifies >> a defcustom behind its back. > Modifies a defcustom? What does that mean? "Modifies a variable that's defined via defcustom". > Changing the value of a variable that happens to be defined by defcustom is Right, so you did understand ;-) > Why should toggling a minor mode be tantamount to customizing its variable? You mean "when done interactively"? Well that's what this thread is trying to explain, isn't it? > And if it should for some reason, then why distinguish between global and > local modes in this regard? Simple: local modes are not defined via defcustom. >> If we don't do it, then Custom will simply tell you that the variable >> was set outside of Custom and that saving the var may hence not have >> the expected effect. > But that's what happened: the value was changed outside Customize. Who says? > If you ask Customize for what was changed outside Customize, this variable > should show up. But if you ask Customize for what was customized but not > saved (`customize-customized'), this should not show up. Why? What would be the benefit? > Why should toggling a mode variable be considered the same as > customizing it? Again, because "they have the same effect in all other respects". >> > A user should be able to use `customize-customized' (including >> > perhaps in `kill-emacs-query-functions') to see what s?he has >> > customized and might want to save. >> >> Exactly, after trying our M-x iswtchb-mode RET she may very much like to >> see that iswitchb-mode is now eabled and that she could save it so that >> it's enabled next time around. > "May?" This design is based only on that _possibility_? No. It was in response to some request. I can't remember the details of it, but I can assure you that it wouldn't have crossed my mind to do that if it weren't for someone complaining about the "changed outside Customize". > It think it is far more likely that someone will toggle a mode on and off > occasionally, without that action implying that s?he would want to save its > last value. Nobody complained about this behavior since it was introduced (in Emacs-21 IIRC), so I don't know about "far more likely" or about the importance of this detail. Stefan