aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEllis Kenyo <me@elken.dev>2025-10-31 13:48:13 +0000
committerEllis Kenyo <me@elken.dev>2025-11-04 05:29:15 +0000
commiteaa710ac612ef55f3c052c264a1e078743521d8d (patch)
tree66a0637ab58cbfd2e336830be69a7cade8dd63cf
parentbdd14b96faa54807a4f822d4ddea1680f1bfd6c7 (diff)
Disable flymake in scratch buffers
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] https://github.com/emacs-mirror/emacs/commit/8b6c6cffd1f7
-rw-r--r--perspective.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/perspective.el b/perspective.el
index 62ad179..a0f0427 100644
--- a/perspective.el
+++ b/perspective.el
@@ -312,7 +312,12 @@ Create it if the current perspective doesn't have one yet."
(when (and (zerop (buffer-size))
initial-scratch-message)
(insert (substitute-command-keys initial-scratch-message))
- (set-buffer-modified-p nil))))
+ (set-buffer-modified-p nil))
+ ;; Turn flymake off to prevent the annoying error in the
+ ;; minibuffer
+ (when (and (require 'flymake nil t)
+ (boundp flymake-mode))
+ (flymake-mode -1))))
scratch-buffer))
(defun persp-switch-to-scratch-buffer ()