aboutsummaryrefslogtreecommitdiff
path: root/wttrin-debug.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-05 05:20:44 -0500
committerCraig Jennings <c@cjennings.net>2026-05-05 05:20:44 -0500
commit35131cb72c08c657d2a3389338d0c049d57e69bd (patch)
treead377579abb8bc143dd57c9a4f63fa244d137a94 /wttrin-debug.el
parent306c4ea1dd07de0d862c0943aeb8b7e170a1b343 (diff)
downloademacs-wttrin-35131cb72c08c657d2a3389338d0c049d57e69bd.tar.gz
emacs-wttrin-35131cb72c08c657d2a3389338d0c049d57e69bd.zip
refactor: rename debug-wttrin-* commands to wttrin-debug-* with obsolete aliases
The four interactive commands in `wttrin-debug.el` used `debug-wttrin-` as their prefix instead of the package's `wttrin-debug-` prefix. package-lint flags this as a convention violation, and it makes M-x discovery slightly less consistent for users. Renamed: - `debug-wttrin-show-raw` -> `wttrin-debug-show-raw` - `debug-wttrin-enable` -> `wttrin-debug-enable` - `debug-wttrin-disable` -> `wttrin-debug-disable` - `debug-wttrin-mode-line` -> `wttrin-debug-mode-line` The old names stay available as `define-obsolete-function-alias` entries marked since 0.4.0, so anyone with a keybinding or `(call-interactively 'debug-wttrin-enable)` in their config keeps working. The byte-compiler will emit an obsolescence warning to nudge migration. Aliases will be removed in a future release. Internal caller `wttrin--debug-mode-line-info` now invokes the new name. Test files renamed to match (`test-debug-wttrin-*.el` -> `test-wttrin-debug-*.el`); inside each, ert-deftest names and function calls were updated. Added `tests/test-wttrin-debug-aliases.el` to verify each old name resolves via `indirect-function` to the new name and carries `byte-obsolete-info` with the expected target and "0.4.0" version.
Diffstat (limited to 'wttrin-debug.el')
-rw-r--r--wttrin-debug.el34
1 files changed, 25 insertions, 9 deletions
diff --git a/wttrin-debug.el b/wttrin-debug.el
index ca378b1..e88f8ca 100644
--- a/wttrin-debug.el
+++ b/wttrin-debug.el
@@ -16,13 +16,16 @@
;; (require 'wttrin)
;;
;; Available debug functions:
-;; - `debug-wttrin-show-raw' - View raw weather data with line numbers
-;; - `debug-wttrin-mode-line' - Diagnose mode-line lighter issues
+;; - `wttrin-debug-show-raw' - View raw weather data with line numbers
+;; - `wttrin-debug-mode-line' - Diagnose mode-line lighter issues
;; - `wttrin--debug-mode-line-info' - Auto-called when wttrin runs (if debug enabled)
;;
;; Interactive commands:
-;; - M-x debug-wttrin-enable - Enable debug mode
-;; - M-x debug-wttrin-disable - Disable debug mode
+;; - M-x wttrin-debug-enable - Enable debug mode
+;; - M-x wttrin-debug-disable - Disable debug mode
+;;
+;; Earlier versions exposed these as `debug-wttrin-*'. Those names remain
+;; available as obsolete aliases and will be removed in a future release.
;;
;; When debug mode is enabled, raw weather data is automatically saved to
;; timestamped files in `temporary-file-directory' for bug reports.
@@ -37,7 +40,7 @@
(declare-function wttrin--get-cached-or-fetch "wttrin")
;;;###autoload
-(defun debug-wttrin-show-raw (location)
+(defun wttrin-debug-show-raw (location)
"Fetch and display raw wttr.in data for LOCATION with line numbers.
This is useful for debugging header parsing issues.
Always fetches fresh data from the API, bypassing cache."
@@ -61,7 +64,7 @@ Always fetches fresh data from the API, bypassing cache."
(switch-to-buffer (current-buffer)))))))
;;;###autoload
-(defun debug-wttrin-enable ()
+(defun wttrin-debug-enable ()
"Enable wttrin debug mode.
Raw weather data will be saved to timestamped files for bug reports."
(interactive)
@@ -69,14 +72,14 @@ Raw weather data will be saved to timestamped files for bug reports."
(message "Wttrin debug mode enabled. Raw data will be saved to: %s" temporary-file-directory))
;;;###autoload
-(defun debug-wttrin-disable ()
+(defun wttrin-debug-disable ()
"Disable wttrin debug mode."
(interactive)
(setq wttrin-debug nil)
(message "Wttrin debug mode disabled"))
;;;###autoload
-(defun debug-wttrin-mode-line ()
+(defun wttrin-debug-mode-line ()
"Display detailed mode-line information for the wttrin buffer.
This is useful for diagnosing why the mode-line lighter isn't appearing."
(interactive)
@@ -107,7 +110,7 @@ This is useful for diagnosing why the mode-line lighter isn't appearing."
"Auto-generate mode-line diagnostic information.
Called after every weather buffer display. A no-op stub in wttrin.el
is overridden by this implementation when the debug module is loaded."
- (debug-wttrin-mode-line))
+ (wttrin-debug-mode-line))
(defvar wttrin--debug-log nil
"List of debug log entries. Each entry is (timestamp . message).")
@@ -143,5 +146,18 @@ Messages are stored in `wttrin--debug-log' for later review."
(goto-char (point-min))
(display-buffer (current-buffer))))
+;;; Obsolete aliases for the old `debug-wttrin-*' names.
+;; Kept so existing keybindings and configurations keep working; emit
+;; a byte-compile / runtime obsolescence warning to nudge migration.
+
+(define-obsolete-function-alias 'debug-wttrin-show-raw
+ 'wttrin-debug-show-raw "0.4.0")
+(define-obsolete-function-alias 'debug-wttrin-enable
+ 'wttrin-debug-enable "0.4.0")
+(define-obsolete-function-alias 'debug-wttrin-disable
+ 'wttrin-debug-disable "0.4.0")
+(define-obsolete-function-alias 'debug-wttrin-mode-line
+ 'wttrin-debug-mode-line "0.4.0")
+
(provide 'wttrin-debug)
;;; wttrin-debug.el ends here