unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: 48176@debbugs.gnu.org
Subject: bug#48176: 28.0.50; loadup.el leaves some variables in the lexical environment
Date: Mon, 03 May 2021 10:09:00 +0200	[thread overview]
Message-ID: <87tunkdysj.fsf@gnus.org> (raw)
In-Reply-To: <wvr48s4w7qvr.fsf@gmail.com> (Philipp Stephani's message of "Sun,  02 May 2021 23:44:08 +0200")

Philipp Stephani <p.stephani2@gmail.com> writes:

> After starting Emacs, some spurious variables like `output' or `success'
> are bound.  It looks like they come from loadup.el. 

Oh, interesting.  So it's these that are in the lexical environment when
we're dumping:

    (let ((output (cond ((equal dump-mode "pdump") "emacs.pdmp")
[...]
      (let (success)
        (unwind-protect
             (let ((tmp-dump-mode dump-mode)
                   (dump-mode nil))
               (if (member tmp-dump-mode '("pdump" "pbootstrap"))
                   (dump-emacs-portable (expand-file-name output invocation-directory))
                 (dump-emacs output "temacs")

I guess we could rename the variables to something with a private
prefix, but that's kinda hacky.  Do we have a way to remove some symbols
from the lexical environment?  I.e., extend `dump-emacs-portable' to
take a list of symbols to remove from the dumped lexical environment?
Or...  should the dumper just set the variable to (t)?  (I'm not very
familiar with the internals of how that's supposed to work...)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2021-05-03  8:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-02 21:44 bug#48176: 28.0.50; loadup.el leaves some variables in the lexical environment Philipp Stephani
2021-05-03  8:09 ` Lars Ingebrigtsen [this message]
2021-05-03  8:19   ` Philipp
2022-07-01 11:20   ` Lars Ingebrigtsen

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=87tunkdysj.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=48176@debbugs.gnu.org \
    --cc=p.stephani2@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 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).