summaryrefslogtreecommitdiff
path: root/modules/user-constants.el
AgeCommit message (Collapse)Author
8 daysfeat: add debug infrastructure for config modulesCraig Jennings
This commit establishes a pattern for organizing debug code in separate files that can be enabled/disabled via a central toggle. ## Changes **1. Added debug toggle to user-constants.el** New variable `cj/debug-modules` controls which modules load debug functions: - Set to nil (default): No debug functions loaded - Set to list of symbols: Load debug for specific modules Example: (setq cj/debug-modules '(org-agenda mail)) - Set to t: Load all debug modules Example: (setq cj/debug-modules t) Placed early in user-constants.el so it's available before other modules load. **2. Created org-agenda-config-debug.el** New debug file contains: - `cj/org-agenda-debug-dump-files` - Shows all org-agenda-files with status, file sizes, and modification times - `cj/org-agenda-debug-rebuild-timing` - Measures rebuild performance and reports detailed timing statistics - `cj/log-silently` - Helper function to write to *Messages* without echo All functions use ;;;###autoload for easy invocation before explicit loading. **3. Added conditional require to org-agenda-config.el** Checks `cj/debug-modules` and conditionally loads org-agenda-config-debug.el: ```elisp (when (or (eq cj/debug-modules t) (memq 'org-agenda cj/debug-modules)) (require 'org-agenda-config-debug ...)) ``` ## Benefits **Cleaner separation of concerns:** - Production code stays in main config files - Debug code isolated in *-debug.el files - Easy to enable/disable debugging per module **Reusable pattern:** - Can be applied to any config module (mail, chime, etc.) - Consistent naming: <module>-debug.el - Consistent namespace: cj/<module>-debug-* **Zero overhead when disabled:** - Debug files not loaded unless explicitly enabled - No performance impact on normal usage ## Usage To enable org-agenda debug functions: ```elisp ;; In user-constants.el or early-init.el (setq cj/debug-modules '(org-agenda)) ``` Then restart Emacs and run: - M-x cj/org-agenda-debug-dump-files - M-x cj/org-agenda-debug-rebuild-timing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23refactor: unify and simplify key binding setupsCraig Jennings
Optimized key binding configurations across modules for consistency and reduced redundancy. Improved conditional requiring to handle errors gracefully in `music-config.el`, ensuring robustness across different machine environments. Eliminated comments clutter and adjusted function definitions to adhere to revised standards.
2025-10-18refactor: created specific org-dir variable for ~/sync/orgCraig Jennings
2025-10-12changing repositoriesCraig Jennings