Subject: Re: bug#79124: emacs -Q doesn't give me a clean slate

From: Eli Zaretskii <[email-masked]>
Date: Wed, 30 Jul 2025 15:15:49 +0300

> Date: Tue, 29 Jul 2025 16:59:23 -0700
> From: Paul Eggert <[email-masked]>
> 
> Over the years Emacs has come slurp more and more files from the user's 
> home directory, which is fine except that 'emacs -Q' is supposed to 
> suppress this sort of thing, partly to help debugging so that one can 
> easily have a clean Emacs to test with.
> 
> Unfortunately, nowadays 'emacs -Q' now has some questionable accesses to 
> configuration files or caches. I did an "cd /tmp" followed by an "strace 
> emacs -Q -nw" using Emacs master (on Fedora 42) where I immediately 
> typed C-x C-c to exit, and found that Emacs accessed or attempted to 
> access the following files under my home directory. -Q should disable 
> these accesses; or if -Q is not the right way to do that, there should 
> be an easy way to tell Emacs "start with a clean slate; don't access any 
> of my startup configuration or cache or whatever".
> 
> .abbrev_defs
> .emacs.d
> .emacs.d/
> .emacs.d/./
> .emacs.d/abbrev_defs

This is because we load abbrevs at startup, even under -Q.  That was
added in Nov 2001:

  commit ac3186fd96de9332bbeb4c7bf1f7ac66de26752a
  Author:     Richard M. Stallman <[email-masked]>
  AuthorDate: Sun Nov 11 01:53:31 2001 +0000
  Commit:     Richard M. Stallman <[email-masked]>
  CommitDate: Sun Nov 11 01:53:31 2001 +0000

      (command-line): Read standard abbrev
      file (abbrev-file-name), if it exists.

I couldn't find any discussion why this was added.  Perhaps Richard
remembers why he added that, and whether doing this under -Q was on
purpose or an omission?

> .emacs.d/auto-save-list/.saves-67042-penguin.cs.ucla.edu~

This is because we want to support recovering crashed sessions, even
with -Q.  Not sure this is wrong.

> .emacs.d/eln-cache/
> .emacs.d/eln-cache/31.0.50-6ea53a16/
> .emacs.d/eln-cache/31.0.50-6ea53a16/ansi-color-75eac800-a71f27cf.eln
> .emacs.d/eln-cache/31.0.50-6ea53a16/ansi-osc-b447f6a8-8febe2b9.eln
> .emacs.d/eln-cache/31.0.50-6ea53a16/byte-opt-9c5f25f5-7cc5ddb7.eln
> .emacs.d/eln-cache/31.0.50-6ea53a16/bytecomp-12882072-8edd60a1.eln
> .emacs.d/eln-cache/31.0.50-6ea53a16/cl-lib-8b938900-a571fbf6.eln
> .emacs.d/eln-cache/31.0.50-6ea53a16/cl-loaddefs-310c8015-a1d7aa30.eln
> .emacs.d/eln-cache/31.0.50-6ea53a16/comint-faef15ad-bfa1fb2f.eln
> .emacs.d/eln-cache/31.0.50-6ea53a16/comp-common-6e17f702-933f2808.eln
> .emacs.d/eln-cache/31.0.50-6ea53a16/comp-run-a15747ee-efc134fc.eln
> .emacs.d/eln-cache/31.0.50-6ea53a16/compile-91e1c2a0-9cbeba37.eln
> .emacs.d/eln-cache/31.0.50-6ea53a16/gv-e0cf7478-71e25e63.eln
> .emacs.d/eln-cache/31.0.50-6ea53a16/ring-bff0b981-036e8192.eln
> .emacs.d/eln-cache/31.0.50-6ea53a16/rx-627d8c83-9aae5e83.eln
> .emacs.d/eln-cache/31.0.50-6ea53a16/subr-x-02dfef32-97626417.eln
> .emacs.d/eln-cache/31.0.50-6ea53a16/text-property-search-db1383f6-03526671.eln
> .emacs.d/eln-cache/31.0.50-6ea53a16/time-date-40951a48-4999dc2b.eln

These are natively-compiled Lisp packages.  I'm guessing that, since
you've started a -nw session, Emacs needed to load the support library
for the terminal you are using, which triggered the JIT native
compilation of that library and all the libraries it depends on.  So
this is normal, and has nothing to do with -Q: Emacs must load the
Lisp packages needed for its operation.

> .terminfo

I guess this is from some curses library, not from Emacs per se.