Make eshell buffers always trusted

This commit is contained in:
Alexander Rosenberg 2025-01-03 15:12:19 -08:00
parent 966c3392aa
commit 96c175e0bb
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

@ -204,8 +204,13 @@ Each element in this list is:
(boolean :tag "Negated")))) (boolean :tag "Negated"))))
:risky t) :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 (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. "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 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 run. If any function returns non-nil, the current buffer is considered safe