summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-11-04 17:43:44 -0600
committerCraig Jennings <c@cjennings.net>2025-11-04 17:43:44 -0600
commit427526206ce664911b7b8cd756e5dbacdd0c8d72 (patch)
tree7b211f2eca59bf51edd06ecb7c2f9fd278c6a124
parent541c61a403e01922a7569f5e23c25eba08fce427 (diff)
feat:wttrin: Add auto-enable option for mode-line weather display
Introduce `wttrin-mode-line-auto-enable` customization option. When set to non-nil, this automatically enables the mode-line weather display upon loading wttrin. Users can still manually toggle the display with `wttrin-mode-line-mode`.
-rw-r--r--wttrin.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/wttrin.el b/wttrin.el
index 8bce49d..13a77f1 100644
--- a/wttrin.el
+++ b/wttrin.el
@@ -122,6 +122,14 @@ Set to nil to use default font (may render as monochrome)."
:type '(choice (const :tag "Use default font" nil)
(string :tag "Font family name")))
+(defcustom wttrin-mode-line-auto-enable nil
+ "If non-nil, automatically enable mode-line weather display when loading wttrin.
+When enabled, weather for `wttrin-mode-line-favorite-location' will appear
+in the mode-line automatically. You can also manually toggle the mode-line
+display with `wttrin-mode-line-mode'."
+ :group 'wttrin
+ :type 'boolean)
+
(defcustom wttrin-debug nil
"Enable debug functions for troubleshooting wttrin behavior.
When non-nil, loads wttrin-debug.el which provides:
@@ -545,5 +553,9 @@ Weather data is fetched asynchronously to avoid blocking Emacs."
(car wttrin-default-locations)))))
(wttrin-query location))
+;; Auto-enable mode-line display if requested
+(when wttrin-mode-line-auto-enable
+ (wttrin-mode-line-mode 1))
+
(provide 'wttrin)
;;; wttrin.el ends here