From 96c175e0bba903668091885ca9af8a3911ac2c5d Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Fri, 3 Jan 2025 15:12:19 -0800 Subject: [PATCH] Make eshell buffers always trusted --- elisp/trusted-files.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/elisp/trusted-files.el b/elisp/trusted-files.el index d5ac029..8ca86df 100644 --- a/elisp/trusted-files.el +++ b/elisp/trusted-files.el @@ -204,8 +204,13 @@ Each element in this list is: (boolean :tag "Negated")))) :risky t) +(defun trusted-files--eshell-buffer-p (buffer) + "Return non-nil if BUFFER is an `eshell' buffer." + (with-current-buffer buffer + (derived-mode-p 'eshell-mode))) + (defcustom trusted-files-always-trusted-buffer-functions - '(minibufferp) + '(minibufferp trusted-files--eshell-buffer-p) "A list of functions that are called to test if the current buffer is safe. When a buffer is tested for safety (via `trusted-files-safe-p'), this hook is run. If any function returns non-nil, the current buffer is considered safe