all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: Change `customize-save-variable' to work under "emacs -Q"?
Date: Tue, 12 Jul 2011 10:03:48 +1000	[thread overview]
Message-ID: <CAC=50j9eV1j_CsdCzx3CRCefS90dZd80Y6tvxDhJx-+hVXq7tA@mail.gmail.com> (raw)
In-Reply-To: <m3tyas39cu.fsf@quimbies.gnus.org>

On Tue, Jul 12, 2011 at 5:28 AM, Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:
> Chong Yidong <cyd@stupidchicken.com> writes:
>
>> But, on reflection, maybe
>>
>>   (ignore-errors (customize-save-variable ...))
>>
>> would work just as well.
>
> Well, ignoring errors like that is generally not a good idea.  If saving
> 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 about.

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



  reply	other threads:[~2011-07-12  0:03 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-10 12:22 Change `customize-save-variable' to work under "emacs -Q"? Lars Magne Ingebrigtsen
2011-07-11  2:30 ` Stephen J. Turnbull
2011-07-11  7:49   ` Lars Magne Ingebrigtsen
2011-07-11  9:52     ` Stephen J. Turnbull
2011-07-11  9:53       ` Lars Magne Ingebrigtsen
2011-07-11 13:52         ` Stephen J. Turnbull
2011-07-11 17:36 ` Chong Yidong
2011-07-11 18:08   ` Drew Adams
2011-07-11 19:32     ` Juanma Barranquero
2011-07-11 18:27   ` PJ Weisberg
2011-07-11 19:04     ` Chong Yidong
2011-07-11 19:28       ` Lars Magne Ingebrigtsen
2011-07-12  0:03         ` Tim Cross [this message]
2011-07-12  1:07           ` chad
2011-07-12  1:51           ` Stephen J. Turnbull
2011-07-12  2:57             ` Tim Cross
2011-07-12  4:12               ` Stephen J. Turnbull
2011-07-12 10:30                 ` Tim Cross
2011-07-13  0:31                   ` Stephen J. Turnbull
2011-07-13  5:38                     ` Tim Cross
2011-07-13 11:02                       ` Stephen J. Turnbull
2011-07-13 23:46                         ` Tim Cross
2011-07-14  2:13                           ` Stephen J. Turnbull
2011-07-12  6:46             ` Lars Magne Ingebrigtsen
2011-07-12  3:32 ` Stefan Monnier
2011-07-15 17:01 ` Dave Abrahams
2011-07-17 14:33 ` Christoph Scholtes
2011-07-17 19:13   ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAC=50j9eV1j_CsdCzx3CRCefS90dZd80Y6tvxDhJx-+hVXq7tA@mail.gmail.com' \
    --to=theophilusx@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.