GNU bug report logs - #74879
30.0.92; trusted-content-p and trusted-files cannot be used for non-file buffers

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Sun, 15 Dec 2024 00:40:02 UTC

Severity: normal

Found in version 30.0.92

Full log


Message #71 received at 74879 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 74879 <at> debbugs.gnu.org
Subject: Re: bug#74879: 30.0.92; trusted-content-p and trusted-files cannot
 be used for non-file buffers
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




This bug report was last modified 55 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.