GNU bug report logs - #15718
24.3.50; `C-M-x' does not work, with `defcustom' inside `when'

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Fri, 25 Oct 2013 15:46:02 UTC

Severity: minor

Tags: notabug

Found in version 24.3.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15718 in the body.
You can then email your comments to 15718 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15718; Package emacs. (Fri, 25 Oct 2013 15:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 25 Oct 2013 15:46:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; `C-M-x' does not work, with `defcustom' inside `when'
Date: Fri, 25 Oct 2013 08:44:44 -0700 (PDT)
emacs -Q

(when t
  (defcustom foo nil
   "..."
   :type boolean))

M-x set-variable foo t

Put point on foo in the defcustom sexp, and do `C-M-x'.  `foo' is echoed
in the echo area, giving you the impression that the defcustom was
reevaluated, reinitializing `foo'.

C-h v foo ;; => t, not nil.

Without the `when', i.e., with the `defcustom' at top level, the value
is nil, as a user would expect.



In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
 of 2013-10-19 on LEG570
Bzr revision: 114715 rgm <at> gnu.org-20131019023520-s8mwtib7xcx9e05w
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15718; Package emacs. (Thu, 15 Aug 2019 02:58:01 GMT) Full text and rfc822 format available.

Message #8 received at 15718 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 15718 <at> debbugs.gnu.org
Subject: Re: bug#15718: 24.3.50; `C-M-x' does not work, with `defcustom'
 inside `when'
Date: Wed, 14 Aug 2019 19:57:02 -0700
Drew Adams <drew.adams <at> oracle.com> writes:

> emacs -Q
>
> (when t
>   (defcustom foo nil
>    "..."
>    :type boolean))
>
> M-x set-variable foo t
>
> Put point on foo in the defcustom sexp, and do `C-M-x'.  `foo' is echoed
> in the echo area, giving you the impression that the defcustom was
> reevaluated, reinitializing `foo'.
>
> C-h v foo ;; => t, not nil.
>
> Without the `when', i.e., with the `defcustom' at top level, the value
> is nil, as a user would expect.

I think this works as documented:

--
Evaluate the top-level form containing point, or after point.

If the current defun is actually a call to ‘defvar’ or ‘defcustom’,
evaluating it this way resets the variable using its initial value
expression (using the defcustom’s :set function if there is one), even
if the variable already has some other value.  (Normally ‘defvar’ and
‘defcustom’ do not alter the value if there already is one.)
--

So only if the def* is top-level does the magic DWIM value-setting thing
happen.

Closing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) notabug. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 15 Aug 2019 02:58:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 15718 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 15 Aug 2019 02:58:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15718; Package emacs. (Thu, 15 Aug 2019 04:42:01 GMT) Full text and rfc822 format available.

Message #15 received at 15718 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 15718 <at> debbugs.gnu.org
Subject: RE: bug#15718: 24.3.50; `C-M-x' does not work, with `defcustom'
 inside `when'
Date: Wed, 14 Aug 2019 21:41:37 -0700 (PDT)
> > emacs -Q
> >
> > (when t
> >   (defcustom foo nil
> >    "..."
> >    :type boolean))
> >
> > M-x set-variable foo t
> >
> > Put point on foo in the defcustom sexp, and do `C-M-x'.  `foo' is
> echoed
> > in the echo area, giving you the impression that the defcustom was
> > reevaluated, reinitializing `foo'.
> >
> > C-h v foo ;; => t, not nil.
> >
> > Without the `when', i.e., with the `defcustom' at top level, the
> value
> > is nil, as a user would expect.
> 
> I think this works as documented:
> 
> --
> Evaluate the top-level form containing point, or after point.
           ^^^^^^^^^^^^^^^^^^
> 
> If the current defun is actually a call to ‘defvar’ or ‘defcustom’,
> evaluating it this way resets the variable using its initial value
> expression (using the defcustom’s :set function if there is one), even
> if the variable already has some other value.  (Normally ‘defvar’ and
> ‘defcustom’ do not alter the value if there already is one.)
> --
> 
> So only if the def* is top-level does the magic DWIM value-setting
> thing happen.

Yes.  That's the problem.

This is an enhancement request - a request that it
instead work not just at the top level.

What's the reason why it should not "work" when
inside, say, `when'?  AFAIK, that feature just
hasn't been implemented yet.  Hence this request.
 
> Closing.

Unfortunate.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 12 Sep 2019 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 227 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.