<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs.git/modules/org-agenda-config-debug.el, branch v0.7.2</title>
<subtitle>my Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs.git/atom?h=v0.7.2</id>
<link rel='self' href='https://git.cjennings.net/dotemacs.git/atom?h=v0.7.2'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs.git/'/>
<updated>2025-11-15T20:08:47+00:00</updated>
<entry>
<title>fix(tests): Move cj/log-silently to system-lib.el, fix all test failures</title>
<updated>2025-11-15T20:08:47+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-15T20:08:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs.git/commit/?id=0be39bc9fa41f14f9d6d1a449f8f2b77a502c619'/>
<id>urn:sha1:0be39bc9fa41f14f9d6d1a449f8f2b77a502c619</id>
<content type='text'>
Consolidated cj/log-silently function to system-lib.el as the canonical
location for low-level utility functions. This fixes 4 failing tests in
video-audio-recording that couldn't find the function.

Changes:
- Move cj/log-silently to system-lib.el (from system-utils.el)
- Remove duplicate definition from org-agenda-config-debug.el
- Remove duplicate definition from system-utils.el
- Add (require 'system-lib) to all modules using cj/log-silently:
  - video-audio-recording.el
  - org-agenda-config-debug.el
  - media-utils.el (also removed declare-function)
  - elfeed-config.el (replaced system-utils with system-lib)
  - wrap-up.el

Test Results:
- Before: 112/113 passing (4 video-audio-recording tests failing)
- After: 113/113 passing ✓

All tests now pass with zero failures.

Fixes TODO #809-895 (move cj/log-silently to system-lib.el)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>feat: add debug infrastructure for config modules</title>
<updated>2025-10-29T14:38:53+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-10-29T14:38:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs.git/commit/?id=bb4def1a5c3adb157d699ebb932d0de34fecd66d'/>
<id>urn:sha1:bb4def1a5c3adb157d699ebb932d0de34fecd66d</id>
<content type='text'>
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: &lt;module&gt;-debug.el
- Consistent namespace: cj/&lt;module&gt;-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 &lt;noreply@anthropic.com&gt;
</content>
</entry>
</feed>
