summaryrefslogtreecommitdiff
path: root/wttrin.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-09-24 06:56:35 -0500
committerCraig Jennings <c@cjennings.net>2025-09-24 06:56:35 -0500
commitc9c75c0fe256856488e9bafc77a6071f1c039808 (patch)
tree100bd366267eebac295605e7372dc2cbb75047b9 /wttrin.el
parent43a040f11daf4971af0c02b3f67f050ef19eaaa1 (diff)
don't mutate url-request-extra-headers
- bind it locally instead within the let form
Diffstat (limited to 'wttrin.el')
-rw-r--r--wttrin.el14
1 files changed, 7 insertions, 7 deletions
diff --git a/wttrin.el b/wttrin.el
index 0577d1f..ffb3218 100644
--- a/wttrin.el
+++ b/wttrin.el
@@ -92,13 +92,13 @@ units (default)."
(defun wttrin-fetch-raw-string (query)
"Get the weather information based on your QUERY."
- (let ((url-user-agent "curl"))
- (add-to-list 'url-request-extra-headers wttrin-default-languages)
- (with-current-buffer
- (url-retrieve-synchronously
- (concat "http://wttr.in/" query "?A")
- (lambda () (switch-to-buffer (current-buffer))))
- (decode-coding-string (buffer-string) 'utf-8))))
+ (let ((url-request-extra-headers (list wttrin-default-languages))
+ (url-user-agent "curl"))
+ (with-current-buffer
+ (url-retrieve-synchronously
+ (concat "http://wttr.in/" query "?A")
+ (lambda () (switch-to-buffer (current-buffer))))
+ (decode-coding-string (buffer-string) 'utf-8))))
(defun wttrin-exit ()
"Exit the wttrin buffer."