<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/modules/org-agenda-config-debug.el, branch v0.7.2</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=v0.7.2</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=v0.7.2'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<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/commit/?id=8e8152e13b455021e604ea8cb989028bda1c9f5a'/>
<id>urn:sha1:8e8152e13b455021e604ea8cb989028bda1c9f5a</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)
</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/commit/?id=2979be13b55ae52b795a39db652ca69ee18424e5'/>
<id>urn:sha1:2979be13b55ae52b795a39db652ca69ee18424e5</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
</content>
</entry>
</feed>
