diff options
| author | Craig Jennings <c@cjennings.net> | 2025-11-13 12:04:54 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-11-13 12:04:54 -0600 |
| commit | a718db0d64a31655ef3f0e60997cce3d465e312e (patch) | |
| tree | ef31a4c7e717e791682d3473757625d17053ae24 /wttrin.el | |
| parent | 0e71902e2a2dc16427f0b0274b4c968bcb05fa4f (diff) | |
feat: mode-line: defer network requests until after Emacs initialization
Prevents mode-line from making network requests during Emacs startup.
Network activity now deferred to after-init-hook when Emacs is not yet
fully initialized, improving startup performance.
Diffstat (limited to 'wttrin.el')
| -rw-r--r-- | wttrin.el | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -599,7 +599,13 @@ When enabled, shows weather for `wttrin-mode-line-favorite-location'." (progn (when (featurep 'wttrin-debug) (wttrin--debug-log "wttrin mode-line: Mode enabled")) - (wttrin--mode-line-start) + ;; Delay network activity until Emacs is fully initialized + (if (and (not after-init-time) (not noninteractive)) + (progn + (when (featurep 'wttrin-debug) + (wttrin--debug-log "wttrin mode-line: Deferring start until after-init-hook")) + (add-hook 'after-init-hook #'wttrin--mode-line-start)) + (wttrin--mode-line-start)) ;; Add modeline string to global-mode-string for custom modelines (if global-mode-string (add-to-list 'global-mode-string 'wttrin-mode-line-string 'append) |
