]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/files.el (untrusted-content): New variable.
authorIhor Radchenko <yantar92@posteo.net>
Tue, 20 Feb 2024 09:43:51 +0000 (12:43 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sat, 30 Mar 2024 19:30:18 +0000 (20:30 +0100)
The new variable is to be used when buffer contents comes from untrusted
source.

(cherry picked from commit ccc188fcf98ad9166ee551fac9d94b2603c3a51b)

lisp/files.el

index ccc48c470cc51808ff870db7bd7effdda26f2566..82544bd20be87c39f49aead952a081a27e68b897 100644 (file)
@@ -698,6 +698,14 @@ Also see the `permanently-enabled-local-variables' and
 Some modes may wish to set this to nil to prevent directory-local
 settings being applied, but still respect file-local ones.")
 
+(defvar-local untrusted-content nil
+  "Non-nil means that current buffer originated from an untrusted source.
+Email clients and some other modes may set this non-nil to mark the
+buffer contents as untrusted.
+
+This variable might be subject to change without notice.")
+(put 'untrusted-content 'permanent-local t)
+
 ;; This is an odd variable IMO.
 ;; You might wonder why it is needed, when we could just do:
 ;; (setq-local enable-local-variables nil)