From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim Cross Newsgroups: gmane.emacs.devel Subject: Re: Change `customize-save-variable' to work under "emacs -Q"? Date: Tue, 12 Jul 2011 10:03:48 +1000 Message-ID: References: <877h7ok9cd.fsf@stupidchicken.com> <87d3hgprjb.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1310429064 2969 80.91.229.12 (12 Jul 2011 00:04:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 12 Jul 2011 00:04:24 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 12 02:04:16 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QgQST-0006Bw-He for ged-emacs-devel@m.gmane.org; Tue, 12 Jul 2011 02:04:13 +0200 Original-Received: from localhost ([::1]:51630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgQSS-0001qo-3B for ged-emacs-devel@m.gmane.org; Mon, 11 Jul 2011 20:04:12 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:39597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgQSA-0001qd-0F for emacs-devel@gnu.org; Mon, 11 Jul 2011 20:03:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QgQS5-00026v-TU for emacs-devel@gnu.org; Mon, 11 Jul 2011 20:03:53 -0400 Original-Received: from mail-iw0-f169.google.com ([209.85.214.169]:60054) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgQS5-00026r-Q0 for emacs-devel@gnu.org; Mon, 11 Jul 2011 20:03:49 -0400 Original-Received: by iwn8 with SMTP id 8so4840934iwn.0 for ; Mon, 11 Jul 2011 17:03:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=VOTCHd8kZDpycwFhZtHHSkpLJQRLds3D8VZS7c+B0Kc=; b=kyA8NXcyA795nYmhyBpMVn0PWUBUKrZ5ZNyUl/dOAhZkI4wLC2AIrl3KFvwe3+5Le6 wT85/Q3W10R36aJBSpNNS4E5gqxpTbFBh2+w7IZWtuJhDhuxzYKDRpBn/yLq9xs5EasN j7fqcQzAG0E8I8VKAT84L8nZGznelpZn3S6X0= Original-Received: by 10.43.134.72 with SMTP id ib8mr1295275icc.94.1310429028470; Mon, 11 Jul 2011 17:03:48 -0700 (PDT) Original-Received: by 10.231.15.3 with HTTP; Mon, 11 Jul 2011 17:03:48 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:141959 Archived-At: On Tue, Jul 12, 2011 at 5:28 AM, Lars Magne Ingebrigtsen w= rote: > Chong Yidong writes: > >> But, on reflection, maybe >> >> =A0 (ignore-errors (customize-save-variable ...)) >> >> would work just as well. > > Well, ignoring errors like that is generally not a good idea. =A0If savin= g > the .emacs file errors out, you want to know, for instance. > > And it doesn't set the variables in question if you do that. > > I think just making `customize-save-variable' set and warn will make the > "emacs -Q" special case work nicely for all use cases. > I think your on the right track, but a couple of things worth thinking abou= t. An important role of -Q is to provide a well defined, understood environment which is largely common to all users. It is a key first step in reproducing bugs. While the current situation where customizing settings may fail or throw an error and look a bit ugly etc, it at least does have the advantage of providing a consistent environment across users. However, as soon as we allow customized variables to be set, either permanently or temporarily, we run the risk of losing this valuable environment consistency. At the same time, this can also be a source of frustration. For example, if you run emacs -Q to test a recipe for a bug and find it works, you cannot just run report-emacs-bug to submit the bug if your mail settings depend on anything but the default values. You need to copy the backtrace and other important information to a temporary file, exit emacs and start again without the -Q switch and then submit the bug. Furthermore, the environment setting you include in the bug report are now likely to be more complex and not a true reflection of the actual environment that existed when you ran your recipe under emacs -Q. I guess we need the best of both worlds. One possibility might be to modify the code that manages/sets custom variables check for the -Q switch and take some additional or different steps if the -Q switch is also detected. Perhaps something like using setq and adding the variable and value to a special -Q init list that cold be included in bug reports etc so that anyone wanting to reproduce the problem or run the recipe could also run a special bit of -Q init code to ensure at least consistency with the environment provided by the reporter/tester etc. The above is not well thought out - just some thoughts that might trigger better ideas. The main point is that while it might be nice to have some better way to deal with code that wants to set custom variables when runnning under -Q, we also need to try and not lose the important value provided by -Q of a consistent, well understood environment with known and tested values for core variables. Tim