]> git.notmuchmail.org Git - notmuch/commitdiff
Set 'untrusted-content' to t in all modes
authorStefan Kangas <stefankangas@gmail.com>
Wed, 12 Mar 2025 09:36:21 +0000 (06:36 -0300)
committerDavid Bremner <david@tethera.net>
Fri, 14 Mar 2025 11:51:02 +0000 (08:51 -0300)
Instead of trying to guess in which modes this is safe not to set in,
let's just set it in all of them.

Background (added by db):

untrusted-content was added in Emacs 29.3 and is currently set by Gnus
and used by org-mode to prevent certain unsafe operations. I think the
intent is to use it for blocking more unsafe operations in the future.

emacs/notmuch-hello.el
emacs/notmuch-mua.el
emacs/notmuch-show.el
emacs/notmuch-tree.el
emacs/notmuch.el

index 15ba7c7858af7f874a4e1a9857173a96c991050d..67c805a8549fd3f6d7eb0e9cff1e9f37b1c9be36 100644 (file)
@@ -760,7 +760,9 @@ The screen may be customized via `\\[customize]'.
 Complete list of currently available key bindings:
 
 \\{notmuch-hello-mode-map}"
-  (setq notmuch-buffer-refresh-function #'notmuch-hello-update))
+  (setq notmuch-buffer-refresh-function #'notmuch-hello-update)
+  (when (boundp 'untrusted-content)
+    (setq untrusted-content t)))
 
 ;;; Inserters
 
index a75b0f5c7a26ef0f9878d8a1c018a6323dff97e7..74c62aafd28d69eb5de5135ee4f9f53c481d72e4 100644 (file)
@@ -379,7 +379,9 @@ Typically this is added to `notmuch-mua-send-hook'."
 
 (define-derived-mode notmuch-message-mode message-mode "Message[Notmuch]"
   "Notmuch message composition mode. Mostly like `message-mode'."
-  (notmuch-address-setup))
+  (notmuch-address-setup)
+  (when (boundp 'untrusted-content)
+    (setq untrusted-content t)))
 
 (put 'notmuch-message-mode 'flyspell-mode-predicate 'mail-mode-flyspell-verify)
 
index 921c0ef1e4e339aa5d0366ef04b785f407ea60f8..8a8e6a7b00eaf3d5b65e472c920122fd8aa9d784 100644 (file)
@@ -1696,6 +1696,8 @@ All currently available key bindings:
   (setq notmuch-buffer-refresh-function #'notmuch-show-refresh-view)
   (setq buffer-read-only t)
   (setq truncate-lines t)
+  (when (boundp 'untrusted-content)
+    (setq untrusted-content t))
   (setq imenu-prev-index-position-function
        #'notmuch-show-imenu-prev-index-position-function)
   (setq imenu-extract-index-name-function
index 301ffd6e538bd91088751b97254baebe9cfd779a..aa0d92a75c8fa89698b5ea60b626cc271c27a9a7 100644 (file)
@@ -1095,6 +1095,8 @@ Complete list of currently available key bindings:
     (hl-line-mode 1))
   (setq buffer-read-only t)
   (setq truncate-lines t)
+  (when (boundp 'untrusted-content)
+    (setq untrusted-content t))
   (when notmuch-tree-outline-enabled (notmuch-tree-outline-mode 1)))
 
 (defvar notmuch-tree-process-exit-functions nil
index 5477bf4a715ecab5cc7d0e4ab7c9d9166aa46aa3..29b2a9ed1bc005b1589b13d3067892150d80a729 100644 (file)
@@ -416,6 +416,8 @@ Complete list of currently available key bindings:
   (add-to-invisibility-spec (cons 'ellipsis t))
   (setq truncate-lines t)
   (setq buffer-read-only t)
+  (when (boundp 'untrusted-content)
+    (setq untrusted-content t))
   (setq imenu-prev-index-position-function
        #'notmuch-search-imenu-prev-index-position-function)
   (setq imenu-extract-index-name-function