aboutsummaryrefslogtreecommitdiff
path: root/wttrin.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-04-04 16:37:11 -0500
committerCraig Jennings <c@cjennings.net>2026-04-04 16:37:11 -0500
commit5463f104165185501be9cd6f7458d1b0cad856de (patch)
tree453cd364d6ec93325235037aab96158900f9271e /wttrin.el
parent73c81a00a10766900318d86640249d1b54c6b351 (diff)
downloademacs-wttrin-5463f104165185501be9cd6f7458d1b0cad856de.tar.gz
emacs-wttrin-5463f104165185501be9cd6f7458d1b0cad856de.zip
fix: weather buffer shows location in lowercase
wttr.in returns "Weather report: new orleans, la" regardless of query casing. Replace the lowercase location on the header line with the user's original string after rendering.
Diffstat (limited to 'wttrin.el')
-rw-r--r--wttrin.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/wttrin.el b/wttrin.el
index b628b1c..2dc231d 100644
--- a/wttrin.el
+++ b/wttrin.el
@@ -451,6 +451,10 @@ the generic error message."
(require 'xterm-color)
(setq-local xterm-color--state :char)
(insert (wttrin--process-weather-content raw-string))
+ ;; wttr.in returns location in lowercase — replace with user's casing
+ (goto-char (point-min))
+ (when (re-search-forward "^Weather report: .*$" nil t)
+ (replace-match (concat "Weather report: " location-name)))
(let ((staleness (wttrin--format-staleness-header location-name)))
(when staleness
(insert "\n" staleness)))