From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: `customize-customized' and mode variable of a minor mode Date: Fri, 6 Apr 2007 14:14:45 -0700 Message-ID: References: <4616A6AD.3060902@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1175899103 6752 80.91.229.12 (6 Apr 2007 22:38:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 6 Apr 2007 22:38:23 +0000 (UTC) To: "Emacs-Devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 07 00:37:38 2007 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 1HZvmF-0006rM-Un for ged-emacs-devel@m.gmane.org; Fri, 06 Apr 2007 23:15:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HZvpm-00075h-4z for ged-emacs-devel@m.gmane.org; Fri, 06 Apr 2007 17:19:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HZvpj-00075c-MT for emacs-devel@gnu.org; Fri, 06 Apr 2007 17:18:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HZvpi-00075Q-6e for emacs-devel@gnu.org; Fri, 06 Apr 2007 17:18:59 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HZvpi-00075N-2l for emacs-devel@gnu.org; Fri, 06 Apr 2007 17:18:58 -0400 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HZvmB-0006Xr-2J for emacs-devel@gnu.org; Fri, 06 Apr 2007 17:15:19 -0400 Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l36LFGHe027516 for ; Fri, 6 Apr 2007 16:15:16 -0500 Original-Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l36J76k1017768 for ; Fri, 6 Apr 2007 15:15:16 -0600 Original-Received: from dhcp-amer-whq-csvpn-gw3-141-144-80-139.vpn.oracle.com by acsmt351.oracle.com with ESMTP id 2595800311175894090; Fri, 06 Apr 2007 14:14:50 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <4616A6AD.3060902@gmail.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-Whitelist: TRUE X-Whitelist: TRUE X-Brightmail-Tracker: AAAAAQAAAAI= X-detected-kernel: Linux 2.4-2.6 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:69146 Archived-At: > > Toggling a mode changes the value of the mode variable. Why would a user > > want to save that new value? You might toggle a (global) minor > > mode several times during an Emacs session. Turning the mode on and > > off doesn't imply that you want to change the saved value. I don't see > > a use case for that. > > If the global minor mode is at the state currently saved by Custom it > will not show up in customize-customized. True, and if it happens to be in the opposite state, then it will show up. > I often put toggling of global minor modes in the menus. So do I. > It seems conventient to me to be able to save the state of those > minor modes through customize-customized then. I can see the use case you describe. I guess it depends on the use pattern and the nature of the global minor mode. At least some mode toggling is not tentative configuring, and at least some people might not want some mode changes to be candidates for saving. There may be no good way to satisfy all use scenarios and user preferences for this. Another user option perhaps? A mode variable does two things: 1) its saved value records your preference for mode initialization, and 2) its current value reflects the state of the mode (on or off). We could separate these two roles, using two different variables: one, which is not customizable, to reflect the current state, and another, which is customizable, to record the initial value. But then `customize-customized' would not recognize the current mode state and ask if you want to save it, so that wouldn't satisfy the use case you mention. Perhaps it comes down more to how `customize-customized' is invoked. If a user specifically asks to see all changes, with an eye to saving some to configure Emacs, then mode variables should be included. If a user uses `customize-customized' in `kill-emacs-query-functions', then maybe mode variables should be excluded. In this latter use, `customize-customized' is invoked just as a safety measure, a la modified buffers in `save-buffers-kill-emacs'.