unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: "Stephen J. Turnbull" <stephen@xemacs.org>
Cc: emacs-devel@gnu.org
Subject: Re: Change `customize-save-variable' to work under "emacs -Q"?
Date: Thu, 14 Jul 2011 09:46:19 +1000	[thread overview]
Message-ID: <CAC=50j8C_0HOUHXvU3ucQ+DMB7k8mS9tE80xdYH_DpHkX-bKPg@mail.gmail.com> (raw)
In-Reply-To: <874o2qtpdi.fsf@uwakimon.sk.tsukuba.ac.jp>

On Wed, Jul 13, 2011 at 9:02 PM, Stephen J. Turnbull <stephen@xemacs.org> wrote:
>  > whether we are better off leaving -Q to mean EVERYTHING at its
>  > default state and doing something else, like having the custom
>  > functions do something other than raise an error when code tries to
>  > save custom values under -Q
>
> Of course that's what it means.  So the problem is what do you do when
> what you need to do *requires* changing state?  I think it's plausible
> that almost anything to do with mail will *require* changes to the -Q
> state before you get useful behavior.
>

Agree, but perhaps disagree on how those changes occur. I would prefer
that the individual has to explicitly (even manually) make those
changes rather than have emacs attempt to anticipate what the user may
need when running under a -Q environment. Of course, the downside with
this approach is that those who are less comfortable/familiar with
emacs will find this difficult.

> Note that saving custom values does not change the -Q environment.
> It's just that you're unlikely to bother saving in the virgin -Q
> environment (you can always reproduce that with -Q!), so an attempt to
> save pretty much implies you've already changed state in a significant
> way.
>

I guess your saying that saving and setting are different operations
and saving without setting would not affect the current environment?
What I'm not clear about is where you would save the values to. The
default location I gues swould be the users .emacs file. However,
quite a few users also customize this and have the custom variable
stuff in a different file because they don't want it mixed up with
other stuff in .emacs. Now we have a problem. The -Q switch does not
read the .emacs file and therefore we cannot tell which aproach this
user prefers and therefore, don't know where we should save these
values to. This is why I don't understand what 'save' means in this
context or how it would work. Worse yet would be a situation where the
user becomes confused when they believe they have saved settings while
under -Q, but then next time they run emacs (with or without -Q) their
changes have not been saved.  To some extent, I would guess this is
primarily why you would argue for an error rather than a warning -
making it very clear to the user their save action has failed?

>  > (maybe a warning they are not saved rather than an error) or
>  > perhaps it al> Tim Cross writes:
>
>  > I *think* I agree, though am not clear what 'saving' means compared to
>  > 'setting' within the context of the -Q switch
>
> I think it should mean an error, while the maintainers seem to be (and
> Lars clearly is) happy with a warning.  Nobody *wants* silence.
>

I'm divided on error v's warning. On one hand, an error is good as it
grabs user attention and makes it clear the values have not been saved
- avoiding later confusion. The downside is that it can make the code
more complex for developers when -Q is invoked. On the other hand, it
could be argued that as this is a known and understood situation, a
warning is sufficient. The advantage is that some code would become
less complex. The downside is that users may easily overlook the error
and then get confused when their settings don't seem to be persisting
over sessions etc.

I personally think an error is better. However, I also don't fully
understand how often package maintainers run into problems
initializing their packages when they are run under -Q. If this
problem is relatively rare and really only comes up when you would
like a package to have some level of functionality under -Q and that
can only be achieved by setting values, then an error would certainly
seem to be the right choice. However, if this is a frequent issue and
an error is resulting in frequently more complex initialization code,
then there could be a case to downgrade it to a warning. On the other
hand, I would be tempted to look at refactoring how defaults and
custom work as this would indicate a deeper design issue IMO.

>  > OK, but that does not affect my point regarding the importance of -Q
>  > representing a standard, well defined and consistent configuration.
>
> Right.  I think there is consensus on that.  My point is simply that
> in many cases, -Q will not be a useful environment.  Lars proposes to
> make it somewhat more useful, at the cost of complexifying the
> behavior of custom-save-variable, and making pollution of the -Q
> environment a bit less painful.

Yes - I worry about it becoming easier to pollute the -Q environment
and whether this will reuslt in -Q becoming less useful over time. I
think it is reasonable to expect the -Q environment to be less
'useful' than the standard environment. It is a special purpose
environment and losing some functionality in such an environment is
acceptable - especially if the lost functionality is functionality
that depends on local configuration.

>
> My position is that the code needs refactoring, because I don't like
> the idea of facilitating exceptions here, and I think that changing
> `custom-save-variable' will make doing customizations in the -Q
> environment more attractive.  But that doesn't seem to be the position
> of the maintainers.
>

It would seem we are of similar opinions. I too am concerned that
making it easier for code to change custom variables under -Q
environments will result in -Q losing its important quality of
representing a standard default environment. The suggested changes to
custom functions certainly feels wrong in the sense that it seems to
be muddying their definition and making matters more complex than
desirable. I also suspect that the desire to make -Q more functional
may be misplaced.

I guess we will have to wait and see what evolves.

Tim



  reply	other threads:[~2011-07-13 23:46 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
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 [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CAC=50j8C_0HOUHXvU3ucQ+DMB7k8mS9tE80xdYH_DpHkX-bKPg@mail.gmail.com' \
    --to=theophilusx@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=stephen@xemacs.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).