aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilfred Hughes <me@wilfred.me.uk>2018-01-11 23:02:42 +0000
committerWilfred Hughes <me@wilfred.me.uk>2018-01-11 23:03:57 +0000
commite1b660e2a48b39b0a81119c2593362dd60076757 (patch)
treeed947cf6210be5d71ded0be5c2c19d11b82a7061
parent1b8a99a6c3857ecd09bf39702158939d3c3af63d (diff)
Don't prompt the user about unsafe buffer-local variables0.6
When we are opening a buffer for source code, we're essentially in batch mode.
-rw-r--r--CHANGELOG.md3
-rw-r--r--helpful.el9
2 files changed, 10 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 96ed360..ea45cf8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -29,6 +29,9 @@ least recently accessed. Previously, we killed in creation order.
If a function also has a unit test of the same name, allow it to be
run directly from the property list.
+Fixed an issue where we would repeatedly prompt the user regarding
+unsafe buffer-local variables.
+
# v0.5
Allow function tracing to be enabled/disabled from Helpful buffers.
diff --git a/helpful.el b/helpful.el
index 2af81d1..fe44102 100644
--- a/helpful.el
+++ b/helpful.el
@@ -788,7 +788,11 @@ buffer."
;;
;; Bind `auto-mode-alist' to nil, so we open the buffer in
;; `fundamental-mode' if it isn't already open.
- (let (auto-mode-alist)
+ (let (auto-mode-alist
+ ;; Don't both setting buffer-local variables, it's
+ ;; annoying to prompt the user since we immediately
+ ;; discard the buffer.
+ enable-local-variables)
(setq buf (find-file-noselect (find-library-name path))))
(unless (-contains-p initial-buffers buf)
@@ -800,7 +804,8 @@ buffer."
;; table for searching.
(when opened
(with-current-buffer buf
- (delay-mode-hooks (normal-mode))))
+ (let (enable-local-variables)
+ (delay-mode-hooks (normal-mode t)))))
;; Based on `find-function-noselect'.
(with-current-buffer buf