unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 15718@debbugs.gnu.org
Subject: 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)	[thread overview]
Message-ID: <8ca67758-a213-4172-a029-defe1fc552c8@default> (raw)
In-Reply-To: <877e7f5e69.fsf@mouse.gnus.org>

> > 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.





      reply	other threads:[~2019-08-15  4:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-25 15:44 bug#15718: 24.3.50; `C-M-x' does not work, with `defcustom' inside `when' Drew Adams
2019-08-15  2:57 ` Lars Ingebrigtsen
2019-08-15  4:41   ` Drew Adams [this message]

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=8ca67758-a213-4172-a029-defe1fc552c8@default \
    --to=drew.adams@oracle.com \
    --cc=15718@debbugs.gnu.org \
    --cc=larsi@gnus.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).