3 ms·
The one problem I have with the trusted files thing is that I have no way to trust non-file-visiting buffers. Why is *scratch* untrusted!? *scratch* should alwa
by accelbred 6mo ago
The one problem I have with the trusted files thing is that I have no way to trust non-file-visiting buffers. Why is *scratch* untrusted!? *scratch* should always be trusted, without me having to configure anything, ideally. Though a setting to automatically trust non-file-visiting buffers would be nice.
I just ended up stopping using the scratch buffer because of that issue.
- eshelyaron 6mo agoRight, the fact that the initial scratch buffer is untrusted is a bug AFAICT. I'm considering adding a workaround to this issue in trust-manager, although ideally it should (also) be solved upstream.
- pkal 6mo agoShouldn't something like this fix the problem, at least for scratch buffers: (add-hook 'lisp-interaction-mode-hook (lambda () (setq-local trusted-content :all)))
- eshelyaron 6mo agoPretty sure that's unsafe, don't do that. Only the scratch buffer is to be exempted, not every buffer that gets this mode.
- rpdillon 6mo agoAgree. This is probably better: (with-current-buffer "*scratch*" (setq-local trusted-content :all))
- pkal 6mo agoIn practice this should also work. Do keep in mind if you just add this to your init.el then this will not persist if you re-create the scratch buffer. If we are already experimenting with different ideas, this should also work (and gives a hint of how you want to fix the issue upstream): (define-advice get-scratch-buffer-create (:filter-return (buf) trusted) (with-current-buffer buf (setq-local trusted-content :all)) buf)
- pkal 6mo agoDo note that I only configure this for `lisp-interaction-mode', which in practice really only gets used for the *scratch* buffer. But there are a few other instances in core that also use it, and if that concerns you, you can extend the above snippet with a check like (when (equal (buffer-name) "*scratch*") ...)
- quotemstr 6mo agoBecause the Emacs trust model is incoherent.
- nacozarina 6mo agonow now don’t insult the emacs mafia