unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6578: 24.0.50; defcustom :set does not apply to `set-variable'
@ 2010-07-07  4:52 Drew Adams
  2019-08-21 22:52 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2010-07-07  4:52 UTC (permalink / raw)
  To: 6578

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






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#6578: 24.0.50; defcustom :set does not apply to `set-variable'
  2010-07-07  4:52 bug#6578: 24.0.50; defcustom :set does not apply to `set-variable' Drew Adams
@ 2019-08-21 22:52 ` Lars Ingebrigtsen
  2019-08-21 23:39   ` Drew Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2019-08-21 22:52 UTC (permalink / raw)
  To: Drew Adams; +Cc: 6578

"Drew Adams" <drew.adams@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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#6578: 24.0.50; defcustom :set does not apply to `set-variable'
  2019-08-21 22:52 ` Lars Ingebrigtsen
@ 2019-08-21 23:39   ` Drew Adams
  0 siblings, 0 replies; 3+ messages in thread
From: Drew Adams @ 2019-08-21 23:39 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 6578

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-21 23:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-07  4:52 bug#6578: 24.0.50; defcustom :set does not apply to `set-variable' Drew Adams
2019-08-21 22:52 ` Lars Ingebrigtsen
2019-08-21 23:39   ` Drew Adams

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