all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: 23926@debbugs.gnu.org
Cc: Eli Zaretskii <eliz@gnu.org>, Noam Postavsky <npostavs@gmail.com>,
	Drew Adams <drew.adams@oracle.com>
Subject: bug#23926: defcustom with STANDARD=<non-constant-expression> gives confusing results
Date: Tue, 17 Oct 2023 11:19:25 -0300	[thread overview]
Message-ID: <cabc1078-eaf2-4ef4-9c18-8b48ad67765d@gmail.com> (raw)
In-Reply-To: <CAM-tV-8cG3gLgf-A+wBYPZWNy2WPGFV3uEdNE7=ad3oq4rXmnw@mail.gmail.com>

I took a look at this Bug Report and all of the discussion.

I do agree with Eli that passing to default the following
(current-time-string) is quite nonsensical, but I understand that the
reproducer was just to show a way to see some inconsistency happening.

So I set out to look if there are occurrences like that in current Emacs
sources.  And there is one comparable:

(defcustom archive-tmpdir
   ;; make-temp-name is safe here because we use this name
   ;; to create a directory.
   (make-temp-name
    (expand-file-name (if (eq system-type 'ms-dos) "ar" "archive.tmp")
              temporary-file-directory))
   "Directory for temporary files made by `arc-mode.el'."
   :type 'directory)

That expression will evaluate to something different every time.  So, to
see the problems reported here, in actual Emacs source code:
emacs -Q
(require 'arc-mode)
C-h v archive-tmpdir
See that "the original value", as claimed incorrectly by C-h v (I agree
with Drew here about this terminology being non-accurate) is different
from the value of archive-tmpdir.

Kill the *Help* buffer and do again:
C-h v archive-tmpdir
The value of archive-tmpdir is the same, of course, but not "the
original value".

M-x customize-option RET archive-tmpdir
will show, as reported, that archive-tmpdir was changed outside of
Customize.  That's not true, it's just that the standard-value changed,
and there's no support for that.  Those two things are different to me.


I'm not saying that there's need to code something in Custom to handle these
cases.  At least, I'm not yet convinced.  But the case of archive-tmpdir
shows us, I think, that something needs to be done.  For example, change
the standard value to something that doesn't change that often, or
use the exact same form but wrap the defcustom in a let form, so that
a constant expression gets saved as the standard-value.






  parent reply	other threads:[~2023-10-17 14:19 UTC|newest]

Thread overview: 27+ 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
2023-10-17 14:19 ` Mauro Aranda [this message]
2023-10-17 14:29   ` bug#23926: defcustom with STANDARD=<non-constant-expression> " 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>
2016-07-09 14:59       ` bug#23926: defcustom with STANDARD=<non-pure-expression> " 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=cabc1078-eaf2-4ef4-9c18-8b48ad67765d@gmail.com \
    --to=maurooaranda@gmail.com \
    --cc=23926@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=npostavs@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.