emacs-devel
[Top][All Lists]
Advanced

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

RE: [External] : Re: Comments on setopt


From: Drew Adams
Subject: RE: [External] : Re: Comments on setopt
Date: Sat, 19 Feb 2022 23:42:58 +0000

> The point is that we need a variant of `setq'
> for user options that people can use when
> saying `M-:' and in init files

We do?  Since when?  And why?

If we "need" that then why wasn't it proposed
and discussed somewhere?  (Was it?)

I've perused this thread but haven't seen any
proposal for `setopt' here either, or any
explanation for why it should be (was?) added.
I may have just not noticed it...(?).

I searched for "setopt" at the emacs-devel
archives, and that search found only this post
from 2007:

https://lists.gnu.org/archive/html/emacs-devel/2007-04/msg01534.html

Clearly I don't know how to use the Search box.
___

Is this just about an alias for
`customize-set-variable'?  Apparently not, and
the difference is apparently (?) that this
won't change the user theme.  That, and this
apparently won't be a command, so you can't
use `M-x' with it (?).

Whoever (Chong perhaps?) added changing the
user theme to `customize-set-variable' thought
that was appropriate.

I don't care about that, personally.  But if
you think we "need" a function that does what
`customize-set-variable' does but doesn't
affect the user theme, then...

> so it needs to be short and snappy.

It needs to be short & snappy for `M-:'?  Why?

`M-:' is for evaluating all kinds of Lisp
sexps.  Why does this, in particular, need a
short name?

If this is about being able to _only_ set an
option value interactively, then what's wrong
with a command? (`M-x customize-set-variable')

> `seto' and `setc' were proposed, but I thought
> those were too confusing.

It seems that `setopt' can also confuse.

And adding that function to `set-variable',
`customize-set-variable', `customize-set-value',
and `custom-set-variables' invites even more
confusion.

In the 2017 thread "custom-set-variables
considered harmful" there was talk of wanting
a shorter name for `custom-set-variables':

https://lists.gnu.org/archive/html/emacs-devel/2017-12/msg00048.html

And there was talk of a new function (with a
short name) that does, for options, what
`custom-set-variables' does, but does for
non-options what `setq' does.  For many use
cases users could just use that new function.

Is that what your `setopt' does?  Why not?
And why isn't it also a command?

Why wasn't there any proposal & discussion
for this (if I'm right that there was none)?

We have these commands: `customize-set-value',
`customize-set-variable', `set-variable', and
`customize-save-variable'.  And we have this
non-interactive function: `custom-set-variables'.

What more is really needed?  Just what is
`setopt' for, and exactly what does it do?
(No, I'm not going to download the code for
Emacs 29 to try to figure it out.)
___

There's also bug (enhancement request) #6578,
which asked to have `set-variable' respect a
defcustom :set.  You didn't want to do that.

That ER also asked to better document
`customize-set-variable'.  It isn't even
documented as such in the manuals (Emacs &
Elisp).  No wonder users don't use it as
much as they might.

Instead, the Emacs manual touts `set-variable',
even though it'll get you in trouble because
of :set.

 "The most convenient way to set a specific
  customizable variable is with 'M-x set-variable'."

ER #6578 also suggested:

 "harmonizing behavior/features ... among
  `set-variable', `customize-set-variable',
  and `customize-set-value'.

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

You closed #6578, with the only reason given
that `set-variable' does what it's doc says it
does.  (Uh, yeah, its doc would need to reflect
its enhancement of respecting :set.)
___

There have also been requests (e.g. bug #26910)
to have `customize-set-variable' optionally
type-check the supplied value.

That too went nowhere.  And yet, if it's to be
used as a replacement for the Customize UI, it
really needs to _be able_ to type-check, no?

In that bug thread there was also suggestion to
provide a function like `custom-set-variables',
but which would optionally type-check each
variable setting that has a `NOW' element.
That too went nowhere (not even a response).

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26910#8
___

So now we have `setopt'.

Yesterday, we had daily cleaning.  And tomorrow
morning, we shall have what to do after firing.
But today, today we have `setopt'.



reply via email to

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