Subject: Re: bug#74879: 30.0.92; trusted-content-p and trusted-files cannot be used for non-file buffers

From: Daniel Mendler <[email-masked]>
Date: Mon, 16 Dec 2024 10:43:16 +0100

Hello Stefan,

I just took another look at the `trusted-content-p' function on the
emacs-30 branch:

(defun trusted-content-p ()
  (and (not untrusted-content)
       buffer-file-truename
       ...))

There is a check for `buffer-file-truename' which means that the issue
with non-file-backed buffers remains (Ielm or scratch). Probably (eq
trusted-content :all) should be checked first?

(defun trusted-content-p ()
  (and (not untrusted-content)
       (or (eq trusted-content :all)
           (and buffer-file-name
                ...))))

At the same time one could consolidate the untrusted-content and
trusted-content variables as Eshel suggested?

(defun trusted-content-p ()
  (and (not untrusted-content) ;; only for backward compat (deprecated)
       (not (eq trusted-content :untrusted)) ;; replaces untrusted-content
       (or (eq trusted-content :all)
           (and buffer-file-name
                ...))))

Daniel