From: Drew Adams <drew.adams@oracle.com>
To: Eli Zaretskii <eliz@gnu.org>,
Noam Postavsky <npostavs@users.sourceforge.net>
Cc: 23926@debbugs.gnu.org
Subject: bug#23926: defcustom with STANDARD=<non-pure-expression> gives confusing results
Date: Sun, 10 Jul 2016 10:23:13 -0700 (PDT) [thread overview]
Message-ID: <33b89b73-733f-42a1-9d26-eb0ed3c8d9cc@default> (raw)
In-Reply-To: <fdca925b-a904-48fb-bc53-425dd59e10cf@default>
> IOW, let's try to be clear with the labelling in `C-h v' -
> consistent with the names used in Customize. And let's try to
> let users of `C-h v' get more info about what they're looking
> at, to dispel confusion and answer questions.
>
> I think we should also have `C-h v' provide the underlying
> Lisp expression, at least on demand, just as Customize does.
> It's not great to show only a value without any indication
> of what it comes from.
...
> That is what needs to be made clear to users, I think, when
> showing them a value. Let them know that it is called the
> "standard value", and it is the result of re-evaluating, in
> the current context, the defining Lisp sexp for the option
> (which is used in the defcustom).
>
> All of this is important for clarity. In particular, I think
> it is important that users understand the following, which is
> I guess what is behind Eli saying that the behavior is as
> expected:
>
> ;; The reason for storing values unevaluated: This is so you can have
> ;; values that depend on the environment. For example, you can have a
> ;; variable that has one value when Emacs is running under a window
> ;; system, and another value on a tty. Since the evaluation is only done
> ;; when the variable is first initialized, this is only relevant for the
> ;; saved (and standard) values, but affect others values for
> ;; compatibility.
>
> The premise of that last sentence is wrong, of course. It is done
> each time you use `C-h v' - to show you the "original" value.
>
> But the main point here is that it is a _feature_, not a bug, that
> the "standard value" is recomputed at any time from the original sexp.
> Why/how this is a feature is explained well in that paragraph.
>
> But without such an explanation, and especially just showing a
> value in `C-h v' and calling it the "original" value, we hurt
> instead of help users.
>
> ;; You can see (and modify and save) this unevaluated value by selecting
> ;; "Show Saved Lisp Expression" from the Lisp interface. This will
> ;; give you the unevaluated saved value, if any, otherwise the
> ;; unevaluated standard value.
>
> And that's the other piece that helps understanding. I think
> `C-h v' should show users that Lisp sexp - at least on demand.
>
> That will also help understanding of the standard value that is
> shown (and should be labeled as such): `C-h v' can say that this
> is the result of re-evaluating the Lisp sexp.
Here are a couple proposals for how to fix the `C-h v' part of
this bug. Others are welcome.
1. Not print the "original value" at all, as was the case before
Emacs 24. Let users get such info from Customize.
2. Like #1, but give users a hint that such info is in fact
available from Customize. My suggestion here would be to not
only remove printing the "original value" but to change the text
"You can customize this variable.", where `customize' is a link to
Customize, with this text, all of it a link with the same target:
Customize or inspect
(or possibly "Inspect or customize"). The point is for the
link text to indicate that the target (Customize for the option)
is not only for changing the value but also for finding out more
about the option and its customization.
3. Like #1 and #3, but also provide a (toggle) link to show the
defining Lisp sexp for the default value or, if it is shown,
to reevaluate it and show the result:
Show Lisp sexp defining the default value
(if not shown) and
Reevaluate
(if shown - displayed just above it, in place of "Show Lisp sexp
defining the default value").
I think any of these would improve the `C-h v' doc, especially for
this situation where the Lisp sexp can return different values.
If you decide to go for any of these approaches I could work on
a patch.
(Note that this mail is only about the `C-h v' part of the bug.
It does not address the part that concerns how the Customize UI
talks about the state - see my previous message about that part.)
next prev parent reply other threads:[~2016-07-10 17:23 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-09 3:11 bug#23926: defcustom with STANDARD=<non-pure-expression> gives confusing results Noam Postavsky
2016-07-09 6:31 ` Drew Adams
2016-07-09 7:13 ` Eli Zaretskii
2016-07-09 11:54 ` npostavs
2016-07-09 12:31 ` Eli Zaretskii
2016-07-09 12:55 ` Noam Postavsky
2016-07-09 13:14 ` Eli Zaretskii
2016-07-09 13:48 ` Noam Postavsky
2016-07-09 14:03 ` Eli Zaretskii
2016-07-12 3:26 ` npostavs
2016-07-12 5:20 ` Eli Zaretskii
2016-07-09 14:34 ` Drew Adams
[not found] ` <<8360sehps4.fsf@gnu.org>
2016-07-09 14:54 ` Drew Adams
2016-07-09 15:09 ` Drew Adams
2016-07-10 17:23 ` Drew Adams [this message]
2023-10-17 14:19 ` bug#23926: defcustom with STANDARD=<non-constant-expression> " Mauro Aranda
2023-10-17 14:29 ` Mauro Aranda
[not found] <<<<<CAM-tV-8cG3gLgf-A+wBYPZWNy2WPGFV3uEdNE7=ad3oq4rXmnw@mail.gmail.com>
[not found] ` <<<<<83vb0fgu83.fsf@gnu.org>
[not found] ` <<<<443f2e44-5167-48e7-abc6-cce1e243461e@default>
[not found] ` <<<<8337nihpdw.fsf@gnu.org>
[not found] ` <<<c0dd88c2-51ef-4f4f-964c-f0254db970f7@default>
[not found] ` <<<83zipqg3e3.fsf@gnu.org>
[not found] ` <<ff33c2cc-337a-433b-a87a-0ea1814311d2@default>
[not found] ` <<83bn24c8io.fsf@gnu.org>
2016-07-12 0:53 ` bug#23926: defcustom with STANDARD=<non-pure-expression> " Drew Adams
[not found] <<<CAM-tV-8cG3gLgf-A+wBYPZWNy2WPGFV3uEdNE7=ad3oq4rXmnw@mail.gmail.com>
[not found] ` <<<83vb0fgu83.fsf@gnu.org>
[not found] ` <<443f2e44-5167-48e7-abc6-cce1e243461e@default>
[not found] ` <<8337nihpdw.fsf@gnu.org>
2016-07-09 14:59 ` Drew Adams
2016-07-09 16:52 ` Eli Zaretskii
2016-07-09 20:48 ` npostavs
2016-07-10 14:19 ` Eli Zaretskii
[not found] ` <<871t32ilm0.fsf@users.sourceforge.net>
[not found] ` <<83k2gtfue4.fsf@gnu.org>
2016-07-10 17:18 ` Drew Adams
2016-07-11 18:40 ` Eli Zaretskii
[not found] <<CAM-tV-8cG3gLgf-A+wBYPZWNy2WPGFV3uEdNE7=ad3oq4rXmnw@mail.gmail.com>
[not found] ` <<83vb0fgu83.fsf@gnu.org>
2016-07-09 14:09 ` Drew Adams
2016-07-09 14:12 ` Eli Zaretskii
[not found] ` <<c0dd88c2-51ef-4f4f-964c-f0254db970f7@default>
[not found] ` <<83zipqg3e3.fsf@gnu.org>
2016-07-10 17:18 ` Drew Adams
2016-07-11 18:52 ` Eli Zaretskii
[not found] <<<<CAM-tV-8cG3gLgf-A+wBYPZWNy2WPGFV3uEdNE7=ad3oq4rXmnw@mail.gmail.com>
[not found] ` <<<<83vb0fgu83.fsf@gnu.org>
[not found] ` <<<443f2e44-5167-48e7-abc6-cce1e243461e@default>
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=33b89b73-733f-42a1-9d26-eb0ed3c8d9cc@default \
--to=drew.adams@oracle.com \
--cc=23926@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=npostavs@users.sourceforge.net \
/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.