From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#19328: [PATCH] Add mechanism to prompt about unsaved customizations Date: Thu, 11 Dec 2014 18:48:48 -0800 (PST) Message-ID: References: <87egs7a5b0.fsf@lifelogs.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1418352579 17645 80.91.229.3 (12 Dec 2014 02:49:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Dec 2014 02:49:39 +0000 (UTC) Cc: 19328@debbugs.gnu.org, Ted Zlatanov To: Stefan Monnier , Cameron Desautels Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 12 03:49:31 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XzGIN-0003M9-5f for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Dec 2014 03:49:31 +0100 Original-Received: from localhost ([::1]:55268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzGIK-0004Xj-4X for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Dec 2014 21:49:28 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzGI7-0004XZ-Pp for bug-gnu-emacs@gnu.org; Thu, 11 Dec 2014 21:49:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XzGHu-0001TN-LD for bug-gnu-emacs@gnu.org; Thu, 11 Dec 2014 21:49:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzGHu-0001TG-II for bug-gnu-emacs@gnu.org; Thu, 11 Dec 2014 21:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XzGHu-0006wj-5Z for bug-gnu-emacs@gnu.org; Thu, 11 Dec 2014 21:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Dec 2014 02:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19328 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 19328-submit@debbugs.gnu.org id=B19328.141835254126694 (code B ref 19328); Fri, 12 Dec 2014 02:49:02 +0000 Original-Received: (at 19328) by debbugs.gnu.org; 12 Dec 2014 02:49:01 +0000 Original-Received: from localhost ([127.0.0.1]:43403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XzGHs-0006wT-72 for submit@debbugs.gnu.org; Thu, 11 Dec 2014 21:49:00 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:20583) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XzGHp-0006wE-Oc for 19328@debbugs.gnu.org; Thu, 11 Dec 2014 21:48:58 -0500 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id sBC2mogA013156 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 12 Dec 2014 02:48:51 GMT Original-Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sBC2mm9c002106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 12 Dec 2014 02:48:49 GMT Original-Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sBC2mmQs007105; Fri, 12 Dec 2014 02:48:48 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:97248 Archived-At: > > What about turning something like this on by default? >=20 > I'm not necessarily opposed to it, but I wonder if it's > sufficiently unintrusive. >=20 > E.g. if you just want to try out a minor mode like global-auto- > revert-mode, IIUC this will set the var and mark it as > "set but unsaved", so when you exit, Emacs will prompt you to > save this setting. >=20 > Maybe it's actually the right thing to do, but I wonder if it will > turn out to be more annoying than useful. And I don't see a good > solution for it. FWIW, in the version of this feature that I use: 1. You are not asked to save the changes. You are asked whether you want to see the changed options (in Customize). If/when you see them, you can quit or save any or all of them first. 2. There are some ways to deal with changes that you don't care about. From the `cus-edit+.el' file header: ;; Dealing with Spurious Changes, 1: Save ;; -------------------------------------- ;; ;; Even if you don't change any preferences yourself, when ;; you quit Emacs the first time you are informed that ;; there are lots of changed preferences, and you are given ;; a chance to save those changes. What are those changes? ;; They represent all of the user preferences that Emacs ;; and various Emacs libraries have changed behind ;; Customize's back - even before you did anything. ;; ;; You'll see user options like `baud-rate' that are set in ;; Emacs C code without informing Customize to mark their ;; settings as `standard' (=3D installed). There shouldn't ;; be any such apparent "changes", since this is part of ;; standard Emacs, but that's the way it is, for now. ;; Customize is still fairly new, and lots of Emacs ;; libraries still define and change user preferences ;; without going through Customize and, in effect, telling ;; it not to consider such preference changes as changes. ;; ;; If you choose to save these preference changes, you will ;; never again be bothered by being informed that they have ;; changed (unless you change them). So, that's one ;; solution to this bother, which makes it a one-time only ;; nuisance: just say "save all". ;; ;; Dealing with Spurious Changes, 2: Ignore ;; ---------------------------------------- ;; ;; Another solution is also possible. Some user ;; preferences, like `case-fold-search' and ;; `debug-on-error' are really the kind of thing that you ;; change often and temporarily - you don't really care ;; about saving their changes, and you certainly don't want ;; to be asked whether or not you want to save them each ;; time you quit Emacs. ;; ;; To deal with that, a list of ignored preferences, ;; `customize-customized-ignore', is defined here. Its ;; preferences (symbols) are not used by ;; `customize-unsaved' at all (you can override that ;; interactively with a prefix arg). So, the other way to ;; deal with the legacy Emacs preferences, besides just ;; saving them in your custom file, is to add them to ;; `customize-customized-ignore' so `customize-unsaved' ;; will ignore them. ;; ;; To make it easy for you to add preferences to this ;; ignore list, `Ignore Unsaved Changes' menu items and ;; buttons have been added. You can choose to ignore ;; specific preferences or all preferences in a Customize ;; buffer - in particular, all preferences in the Customize ;; buffer from `customize-unsaved' (all changed ;; preferences). ;; ;; Dealing with Spurious Changes, 3: Consider Unchanged ;; ---------------------------------------------------- ;; ;; There is also a third way to treat preference changes ;; that you are not responsible for, as an alternative to ;; saving them to your custom file or having Customize ;; always ignore them: tell Customize to consider the ;; current changes as unchanged. This essentially treats ;; them as having been saved, but without saving them. You ;; can do this using the `Consider Unchanged' menu items ;; and buttons added here. ;; ;; For instance, after starting Emacs, you can examine the ;; current preference changes (using `customize-unsaved') ;; from Emacs itself and loaded libraries, and choose ;; `Consider Unchanged' to let Customize know that the ;; current values are to be treated as if they were saved, ;; but without actually saving them to your custom file. ;; That way, your custom file is not polluted with things ;; that you are not really concerned with, yet you are not ;; bothered by seeing such fictitious changes show up each ;; time you check for changes. ;; ;; However, unlike ignoring changes to certain preferences, ;; and really saving current preference values, `Consider ;; Unchanged' is not a persistent change. You can use it ;; at any time to "reset" the change counter for given ;; preferences, so that the current change is considered ;; the new base value (as if it were saved), and any ;; further changes you make to them will show up as ;; changes, using `customize-unsaved'. And note that in my version it is `customize-unsaved' itself that is modified, so the advantageous behavior is available also when that command is used interactively.