GNU bug report logs - #6578
24.0.50; defcustom :set does not apply to `set-variable'

Previous Next

Package: emacs;

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

Date: Wed, 7 Jul 2010 04:54:01 UTC

Severity: wishlist

Tags: notabug

Found in version 24.0.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 6578 in the body.
You can then email your comments to 6578 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 owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6578; Package emacs. (Wed, 07 Jul 2010 04:54: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. (Wed, 07 Jul 2010 04:54: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.0.50; defcustom :set does not apply to `set-variable'
Date: Tue, 6 Jul 2010 21:52:59 -0700
[Tried to send this earlier, but there was a mail delivery problem, for some
reason.  Trying again.]

----

If you use a :set entry for defcustom, it is not respected by
`set-variable'.  It should be.  When a user uses `M-x set-variable' s?he
should get the effect of :set.  Otherwise, the defcustom is not serving
its purpose.  defcustom is not only for Customize - it needs to work
with `set-variable' also.  And it does, for :type; but it does not, for
:set.

In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2010-06-28 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4) --no-opt --cflags -Ic:/xpm/include'
 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#6578; Package emacs. (Wed, 21 Aug 2019 22:53:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 6578 <at> debbugs.gnu.org
Subject: Re: bug#6578: 24.0.50; defcustom :set does not apply to `set-variable'
Date: Wed, 21 Aug 2019 15:52:33 -0700
"Drew Adams" <drew.adams <at> oracle.com> writes:

> [Tried to send this earlier, but there was a mail delivery problem, for some
> reason.  Trying again.]
>
> ----
>
> If you use a :set entry for defcustom, it is not respected by
> `set-variable'.  It should be.  When a user uses `M-x set-variable' s?he
> should get the effect of :set.  Otherwise, the defcustom is not serving
> its purpose.  defcustom is not only for Customize - it needs to work
> with `set-variable' also.  And it does, for :type; but it does not, for
> :set.

This is apparently by design:

----
Note that this function is at heart equivalent to the basic ‘set’ function.
For a variable defined with ‘defcustom’, it does not pay attention to
any :set property that the variable might have (if you want that, use
M-x customize-set-variable instead).
----

So I'm closing this bug report.

-- 
(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. (Wed, 21 Aug 2019 22:53:04 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 6578 <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. (Wed, 21 Aug 2019 22:53:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#6578; Package emacs. (Wed, 21 Aug 2019 23:40:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 6578 <at> debbugs.gnu.org
Subject: RE: bug#6578: 24.0.50; defcustom :set does not apply to `set-variable'
Date: Wed, 21 Aug 2019 16:39:12 -0700 (PDT)
> > If you use a :set entry for defcustom, it is not
> > respected by `set-variable'.  It should be.  When
> > a user uses `M-x set-variable' s?he should get the
> > effect of :set.  Otherwise, the defcustom is not
> > serving its purpose.  defcustom is not only for
> > Customize - it needs to work with `set-variable'
> > also.  And it does, for :type; but it does not,
> > for :set.
> 
> This is apparently by design:
> 
> ----
> Note that this function is at heart equivalent to the basic ‘set’
> function.
> For a variable defined with ‘defcustom’, it does not pay attention to
> any :set property that the variable might have (if you want that, use
> M-x customize-set-variable instead).
> ----

I know (and knew) that the behavior is documented.
That doesn't mean it's good.  This is an enhancement
request: it "_should_" provide the effect of :set.

Anything else is just a gotcha, inviting problems.

We document the weak behavior, because it is what it
is.  We should document it, whatever it is.  That
doesn't make it good.

What's more, `customize-set-variable' isn't even
documented in the Emacs or Elisp manuals.

`set-variable' is (in the Emacs manual), and it even
has an index entry.  What's more, (emacs) `Examining'
says that "The most convenient way to set a specific
customizable variable is with `set-variable'.

That's an endorsement/recommendation, and it can get
users into trouble.

That doc should perhaps use `customize-set-variable'
instead.  More generally, perhaps some harmonizing
of behavior/features is in order, among `set-variable',
`customize-set-variable', and `customize-set-value'.

Users can be excused for being confused, and they
can get into trouble when they set an option value
using just `set-variable' or `setq', if it has a
:set function.

Emacs should be enhanced to clear up the confusing
differences and clear up the doc recommendations.

> So I'm closing this bug report.

Unfortunate.  Someone might have implemented the
enhancement someday.




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

This bug report was last modified 5 years and 272 days ago.

Previous Next


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