From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: 'Emacs Devel' <emacs-devel@gnu.org>
Subject: Re: A fundamental problem with defcustoms that are lists
Date: Sat, 06 Sep 2008 20:59:38 +0200 [thread overview]
Message-ID: <48C2D31A.1000804@gmail.com> (raw)
In-Reply-To: <001901c9104f$fe082fe0$0200a8c0@us.oracle.com>
Drew Adams wrote:
>> If you have a defcustom which uses variable length lists
>> (defcustom my-option
>> :type '(repeat ...))
>>
>> then you may want the default values from the list but also
>> add some of your own.
>>
>> If you customize such an option and the default values are changed you
>> will not notice because when your setting is used Emacs never sees the
>> changes in default.
>>
>> This mean that any enhancements or bug corrections to the default will
>> never be used.
>>
>> Wouldn't it be worthwhile to give some way to add entries at the
>> begining or end of the list but add those to the default value instead
>> of just replacing the default value?
> The default value of a list option is typically not just a starting point to add
> to but is a default value to replace.
Why do you think so?
There are certainly situation when this is the case, but I can without
doubt point to other where instead the default value is useful and it is
natural to complement it, not replace it.
> What you raise is the difference between a
> default value that is a list and a list that includes a minimum set of values by
> default, that is, a list of default values.
>
> In the latter case, a library can do something like this:
>
> (defvar foo-defaults '(a b c) "List of default values")
> (defcustom foo-extras () "Your added values"
> :type '(repeat ...))
> (setq foo (append foo-defaults foo-extras))
I can see your idea (but it should not be handled the way you propose
above, use :set instead).
But that would not give the same flexibility as what I propose.
Here is my proposal a bit more concretely expressed:
- In the values stored for a list (ie type 'repeat) for a defcustom
allow a value 'custom-insert-default to insert the default value for the
'repeat list.
Is that clear? Of course the UI have to provide functionality for this too.
next prev parent reply other threads:[~2008-09-06 18:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-06 17:34 A fundamental problem with defcustoms that are lists Lennart Borgman (gmail)
2008-09-06 18:40 ` Drew Adams
2008-09-06 18:59 ` Lennart Borgman (gmail) [this message]
2008-09-06 19:56 ` Drew Adams
2008-09-06 20:04 ` Lennart Borgman (gmail)
2008-09-06 20:13 ` Stefan Monnier
2008-09-06 21:45 ` martin rudalics
2008-09-06 22:28 ` Lennart Borgman (gmail)
2008-09-07 4:01 ` Stefan Monnier
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=48C2D31A.1000804@gmail.com \
--to=lennart.borgman@gmail.com \
--cc=drew.adams@oracle.com \
--cc=emacs-devel@gnu.org \
/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).