summaryrefslogtreecommitdiff
path: root/wttrin.el
diff options
context:
space:
mode:
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)))