aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-11-04 17:23:50 -0600
committerCraig Jennings <c@cjennings.net>2025-11-04 17:23:50 -0600
commit8126a29be5ca3f582ccdcbd450b4913e8e08c74d (patch)
treecda636b86f1ea2d7fc9e3e6bd498fee6f194a36f /modules
parent62b1fc8b252a0f5e6db6de34c2f0bd794910cd70 (diff)
downloaddotemacs-8126a29be5ca3f582ccdcbd450b4913e8e08c74d.tar.gz
dotemacs-8126a29be5ca3f582ccdcbd450b4913e8e08c74d.zip
fix: Resolve async buffer error and improve modeline spacing
- Fixed critical "Selecting deleted buffer" error on startup - wttrin-mode-line-mode now activates after init completes - Uses after-init-hook to prevent async buffer deletion - Weather widget loads safely after Emacs finishes initializing - Improved modeline right-side spacing - Added 2 non-breaking spaces after misc-info segment - Prevents weather icon from appearing flush with edge - Non-breaking spaces survive right-align trimming
Diffstat (limited to 'modules')
-rw-r--r--modules/modeline-config.el3
-rw-r--r--modules/weather-config.el25
2 files changed, 26 insertions, 2 deletions
diff --git a/modules/modeline-config.el b/modules/modeline-config.el
index 140d21cdd..b14035398 100644
--- a/modules/modeline-config.el
+++ b/modules/modeline-config.el
@@ -156,7 +156,8 @@ Shows only in active window.")
mode-line-format-right-align
cj/modeline-vc-branch
" "
- cj/modeline-misc-info))
+ cj/modeline-misc-info
+ " "))
;; Mark all segments as risky-local-variable (required for :eval forms)
(dolist (construct '(cj/modeline-buffer-name
diff --git a/modules/weather-config.el b/modules/weather-config.el
index 31fb1b705..55eddf16d 100644
--- a/modules/weather-config.el
+++ b/modules/weather-config.el
@@ -10,8 +10,15 @@
;; ----------------------------------- Wttrin ----------------------------------
+;; Load wttrin from local development directory
+(add-to-list 'load-path "/home/cjennings/code/wttrin")
+
+;; Set debug flag BEFORE loading wttrin (checked at load time)
+(setq wttrin-debug t)
+
(use-package wttrin
- :vc (:url "https://github.com/cjennings/emacs-wttrin" :rev :newest)
+ ;; Uncomment the next line to use vc-install instead of local directory:
+ ;; :vc (:url "https://github.com/cjennings/emacs-wttrin" :rev :newest)
:defer t
:preface
;; dependency for wttrin
@@ -21,6 +28,22 @@
("M-W" . wttrin)
:custom
(wttrin-unit-system "u")
+ (wttrin-mode-line-favorite-location "New Orleans, LA")
+ (wttrin-mode-line-refresh-interval 900) ; 15 minutes
+ :init
+ ;; Explicitly autoload the mode function (needed for local dev directory)
+ (autoload 'wttrin-mode-line-mode "wttrin" "Toggle weather display in mode-line." t)
+ ;; Enable mode-line widget AFTER Emacs finishes initializing
+ ;; (url-retrieve async needs full init to work without buffer errors)
+ (if (daemonp)
+ ;; Daemon mode: wait for first client to connect
+ (add-hook 'server-after-make-frame-hook
+ (lambda () (wttrin-mode-line-mode 1))
+ t) ; append to end of hook
+ ;; Normal Emacs: wait for startup to complete
+ (add-hook 'after-init-hook
+ (lambda () (wttrin-mode-line-mode 1))
+ t)) ; append to end of hook
:config
(setq wttrin-default-locations '(
"New Orleans, LA"