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

From: Eli Zaretskii <[email-masked]>
Date: Thu, 31 Jul 2025 07:25:43 +0300

> Date: Wed, 30 Jul 2025 10:02:35 -0700
> Cc: [email-masked], [email-masked]
> From: Paul Eggert <[email-masked]>
> 
> On 2025-07-30 09:03, Eli Zaretskii wrote:
> > OTOH, it's quite annoying to type the same responses to the NSM
> > prompts when trying stuff in "emacs -Q".
> > 
> > There is "emacs -D", which perhaps could be more "pristine".  Patches
> > welcome.
> 
> Thanks for looking into it. As someone who merely wants to run Emacs in 
> a clean state I find all these options confusing. For example I didn't 
> know about -D, and I had forgotten about the $HOME trick. It would be 
> convenient to have an easy way to do all this stuff.

One only knows about that if one needs it.  This stuff is only useful
for Emacs hackers.

> How about a new option, say -R or --really-quick, that causes Emacs to 
> omit all this setup information so as to get a clean slate?

I'd prefer not to add another startup option.  Here, you didn't even
know about -D, so what are the chances someone else will know about
this new option?

Would it be possible to make -D omit those few accesses that it
doesn't now?

> It would 
> cause Emacs to not access anything under $HOME during setup, as well as 
> by doing everything that -Q and -D do, along with any similar options 
> (--no-desktop, --no-build-details, anything else?).

Well, "access nothing under $HOME" won't work with natively-compiled
Emacs, because it needs to access files in ~/.emacs.c/eln-cache/.  The
"-nw" session always does that, and even without -nw Emacs sometimes
does need to access that directory.  But otherwise, yes, we could
avoid loading abbrevs and auto-save-list files (which AFAIU are the
only other files read at startup under -Q).  Not sure what you want to
do about .terminfo.