From 427526206ce664911b7b8cd756e5dbacdd0c8d72 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 4 Nov 2025 17:43:44 -0600 Subject: 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`. --- wttrin.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 -- cgit v1.2.3