From: Mauro Aranda <maurooaranda@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 30101@debbugs.gnu.org, tim@tim-landscheidt.de
Subject: bug#30101: 25.3; defcustom does not clear old :options when reevaluated
Date: Sat, 29 Aug 2020 13:17:18 -0300 [thread overview]
Message-ID: <CABczVwcG4uWZL0TYu82=_R_vw75UNmmrduqmw+9Di-7GbLW9Tg@mail.gmail.com> (raw)
In-Reply-To: <83y2lxxxwb.fsf@gnu.org>
[-- Attachment #1.1: Type: text/plain, Size: 2262 bytes --]
Eli Zaretskii <eliz@gnu.org> writes:
>> * doc/lispref/customize.texi (Defining Customization Variables):
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> The name in parentheses should be the name of the node, not of the
> section.
Right, sorry.
>> +Re-evaluating a @code{defcustom} form of an already defined user
>> +option does not clear the reasonable values added by previous
>> +evaluations, or by calls to @code{custom-add-frequent-value}. This
>> +way, Lisp programs can add reasonable values for user options not yet
>> +defined.
>
> This doesn't emphasize the fact that you are talking about
> reevaluation after changing the option's values. Without that, this
> text doesn't drive the point home.
Then perhaps it makes sense to split the paragraph, and talk about that
when describing the :options keyword? I did that in this new patch.
> Also, I'd suggest to drop the "reasonable" part, as it gets in the way
> of understanding the important parts by distracting the reader to
> think about what "reasonable" means in this context.
Fair enough. Dropped it.
>> --- a/lisp/custom.el
>> +++ b/lisp/custom.el
>> @@ -578,9 +578,14 @@ custom-add-dependencies
>> (defun custom-add-option (symbol option)
>> "To the variable SYMBOL add OPTION.
>>
>> +Custom then presents OPTION to the user as a suggested member
>> +for the value of SYMBOL.
>> +
>> If SYMBOL's custom type is a hook, OPTION should be a hook member.
>> -If SYMBOL's custom type is an alist, OPTION specifies a symbol
>> -to offer to the user as a possible key in the alist.
>> +If SYMBOL's custom type is an alist, OPTION specifies a possible key
>> +in the alist.
>> +Similarly, if SYMBOL's custom type is a plist, OPTION specifies
>> +a possible name in the plist.
>> For other custom types, this has no effect."
>
> I don't think I understand what this tries to accomplish, or how it is
> relevant to the issue discussed here.
The docstring didn't mention what was the effect if SYMBOL was a plist,
so I thought I'd take the chance of improving the docstring for the
function that also affects the suggested values. But maybe that can be
left for another patch, so I dropped it in this new one.
Thanks for reviewing, I hope this patch is better.
[-- Attachment #1.2: Type: text/html, Size: 2784 bytes --]
[-- Attachment #2: 0001-Improve-documentation-for-custom-options.patch --]
[-- Type: text/x-patch, Size: 1503 bytes --]
From 14c226017b0e868cf68aef8f4d3b9a1e8cd94ab7 Mon Sep 17 00:00:00 2001
From: Mauro Aranda <maurooaranda@gmail.com>
Date: Sat, 29 Aug 2020 13:07:32 -0300
Subject: [PATCH] Improve documentation for custom :options
* doc/lispref/customize.texi (Variable Definitions):
Mention that re-evaluating a defcustom form doesn't reset custom
options. (Bug#30101)
---
doc/lispref/customize.texi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi
index 2a72276bc5..fcfc0d297e 100644
--- a/doc/lispref/customize.texi
+++ b/doc/lispref/customize.texi
@@ -358,6 +358,10 @@ Variable Definitions
@code{hook}, @code{plist} and @code{alist}. See the definition of the
individual types for a description of how to use @code{:options}.
+Re-evaluating a @code{defcustom} form with a different :options value
+does not clear the values added by previous evaluations, or by
+calls to @code{custom-add-frequent-value} (see below).
+
@item :set @var{setfunction}
@kindex set@r{, @code{defcustom} keyword}
Specify @var{setfunction} as the way to change the value of this
@@ -485,6 +489,10 @@ Variable Definitions
The precise effect of adding a value depends on the customization type
of @var{symbol}.
+
+Since evaluating a @code{defcustom} form does not clear values added
+previously, Lisp programs can use this function to add values for user
+options not yet defined.
@end defun
Internally, @code{defcustom} uses the symbol property
--
2.28.0
next prev parent reply other threads:[~2020-08-29 16:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-13 22:14 bug#30101: 25.3; defcustom does not clear old :options when reevaluated Tim Landscheidt
2018-01-14 20:32 ` Tim Landscheidt
2018-01-15 5:16 ` Eli Zaretskii
2020-08-29 15:11 ` Mauro Aranda
2020-08-29 15:41 ` Eli Zaretskii
2020-08-29 16:17 ` Mauro Aranda [this message]
2020-09-01 15:00 ` Lars Ingebrigtsen
2020-09-01 20:23 ` Mauro Aranda
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CABczVwcG4uWZL0TYu82=_R_vw75UNmmrduqmw+9Di-7GbLW9Tg@mail.gmail.com' \
--to=maurooaranda@gmail.com \
--cc=30101@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=tim@tim-landscheidt.de \
/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 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).