all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: rms@gnu.org, rswgnu@gmail.com
Cc: philippe.vaucher@gmail.com, lokedhs@gmail.com,
	monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: RE: custom-set-variables considered harmful
Date: Fri, 1 Dec 2017 17:58:23 -0800 (PST)	[thread overview]
Message-ID: <66c7b088-e9e9-4d31-b7e3-3c8f8b660814@default> (raw)
In-Reply-To: <E1eKvOE-00008g-KB@fencepost.gnu.org>

>> ​I have been wondering about this too.  Are there any arguments for
>> not having setq run the setter of a custom option when available?
> 
> That change would create a risk of bugs in many parts of the code.
> Each differnt kind of setter function creates a different risk of
> possible errors.
> 
> That change would mean that making an ordinary let binding could run
> arbitrary Lisp code.  Unwinding the binding could also run arbitrary
> Lisp code.
> 
> Finally, it could cause errors in places that set the variable and
> expect that to do nothing but put a new value in it.  This includes
> the definitions of setter functions, right?

As I said, I don't argue for doing this.

And yes, there would need to also be a "basic setq",
which has the current behavior, to be able to use in
custom functions (e.g. setters) and some other places.
I figured that much was obvious.

The other considerations you mention are less clear to me.

I suppose another possibility might be to come up with
another function, with a short name, that does what
we're talking about: does `customize-set-variable' for
an option (except in `custom*' code) and does `setq'
otherwise.  And then encourage people to use that new
function instead of `setq' most places.  I kinda doubt
that would help much, though.

But again, I'm not proposing any of this.  I mentioned
it only as food for thought.

The problem to solve (which is admittedly a small one,
since as Stefan pointed out most options don't use
special :set functions) is that users seem to often
use `setq' for options without even being aware of
`customize-set-variable' or why it might be needed in
some cases.



  reply	other threads:[~2017-12-02  1:58 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-04 17:10 custom-set-variables considered harmful Stefan Monnier
2017-11-06  9:02 ` Philippe Vaucher
2017-11-06 12:19   ` Clément Pit-Claudel
2017-11-06 16:36   ` raman
2017-11-07 19:53     ` Stefan Monnier
2017-11-08 10:06 ` Vivek Dasmohapatra
2017-11-08 13:38   ` Stefan Monnier
2017-11-08 14:23     ` Vivek Dasmohapatra
2017-11-08 15:17       ` Stefan Monnier
2017-11-08 15:34         ` Vivek Dasmohapatra
2017-11-13 16:26 ` Stefan Monnier
2017-11-24  7:04   ` Elias Mårtenson
2017-11-24  7:16     ` Stefan Monnier
2017-11-24 17:37       ` Clément Pit-Claudel
2017-11-24 17:56         ` Stefan Monnier
2017-11-26 12:15       ` Elias Mårtenson
2017-11-26 16:30         ` Drew Adams
2017-11-28 14:12         ` Philippe Vaucher
2017-11-28 16:50           ` John Wiegley
2017-12-01  9:44             ` Philippe Vaucher
2017-11-29  3:36           ` Elias Mårtenson
2017-11-29 15:00             ` Stefan Monnier
2017-11-29 15:03               ` Drew Adams
2017-12-01 20:42                 ` Robert Weiner
2017-12-02  0:10                   ` Richard Stallman
2017-12-02  1:58                     ` Drew Adams [this message]
2017-12-02  5:56                 ` Teemu Likonen
2017-11-29 16:35               ` Elias Mårtenson
2017-11-29 19:57                 ` Scott Randby
2017-11-29 22:08                   ` Stefan Monnier
2017-11-30  0:40                     ` Scott Randby
2017-12-01  9:51             ` Philippe Vaucher
2017-12-04 13:48   ` Stefan Monnier
2017-12-04 15:36     ` Eli Zaretskii
2017-12-04 16:05     ` Robert Weiner
2017-12-04 23:50     ` Richard Stallman
2017-12-05  1:45       ` Stefan Monnier
2017-11-23 20:12 ` John Wiegley

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=66c7b088-e9e9-4d31-b7e3-3c8f8b660814@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=lokedhs@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=philippe.vaucher@gmail.com \
    --cc=rms@gnu.org \
    --cc=rswgnu@gmail.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.