unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Noam Postavsky <npostavs@users.sourceforge.net>
Cc: 4755@debbugs.gnu.org
Subject: bug#4755: 23.1; case where `C-M-x' on defcustom doesn't seem to work
Date: Tue, 5 Jul 2016 11:20:33 -0700 (PDT)	[thread overview]
Message-ID: <53a1717b-a62f-43af-9864-4c8b44bd7469@default> (raw)
In-Reply-To: <CAM-tV-90tk83Njdzs5WW5zThs9fkT6xAFXGVdafm4_3woKgJHg@mail.gmail.com>

> > The "original value" should not change, and especially not just
> > by using `C-h v'.  It is wrong to say the "original value was"
> > something that it never was and still is not!  I don't see any
> > evidence that that behavior is "expected" or is by design.
> >
> >> So perhaps the thing to be fixed is that describe-variable
> >> should say "Standard value" rather than "Original value".
> >
> > I don't see how that would help.
> 
> It will help by not misleading you into thinking that Emacs is showing
> you the original value.

It's not showing you the original Lisp expression either, and
users will not have a clue what "standard value" means.  (I'm
not sure I really do.)  It is apparently a value obtained by
reevaluating the defcustom.

> > The doc you quote says that the std value is recomputed
> > _by Customize_, by reevaluating the saved expression.
> > Why should that affect `C-h v'?
> 
> They both use the same `standard-value' as the "original"
> (but yes, I only know this because I read the code).

Yes, I know.  But is that TRT?  If it is then the help should
make much clearer what it is showing (and why).

IOW, it is showing what the value WOULD BE if the original
Lisp expression were reevaluated in the current context.

If it's doing that, maybe it would be good to say that that
is what it's doing, and to also show the original Lisp sexp?
 
> > I'm guessing that these problems arise because there is
> > a type mismatch.  But they still shouldn't manifest this
> > way, I think.
> 
> No, sorry about this type mismatch, it's a complete red
> herring. Let's simplify to:
> 
> (defcustom time (current-time-string)
>   "the time"
>   :type 'string)
> 
> Basically the problem stems from passing a non-pure expression
> (meaning one that doesn't always give an `equal' result) as the
> STANDARD argument to defcustom. Actually, since so many places seem to
> assume they will always get the same result, I wonder why the
> expression rather than the result of evaluating it is being stored.

I can see why the expression would be stored.  I'm not sure I see
why the expression is not shown to users via `C-h v', and I'm not
sure why the expression is reevaluated by `C-h v' (see above).

But a (copy-sequence...) sexp is pure as far as the top-level
sequence structure is concerned.  The individual list elements
are shared, OK, but the top-level list structure is not - it is
new conses.

I don't think that's the problem.  The problem is that the
defining sexp gets reevaluated, so the new `foo' sequence gets
copied by reevaluating (copy-sequence...), and the result is
shown as the "original" (or standard) value of `toto'.

That can only be confusing to users, I think.






  reply	other threads:[~2016-07-05 18:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-19  0:21 bug#4755: 23.1; case where `C-M-x' on defcustom doesn't seem to work Drew Adams
2016-07-05  4:14 ` npostavs
2016-07-05 14:30   ` Drew Adams
2016-07-05 17:00     ` Noam Postavsky
2016-07-05 17:30       ` Drew Adams
2016-07-05 17:56         ` Noam Postavsky
2016-07-05 18:20           ` Drew Adams [this message]
2016-07-09  3:14             ` npostavs

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=53a1717b-a62f-43af-9864-4c8b44bd7469@default \
    --to=drew.adams@oracle.com \
    --cc=4755@debbugs.gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /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).