all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Weiner <rsw@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: custom-set-variables considered harmful
Date: Mon, 4 Dec 2017 11:05:32 -0500	[thread overview]
Message-ID: <CA+OMD9jvLvHewcD6JwPvLY+Z_rFeUf1ocW148G4zFL1vhcOq9Q@mail.gmail.com> (raw)
In-Reply-To: <jwvo9nefvzv.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1865 bytes --]

On Mon, Dec 4, 2017 at 8:48 AM, Stefan Monnier <monnier@iro.umontreal.ca>
wrote:

> Any objection to installing the patch below into `master`?
>
>         Stefan
>
>
> +(defcustom custom-mimic-plain-elisp nil

+  "If non-nil, save user settings with the new format.
> +This new format tries to mimick the code that would be written by hand
> +in plain Elisp.  But it relies on `custom-autogenerated-user-settings'
> which
> +is a new macro in Emacs-27, so settings saved with this will not work
> +reliably in Emacs<27 (although a backward compatibility trick is used
> +which should make them work to some extent)."
>


I think there must be a better way to name what you are doing here
and to explain it in the doc string.  Generally, a reader won't
know what 'new format' or 'plain Elisp' mean.  See if you can
define and clarify them.  Also, the mimic term just feels unfamiliar
vis-a-vis the rest of the Emacs code base.


> +  :type 'boolean
> +  :group 'customize)
>

​Don't we typically add '-flag​' for booleans nowadays?

​​
> +
> ​
>
> +
> ​​
> (defcustom custom-mimic-plain-elisp-use-setq nil
> +
> ​​
>   "If non-nil, use `setq' when possible in generated code.
> +
> ​​
> If nil, `custom-mimic-plain-elisp' will only use `customize-set-variable',
> ​​
> +
> ​​
> which is the more reliable option."
>

​Here the documentation is much clearer but the naming could still
be improved.  What about, `custom-use-setq-flag'?  And clarify
the contexts where this is used, does it apply to the let bindings
that RMS mentioned?


> +(defun custom--mimic-plain-elisp (symbol exp requests comment)
>

​Since this prints things, its name should mention that.
How about, 'custom--print-option-setter'?
​
Thanks for developing this and all your great work.

Bob

[-- Attachment #2: Type: text/html, Size: 5236 bytes --]

  parent reply	other threads:[~2017-12-04 16:05 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
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 [this message]
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=CA+OMD9jvLvHewcD6JwPvLY+Z_rFeUf1ocW148G4zFL1vhcOq9Q@mail.gmail.com \
    --to=rsw@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --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.