aboutsummaryrefslogtreecommitdiff
path: root/wttrin.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-26 13:25:41 -0400
committerCraig Jennings <c@cjennings.net>2026-06-26 13:25:41 -0400
commitee8fdeb692d666c12ce068a2b1ee90e9451ac892 (patch)
tree14e6112715ae68d7b16e1029c4f4f114cdd1efe6 /wttrin.el
parent06143c61c3782b24c738587ae5e1f427ceb0518c (diff)
downloademacs-wttrin-ee8fdeb692d666c12ce068a2b1ee90e9451ac892.tar.gz
emacs-wttrin-ee8fdeb692d666c12ce068a2b1ee90e9451ac892.zip
fix: drop the alias query from history when making it the defaultHEADmain
Making a location the default saved it and dropped the favorite name from history, but not the underlying query. For an alias whose query differs from its name, that query lingered as a separate history candidate. Both saving branches now drop the name and the query, matching wttrin-save-location.
Diffstat (limited to 'wttrin.el')
-rw-r--r--wttrin.el2
1 files changed, 2 insertions, 0 deletions
diff --git a/wttrin.el b/wttrin.el
index f64af7f..82516b9 100644
--- a/wttrin.el
+++ b/wttrin.el
@@ -1262,11 +1262,13 @@ current location."
(message "wttrin: %s is now the default location" wttrin--current-location))
(wttrin--put-saved-location name wttrin--current-location)
(wttrin--set-favorite-location name)
+ (wttrin--drop-from-location-history name wttrin--current-location)
(message "wttrin: %s is now the default location" name))))
(t
(let ((favorite (or wttrin--current-display wttrin--current-location)))
(wttrin--put-saved-location favorite wttrin--current-location)
(wttrin--set-favorite-location favorite)
+ (wttrin--drop-from-location-history favorite wttrin--current-location)
(message "wttrin: %s is now the default location" favorite)))))
;;; Mode-line weather display