[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: custom-set-variables considered harmful
From: |
Eli Zaretskii |
Subject: |
Re: custom-set-variables considered harmful |
Date: |
Mon, 04 Dec 2017 17:36:30 +0200 |
> From: Stefan Monnier <address@hidden>
> Date: Mon, 04 Dec 2017 08:48:06 -0500
>
> Based on the feedback, I added a config var to control the use of `setq'.
> I also added a backward compatibility hack which makes it so that your
> "new style config" will partly work in Emacs<27.
Thanks.
> Any objection to installing the patch below into `master`?
No objections from me, but:
. please add :version tags to defcustoms
. please add some documentation, including a NEWS entry
A couple of nits about doc strings below.
> +(defcustom custom-mimic-plain-elisp nil
> + "If non-nil, save user settings with the new format.
IME, saying "new" in documentation is not a very good idea: it conveys
no useful information, and after some time it is no longer "new". How
about something like the below?
If non-nil, save user settings using format that mimics hand-written code.
Then you could lose the next sentence of the doc string:
> +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)."
This sounds like a comment, not sure if it will be useful to users.
> +(defcustom custom-mimic-plain-elisp-use-setq nil
> + "If non-nil, use `setq' when possible in generated code.
I'd suggest "in code generated by `custom-mimic-plain-elisp'".
> +(defmacro custom-autogenerated-user-settings (&rest body)
> + "Install user customizations of variable values specified in ARGS.
Ehm... which "ARGS" are those? There's just BODY.