From c9c75c0fe256856488e9bafc77a6071f1c039808 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 24 Sep 2025 06:56:35 -0500 Subject: don't mutate url-request-extra-headers - bind it locally instead within the let form --- wttrin.el | 14 +++++++------- 1 file 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." -- cgit v1.2.3