bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#4755: 23.1; case where `C-M-x' on defcustom doesn't seem to work


From: Drew Adams
Subject: bug#4755: 23.1; case where `C-M-x' on defcustom doesn't seem to work
Date: Tue, 5 Jul 2016 10:30:33 -0700 (PDT)

> > `foo', not `toto' was customized, and the Value shown
> > here is correct. But the "Original value" is incorrect.
> > The "Original value" shown is the new, current value
> > of `foo'.  `toto' never had, as still does not have,
> > that "Original value".
> 
> Ah, but this appears to be expected behaviour:
> 
>     (defcustom SYMBOL STANDARD DOC &rest ARGS)
> 
>     [...]
>     STANDARD is an expression specifying the variable's standard
>     value.  It should not be quoted.  It is evaluated once by
>     `defcustom', and the value is assigned to SYMBOL if the variable
>     is unbound.  The expression itself is also stored, so that
>     Customize can re-evaluate it later to get the standard value.
>     DOC is the variable documentation.
> 
> Compare what happens with:
> 
> (defcustom time (current-time)
>   "the time"
>   :type '(list integer))

I don't see why any of that indicates that what I described
is "expected".  But it does seem to confirm that there are
problems.

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.

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'?

Also, `M-x customize-option time' shows this, which seems
wrong.  Seems like `C-h v' is taken as changing the value
outside customize?

 State : CHANGED outside Customize. (mismatch)

I have not reevaluated the defcustom at all.  All I did
was evaluate it once and then use `C-h v time' a few times.

Anyway, there is a type mismatch.  You should have used
:type '(list integer integer integer integer).

But even so, it does not seem right that a type mismatch
should mess things up so much.

For example, the State menu shows the item `Show Saved
Lisp Expression' _disabled_.  And it shows item `Revert
This Session's Customization', even though I have done no
customization.  And if I choose `Revert...' there is no
change in the menu.

I'm guessing that these problems arise because there is
a type mismatch.  But they still shouldn't manifest this
way, I think.

Seems buggy.  I did this with emacs -Q, with this Emacs 25
build:

In GNU Emacs 25.1.50.1 (i686-pc-mingw32)
 of 2015-12-10
Repository revision: 6148555ee5a3d0139ae517803718b3e0357933c7
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
Configured using:
 'configure --prefix=/c/Devel/emacs/snapshot/trunk --enable-checking=yes
 --enable-check-lisp-object-type --without-compress-install 'CFLAGS=-Og
 -ggdb3' LDFLAGS=-Lc:/Devel/emacs/lib 'CPPFLAGS=-DGC_MCHECK=1
 -Ic:/Devel/emacs/include''

Seems like we've stumbled on more than one bug here?

Correcting the :type and trying again, with a new variable
named `atime', I still see the State as CHANGED outside Customize.

And again, that's just by evaluating the defcustom once and
doing `C-h v' a couple times.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]