Subject: Re: bug#77666: Question/discussion about `trusted-content'

From: Eli Zaretskii <[email-masked]>
Date: Wed, 09 Apr 2025 18:44:14 +0300

> From: Dominik Schrempf <[email-masked]>
> Cc: Stefan Monnier <[email-masked]>,  [email-masked]
> Date: Wed, 09 Apr 2025 16:22:58 +0200
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >>     Use abbreviated file names.  For example, an entry "~/mycode/" means
> >>     that Emacs will trust all the files in your directory "mycode".
> >>
> >> Why is this second requirement in place?
> >
> > For speed, I believe.  (But Stefan will correct me if I'm wrong.)
> 
> Do you mean comparing "/home/user/mycode" is slower than comparing
> "~/mycode/"?

No, but comparing "~/mycode" with "/home/user/mycode" is slower, if we
want them to compare equal.

> > HOME-relative file names are considered absolute file names in Emacs:
> >
> >   (file-name-absolute-p "~/.emacs.d/")
> >    => t
> 
> Thank you, I didn't know that. Does this make sense? The file will be
> different for two different users, which is not the case for absolute
> file names in the classical sense.

There's only one user in a given Emacs session.

Outside of Emacs, these will be different file names, but since Emacs
always records the abbreviated name, it will become ~/something only
for the user of the current Emacs session; file names relative to HOME
of other users will remain in their absolute form.

> > Emacs always abbreviates HOME-relative file names, so adhering to that
> > convention means we can compare file names as strings, instead of
> > using file-truename (which hits the disk) and similar APIs to
> > "normalize" the file names before comparing.
> 
> Thanks for your explanation.
> 
> I believe that by now, we are having a discussion about two different
> but somewhat related concepts: "absolute" vs "relative" filenames and
> the "true" vs "real" filenames.
> 
> I still wanted to state that the term "true filename" confused me and is
> still confusing me. I think it should be "real", at least to me this
> seems more of a Linux/Unix? standard.

Emacs predates realpath and friends, so we had this terminology first,
and we cannot change it now, since it's so old.