diff options
| author | Craig Jennings <c@cjennings.net> | 2025-09-24 06:56:35 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-09-24 06:56:35 -0500 |
| commit | c9c75c0fe256856488e9bafc77a6071f1c039808 (patch) | |
| tree | 100bd366267eebac295605e7372dc2cbb75047b9 /wttrin.el | |
| parent | 43a040f11daf4971af0c02b3f67f050ef19eaaa1 (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.el | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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." |
