Skip to content

Comments

Trust the default perspective scratch buffer contents#220

Merged
gcv merged 1 commit intonex3:masterfrom
elken:master
Nov 4, 2025
Merged

Trust the default perspective scratch buffer contents#220
gcv merged 1 commit intonex3:masterfrom
elken:master

Conversation

@elken
Copy link
Contributor

@elken elken commented Oct 31, 2025

Without this, by default trying to interact with a new perspective
puts the "Disabline elisp-flymake-byte-compile due to untrusted
content" message to popup in the minibuffer creating an annoying UX.

Regular scratch should trusted in Emacs[1][2] but that doesn't propogate
here

[1] https://lists.gnu.org/archive/html/emacs-devel/2025-02/msg01023.html
[2] emacs-mirror/emacs@8b6c6cffd1f7

elken added a commit to elken/emacs that referenced this pull request Oct 31, 2025
Temporary fix until nex3/perspective-el#220 is merged
elken added a commit to elken/emacs that referenced this pull request Oct 31, 2025
Temporary fix until nex3/perspective-el#220 is merged
@gcv
Copy link
Collaborator

gcv commented Oct 31, 2025

I just read the mailing list thread, and have more questions than answers from it. Is there maybe an official function that we can call that makes a new scratch buffer we can call that does the official right thing? I don't feel comfortable setting such a sensitive setting on the user's behalf.

@elken
Copy link
Contributor Author

elken commented Oct 31, 2025

Doesn't look like it no, lisp-interaction-mode should be setting it as well but it doesn't seem to be.

Maybe a less-destructive solution here is putting it behind a defcustom that's nil by default? persp-trust-scratch-buffers or something

@gcv
Copy link
Collaborator

gcv commented Oct 31, 2025

Since flymake seems to be the only reason this warning shows up, how about we just disable it for perspective scratch buffers? It should be a very uninvasive change.

@elken
Copy link
Contributor Author

elken commented Nov 1, 2025

Sensible change if that fixes it, I'll test it today 👍

@elken elken force-pushed the master branch 2 times, most recently from 41456b0 to 9a0cb48 Compare November 3, 2025 11:20
@elken
Copy link
Contributor Author

elken commented Nov 3, 2025

Thanks for the suggestion @gcv, this seems to also fix it!

Please do test yourself to verify but I'm happy this also works 😄

@gcv
Copy link
Collaborator

gcv commented Nov 3, 2025

I’m not sure when flymake-mode was added to Emacs, but just in case, can we only run that deactivation when the flymake-mode function is definitely available?

@elken
Copy link
Contributor Author

elken commented Nov 4, 2025

First added in Emacs 23, but yes it's a trivial addition 😄

Without this, by default trying to interact with a new perspective
puts the "Disabline elisp-flymake-byte-compile due to untrusted
content" message to popup in the minibuffer creating an annoying UX.

Regular scratch should trusted in Emacs[1][2] but that doesn't pass
through here, so because it's not needed we disable it by default.

[1] https://lists.gnu.org/archive/html/emacs-devel/2025-02/msg01023.html
[2] emacs-mirror/emacs@8b6c6cffd1f7
@gcv gcv merged commit 7f47c9a into nex3:master Nov 4, 2025
7 checks passed
@gcv
Copy link
Collaborator

gcv commented Nov 4, 2025

Looks good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants