diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-05 05:17:39 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-05 05:17:39 -0500 |
| commit | 306c4ea1dd07de0d862c0943aeb8b7e170a1b343 (patch) | |
| tree | c52be33153ad968c8e490bcebbeeb1ada21d5630 | |
| parent | ba22e0cc3c81d85b3ee8aaa337d6a388627c3af2 (diff) | |
| download | emacs-wttrin-306c4ea1dd07de0d862c0943aeb8b7e170a1b343.tar.gz emacs-wttrin-306c4ea1dd07de0d862c0943aeb8b7e170a1b343.zip | |
fix: drop if-let and personal-config reference in debug-wttrin-mode-line
`if-let` requires Emacs 25.1, but the package declares (emacs "24.4") in Package-Requires. Replaced with `let` + `if` so the debug module loads on the stated minimum.
Also dropped the `cj/modeline-major-mode` branch. That symbol is from my personal Emacs config, so the conditional was effectively dead code for anyone else and a confusing reference in a published package. The diagnostic now always shows the formatted mode-name, which is useful for everyone.
| -rw-r--r-- | wttrin-debug.el | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/wttrin-debug.el b/wttrin-debug.el index 53f7e29..ca378b1 100644 --- a/wttrin-debug.el +++ b/wttrin-debug.el @@ -80,20 +80,18 @@ Raw weather data will be saved to timestamped files for bug reports." "Display detailed mode-line information for the wttrin buffer. This is useful for diagnosing why the mode-line lighter isn't appearing." (interactive) - (if-let ((buf (get-buffer "*wttr.in*"))) + (let ((buf (get-buffer "*wttr.in*"))) + (if (not buf) + (message "No *wttr.in* buffer exists. Run M-x wttrin first.") (with-current-buffer buf - (let* ((has-custom-modeline (boundp 'cj/modeline-major-mode)) - (formatted-mode (when has-custom-modeline - (format-mode-line mode-name)))) + (let ((formatted-mode (format-mode-line mode-name))) (with-output-to-temp-buffer "*wttrin-mode-debug*" (princ (format "=== Wttrin Mode-Line Debug Info ===\n\n")) (princ (format "Buffer: %s\n" (buffer-name))) (princ (format "Major mode: %s\n" major-mode)) (princ (format "mode-name variable: %S\n" mode-name)) (princ (format "mode-name type: %s\n" (type-of mode-name))) - (princ (format "\nCustom modeline detected: %s\n" has-custom-modeline)) - (when has-custom-modeline - (princ (format "format-mode-line result: %S\n" formatted-mode))) + (princ (format "format-mode-line result: %S\n" formatted-mode)) (princ (format "\nmode-line-format first 5 elements:\n")) (let ((i 0)) (dolist (elem mode-line-format) @@ -103,8 +101,7 @@ This is useful for diagnosing why the mode-line lighter isn't appearing." (princ (format "\nSpecial-mode parent: %s\n" (get 'wttrin-mode 'derived-mode-parent))) (princ (format "Is special-mode active: %s\n" - (derived-mode-p 'special-mode)))))) - (message "No *wttr.in* buffer exists. Run M-x wttrin first."))) + (derived-mode-p 'special-mode))))))))) (defun wttrin--debug-mode-line-info () "Auto-generate mode-line diagnostic information. |
