emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/compat f1e9b67c74: compat-30: Rename trusted-content va


From: ELPA Syncer
Subject: [elpa] externals/compat f1e9b67c74: compat-30: Rename trusted-content variable
Date: Mon, 16 Dec 2024 06:57:40 -0500 (EST)

branch: externals/compat
commit f1e9b67c749ef12fe526dbe183c5f10da492fc88
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    compat-30: Rename trusted-content variable
---
 NEWS.org        |  4 ++++
 compat-30.el    |  8 ++++----
 compat-tests.el | 10 +++++-----
 compat.texi     |  4 ++--
 4 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/NEWS.org b/NEWS.org
index 1e24d5cc2d..3955b6bb28 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -2,6 +2,10 @@
 #+link:    compat-gh   https://github.com/emacs-compat/compat/issues/
 #+options: toc:nil num:nil author:nil
 
+* Development
+
+- compat-30: Rename =trusted-files= to =trusted-content=.
+
 * Release of "Compat" Version 30.0.1.0
 
 - compat-30: New variable =untrusted-content=.
diff --git a/compat-30.el b/compat-30.el
index 02ef4263ab..33305e3f88 100644
--- a/compat-30.el
+++ b/compat-30.el
@@ -59,7 +59,7 @@ See also `find-buffer-visiting'."
 
 ;;;; Defined in files.el
 
-(compat-defvar trusted-files nil ;; <compat-tests:trusted-files>
+(compat-defvar trusted-content nil ;; <compat-tests:trusted-content>
   "List of files and directories whose content we trust.
 Be extra careful here since trusting means that Emacs might execute the
 code contained within those files and directories without an explicit
@@ -79,7 +79,7 @@ all files, which opens a gaping security hole."
 (compat-defun trusted-content-p () ;; <compat-tests:trusted-content-p>
   "Return non-nil if we trust the contents of the current buffer.
 Here, \"trust\" means that we are willing to run code found inside of it.
-See also `trusted-files'."
+See also `trusted-content'."
   ;; We compare with `buffer-file-truename' i.s.o `buffer-file-name'
   ;; to try and avoid marking as trusted a file that's merely accessed
   ;; via a symlink that happens to be inside a trusted dir.
@@ -88,14 +88,14 @@ See also `trusted-files'."
        (with-demoted-errors "trusted-content-p: %S"
          (let ((exists (file-exists-p buffer-file-truename)))
            (or
-            (eq trusted-files :all)
+            (eq trusted-content :all)
             ;; We can't avoid trusting the user's init file.
             (if (and exists user-init-file)
                 (file-equal-p buffer-file-truename user-init-file)
               (equal buffer-file-truename user-init-file))
             (let ((file (abbreviate-file-name buffer-file-truename))
                   (trusted nil))
-              (dolist (tf trusted-files)
+              (dolist (tf trusted-content)
                 (when (or (if exists (file-equal-p tf file) (equal tf file))
                           ;; We don't use `file-in-directory-p' here, because
                           ;; we want to err on the conservative side: "guilty
diff --git a/compat-tests.el b/compat-tests.el
index b8ae0c14e8..0aa4e8ff1b 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -3235,11 +3235,11 @@
 (ert-deftest compat-untrusted-content ()
   (should (local-variable-if-set-p 'untrusted-content)))
 
-(ert-deftest compat-trusted-files ()
+(ert-deftest compat-trusted-content ()
   (static-if (< emacs-major-version 30) ;; TODO reenable on Emacs 30
       (progn
-        (should (boundp 'trusted-files))
-        (should (risky-local-variable-p 'trusted-files)))))
+        (should (boundp 'trusted-content))
+        (should (risky-local-variable-p 'trusted-content)))))
 
 (ert-deftest compat-trusted-content-p ()
   (static-if (< emacs-major-version 30) ;; TODO reenable on Emacs 30
@@ -3251,11 +3251,11 @@
         (let ((buffer-file-truename (expand-file-name "compat-tests.el")))
           (should-not (trusted-content-p)))
         (let ((buffer-file-truename (expand-file-name "compat-tests.el"))
-              (trusted-files '("compat-tests.el")))
+              (trusted-content '("compat-tests.el")))
           (should (trusted-content-p)))
         (let ((untrusted-content t)
               (buffer-file-truename (expand-file-name "compat-tests.el"))
-              (trusted-files '("compat-tests.el")))
+              (trusted-content '("compat-tests.el")))
           (should-not (trusted-content-p))))))
 
 (provide 'compat-tests)
diff --git a/compat.texi b/compat.texi
index e129a545a3..d4fef16b94 100644
--- a/compat.texi
+++ b/compat.texi
@@ -3333,7 +3333,7 @@ older than 30.1.  Note that due to upstream changes, it 
might happen
 that there will be the need for changes, so use these functions with
 care.
 
-@defvar trusted-files
+@defvar trusted-content
 List of files and directories whose content we trust.  Be extra careful
 here since trusting means that Emacs might execute the code contained
 within those files and directories without an explicit request by the
@@ -3352,7 +3352,7 @@ files, which opens a gaping security hole.
 @defun trusted-content-p
 Return non-nil if we trust the contents of the current buffer.  Here,
 "trust" means that we are willing to run code found inside of it.  See
-also @code{trusted-files}.
+also @code{trusted-content}.
 @end defun
 
 @c copied from lispref/nonascii.texi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]