aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-11-08 12:12:52 -0600
committerCraig Jennings <c@cjennings.net>2025-11-08 12:12:52 -0600
commit04b11059b831c94b4e5ba901b735fcc888cbbe1a (patch)
tree06051abaed3c4e1b79f2a0e10447c7c80649d268
parent29b559bd1a956a4efdec625f1b5d878503d46a33 (diff)
downloademacs-wttrin-04b11059b831c94b4e5ba901b735fcc888cbbe1a.tar.gz
emacs-wttrin-04b11059b831c94b4e5ba901b735fcc888cbbe1a.zip
refactor: make debug functions public (single hyphen naming)
Renamed private debug functions to public API: - wttrin--debug-show-log → wttrin-debug-show-log - wttrin--debug-clear-log → wttrin-debug-clear-log Added ;;;###autoload to both functions for proper autoloading. Updated all references: - README.org (2 occurrences) - tests/README-DEBUG-TESTS.md (4 occurrences) - tests/test-wttrin-integration-with-debug.el (8 occurrences) These are user-facing commands that should be discoverable via M-x, so they follow the public API naming convention (single hyphen). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
-rw-r--r--README.org4
-rw-r--r--tests/README-DEBUG-TESTS.md6
-rw-r--r--tests/test-wttrin-integration-with-debug.el4
-rw-r--r--wttrin-debug.el5
4 files changed, 10 insertions, 9 deletions
diff --git a/README.org b/README.org
index 510eebb..fb8b085 100644
--- a/README.org
+++ b/README.org
@@ -280,7 +280,7 @@ If wttrin isn't working as expected, enable debug mode to see detailed logging o
Once debug mode is enabled, you can view the debug log:
#+begin_src emacs-lisp
- M-x wttrin--debug-show-log
+ M-x wttrin-debug-show-log
#+end_src
This shows a timestamped log of all wttrin operations:
@@ -304,7 +304,7 @@ When working correctly, the debug log looks like:
*** Common Issues
- *xterm-color missing*: Ensure xterm-color is installed (`M-x package-install RET xterm-color`)
- *Debug not working*: Remember to set `wttrin-debug t` *before* loading wttrin
-- *Mode-line not showing*: Check `M-x wttrin--debug-show-log` to see if fetch succeeded
+- *Mode-line not showing*: Check `M-x wttrin-debug-show-log` to see if fetch succeeded
- *No network access*: Debug log will show "Network error" messages
** History
diff --git a/tests/README-DEBUG-TESTS.md b/tests/README-DEBUG-TESTS.md
index 7310123..c1abd52 100644
--- a/tests/README-DEBUG-TESTS.md
+++ b/tests/README-DEBUG-TESTS.md
@@ -55,7 +55,7 @@ M-x debug-wttrin-enable
### View Debug Log
```emacs-lisp
-M-x wttrin--debug-show-log
+M-x wttrin-debug-show-log
```
This opens a buffer showing all debug events with timestamps.
@@ -63,7 +63,7 @@ This opens a buffer showing all debug events with timestamps.
### Clear Debug Log
```emacs-lisp
-M-x wttrin--debug-clear-log
+M-x wttrin-debug-clear-log
```
## Test Fixtures
@@ -76,7 +76,7 @@ If wttrin isn't loading in your configuration:
1. **Enable debug mode** (set `wttrin-debug` to `t` before loading)
2. **Check dependencies**: Run `M-x package-list-packages` and ensure `xterm-color` is installed
-3. **View debug log**: Run `M-x wttrin--debug-show-log` after trying to use wttrin
+3. **View debug log**: Run `M-x wttrin-debug-show-log` after trying to use wttrin
4. **Check for errors**: Look in `*Messages*` buffer for any error messages
The debug log will show you exactly where the process stops or fails.
diff --git a/tests/test-wttrin-integration-with-debug.el b/tests/test-wttrin-integration-with-debug.el
index db4e05f..9f50df2 100644
--- a/tests/test-wttrin-integration-with-debug.el
+++ b/tests/test-wttrin-integration-with-debug.el
@@ -37,7 +37,7 @@
(setq wttrin-debug t)
;; Clear any existing debug log
(when (featurep 'wttrin-debug)
- (wttrin--debug-clear-log))
+ (wttrin-debug-clear-log))
;; Clear cache
(wttrin-clear-cache)
;; Set test configuration
@@ -51,7 +51,7 @@
(wttrin-mode-line-mode -1))
(wttrin-clear-cache)
(when (featurep 'wttrin-debug)
- (wttrin--debug-clear-log))
+ (wttrin-debug-clear-log))
(setq wttrin-mode-line-string nil)
(setq wttrin--mode-line-tooltip-data nil))
diff --git a/wttrin-debug.el b/wttrin-debug.el
index 0ddecab..810f875 100644
--- a/wttrin-debug.el
+++ b/wttrin-debug.el
@@ -115,14 +115,15 @@ FORMAT-STRING and ARGS are passed to `format'."
(push (cons timestamp msg) wttrin--debug-log)
(message "[wttrin-debug %s] %s" timestamp msg))))
-(defun wttrin--debug-clear-log ()
+;;;###autoload
+(defun wttrin-debug-clear-log ()
"Clear the debug log."
(interactive)
(setq wttrin--debug-log nil)
(message "Wttrin debug log cleared"))
;;;###autoload
-(defun wttrin--debug-show-log ()
+(defun wttrin-debug-show-log ()
"Display the wttrin debug log in a buffer."
(interactive)
(with-current-buffer (get-buffer-create "*wttrin-debug-log*")