unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: gerd.moellmann@gmail.com, 66742@debbugs.gnu.org
Subject: bug#66742: 30.0.50; transient-mark-mode is not enabled after re-dumping Emacs
Date: Thu, 26 Oct 2023 16:10:53 +0300	[thread overview]
Message-ID: <83zg05fs0y.fsf@gnu.org> (raw)
In-Reply-To: <87r0lhblje.fsf@localhost> (message from Ihor Radchenko on Thu, 26 Oct 2023 12:44:37 +0000)

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: gerd.moellmann@gmail.com, 66742@debbugs.gnu.org
> Date: Thu, 26 Oct 2023 12:44:37 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> Actually, I think that I will not be wrong to say that (defvar foo
> >> <value>. ..), (defcustom foo <value> ...), and similar expressions are
> >> often assumed to evaluated in the same Emacs session that will use the
> >> library.
> >
> > There should be no such assumption, and so you will be wrong saying
> > that.  We actually try paying attention to this aspect when reviewing
> > patches where a defcustom has a default value that is not a constant,
> > precisely for this reason.
> 
> This is a surprise to me!
> Is it documented anywhere?

What do you want to document?

> I thought that we should expect the value to
> be evaluated unless explicitly wrapped into (eval-when-compile ...).

At what time do you think defcustom's value is evaluated?

> Also, I just looked up defvar instances across Emacs and I am seeing
> multiple cases when the value is calculated dynamically, assuming
> loading time:

Of course, it's loading time.  But AFAIU you were talking about
evaluation during dumping, i.e. when Emacs is built.  This is only
relevant for defcustom's in packages that are preloaded, because those
packages are loaded at build time, not at run time.  So for those
packages, and only for those packages, any defcustom whose default
value is not a constant, should be re-evaluated at startup, to make
sure the value is suitable for the system on which Emacs runs.

> cvs-diff-program, diff-use-changed-face, url-mime-encoding-string,
> url-dav-lock-identifier, type-break-time-last-command,
> reftex-section-numbers, ispell-library-directory, artist-pointer-shape,
> so-long-version, shadow-system-name, bdf-cache-file,
> vhdl-mode-menu-list, sh-shell, js-js-tmpdir, gud-sdb-needs-tags,
> tetris-next-x, tetris-score-y, <a number of Org mode variables>,
> vip-startup-file, vi-scroll-amount, tramp-cache-read-persistent-data,
> tramp-archive-enabled, socks-username, newsticker--latest-update-time,
> dictionary-color-support, mh-uncompface-executable, mh-swish++-binary,
> mh-swish-binary, mh-mairix-binary, mh-namazu-binary, mh-grep-binary,
> mh-spamassassin-executable, mh-sa-learn-executable,
> mh-bogofilter-executable, mh-spamprobe-executable, mh-pgp-support-flag,
> kkc-init-file-name, image-dired-queue-active-limit,
> mm-temp-files-cache-file, erc-autoaway-last-sent-time,
> viper-custom-file-name, viper-current-frame-saved,
> copyright-current-year, cl--random-state (!!! that can easily cause
> subtle issues), dframe-have-timer-flag, todo-files, todo-archives,
> todo-done-separator, diary-font-lock-keywords, math-expr-opers,
> calc-gnuplot-display, archive-7z-program.

This is not relevant, since packages that aren't preloaded will be
loaded at run time, and therefore the values will be evaluated in the
correct context.  If you are talking about these, then I don't
understand what prompted you to raise this issue to begin with, and in
a thread that discusses dumping.





  reply	other threads:[~2023-10-26 13:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25  9:26 bug#66742: 30.0.50; transient-mark-mode is not enabled after re-dumping Emacs Ihor Radchenko
2023-10-26  9:11 ` Gerd Möllmann
2023-10-26 11:42   ` Ihor Radchenko
2023-10-26 12:06     ` Eli Zaretskii
2023-10-26 12:44       ` Ihor Radchenko
2023-10-26 13:10         ` Eli Zaretskii [this message]
2023-10-26 13:15           ` Eli Zaretskii
2023-10-27  9:04             ` Ihor Radchenko
2023-10-27 10:37               ` Eli Zaretskii
2023-10-27 10:53                 ` Ihor Radchenko
2023-10-27 10:56                   ` Eli Zaretskii
2023-10-27 10:59                   ` Mauro Aranda
2023-10-27 11:08                     ` Ihor Radchenko
2023-10-26 13:25           ` Ihor Radchenko
2023-10-26 13:31             ` Eli Zaretskii

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=83zg05fs0y.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=66742@debbugs.gnu.org \
    --cc=gerd.moellmann@gmail.com \
    --cc=yantar92@posteo.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 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).