Skip to content

Commit

Permalink
Add message regarding verb-suppress-load-unsecure-prelude-warning
Browse files Browse the repository at this point in the history
  • Loading branch information
federicotdn committed Dec 21, 2024
1 parent 39d3232 commit 877cda7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions examples/prelude.el
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(setq my-variable "some value")
8 changes: 8 additions & 0 deletions examples/prelude.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* Prelude File Test :verb:
:properties:
:Verb-Prelude: prelude.el
:end:
post https://postman-echo.com/post
Content-Type: text/plain

{{my-variable}}
1 change: 0 additions & 1 deletion test/init.el
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

;; Set up Verb
(setq verb-auto-kill-response-buffers 3)
(setq verb-suppress-load-unsecure-prelude-warning t)

;; Keybindings
(with-eval-after-load 'org (define-key org-mode-map (kbd "C-c C-r") verb-command-map))
Expand Down
13 changes: 8 additions & 5 deletions verb.el
Original file line number Diff line number Diff line change
Expand Up @@ -1194,11 +1194,14 @@ This affects only the current buffer."
(setq file-extension (file-name-extension (file-name-base filename))))
(cond
((string= "el" file-extension) ; file is Emacs Lisp
(when (or verb-suppress-load-unsecure-prelude-warning
(yes-or-no-p
(concat (format "File %s may contain code " filename)
"that may not be safe\nLoad it anyways? ")))
(load-file filename)))
(if (or verb-suppress-load-unsecure-prelude-warning
(yes-or-no-p
(concat (format "File %s may contain code " filename)
"that may not be safe (see: "
"`verb-suppress-load-unsecure-prelude-warning')"
"\nLoad it anyways? ")))
(load-file filename)
(user-error "Operation cancelled")))
((string-match-p "^json.*" file-extension) ; file is JSON(C)
(let* ((file-contents
(with-temp-buffer
Expand Down

0 comments on commit 877cda7

Please sign in to comment.