summaryrefslogtreecommitdiff
path: root/todo.org
blob: 43021c6e500e68e128f7f74e73589dc93368287e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
#+TITLE: Emacs Config V2MOM and Tasks
#+AUTHOR: Craig Jennings
#+DATE: 2025-10-31
#+FILETAGS: :v2mom:active:

* Instructions

This inbox contains ONLY tasks that serve the V2MOM vision. Before adding any task here, ask:
1. Does it serve the Vision?
2. Does it align with the Values?
3. Is it addressed in the Methods?
4. Does it overcome an Obstacle?
5. Does it improve a Metric?

If the answer is "no" to all five → DON'T ADD IT.

V2MOM is located at: [[file:docs/emacs-config-v2mom.org][emacs-config-v2mom.org]]
Research/ideas that don't serve vision: [[file:docs/someday-maybe.org][someday-maybe.org]]

* Method 1: Make Using Emacs Frictionless [11/20]

** DONE [#A] Fix Google Calendar password prompts every 15 minutes
CLOSED: [2025-11-11 Mon]

✅ **Fixed oauth2-auto caching bug**

**Root Cause:**
oauth2-auto.el version 20250624.1919 had a bug on line 206 that completely
disabled its internal token cache with `or nil`. This forced every org-gcal
sync to decrypt oauth2-auto.plist from disk, triggering GPG passphrase prompts
every ~15 minutes.

**The Bug:**
```elisp
;; Line 201-213 in oauth2-auto.el (BEFORE fix)
(defun oauth2-auto--plstore-read (username provider)
  "Read the data for USERNAME and PROVIDER from the cache, else from plstore."
  (let ((id (oauth2-auto--compute-id username provider)))
    ; Assume cache is invalidated. FIXME
    (or nil ;(gethash id oauth2-auto--plstore-cache)  ;; BUG: cache disabled!
        (let ((plstore (plstore-open oauth2-auto-plstore)))
          ...))))
```

**The Fix:**
Enabled the internal hash-table cache by removing `or nil`:
```elisp
;; Line 201-213 in oauth2-auto.el (AFTER fix)
(defun oauth2-auto--plstore-read (username provider)
  "Read the data for USERNAME and PROVIDER from the cache, else from plstore."
  (let ((id (oauth2-auto--compute-id username provider)))
    ;; FIXED: Enable cache to prevent repeated GPG passphrase prompts
    (or (gethash id oauth2-auto--plstore-cache)  ;; Cache now works!
        (let ((plstore (plstore-open oauth2-auto-plstore)))
          ...))))
```

**What Changed:**
1. Modified elpa/oauth2-auto-20250624.1919/oauth2-auto.el:201-213
2. Removed `or nil` that disabled cache
3. Added `cj/clear-oauth2-auto-cache` helper function in auth-config.el
4. Documented fix in auth-config.el commentary (lines 16-22)

**Result:**
- GPG passphrase prompted ONCE per Emacs session (when first accessing tokens)
- oauth2-auto now caches tokens in memory (oauth2-auto--plstore-cache)
- No more interruptions during org-gcal auto-sync every 30 minutes
- Workflow is now frictionless as intended

**Testing:**
After restart:
1. First org-gcal sync prompts for passphrase (expected)
2. Subsequent syncs use cached tokens (no prompts)
3. Cache persists until Emacs closes

**Files Modified:**
- elpa/oauth2-auto-20250624.1919/oauth2-auto.el (cache fix)
- modules/auth-config.el (documentation + helper function)

Priority [#A] because password prompts every 15 minutes violated "Frictionless" value.
Fixed 2025-11-11.

** TODO [#B] Fix org-noter (reading/annotation workflow currently "so painful")

High priority - daily pain point.

** TODO [#B] Fix mail attachment workflow (currently awkward)

Daily workflow improvement.

** TODO [#B] Toggle org-appear on/off

When org links have long paths and point is on them, they expand and make text difficult to read
(especially in org-tables). Need ability to toggle org-appear: on for editing links, off for reading.
Moved from inbox 2025-11-07.

** TODO [#B] Optimize org-agenda performance using built-in profiler

THE BOTTLENECK. Currently 30+ seconds, target < 5 seconds.
Use M-x profiler-start before Method 3 debug-profiling.el is built.

** TODO [#B] Optimize org-capture target building performance

15-20 seconds every time capturing a task (12+ times/day).
Major daily bottleneck - minutes lost waiting, plus context switching cost.

** DONE [#A] Fix audio recording device selection - still broken with Jabra headset
CLOSED: [2025-11-11 Mon]

✅ **Fixed audio recording bug + improved UX**

**Root Cause:**
Auto-detection only looked for `analog.*stereo` which matched laptop audio but never
Bluetooth/Jabra devices. User was always recording from laptop mic (silent when using Jabra).

**What Was Fixed:**

1. **Removed broken auto-detection** (lines 58-77)
   - Old code only detected built-in laptop audio
   - Never detected Bluetooth/USB/Jabra devices
   - This is why recordings were silent

2. **Force explicit device selection on first use**
   - C-; r a now prompts for device setup if not configured
   - Suggests quick setup (C-; r c) by default
   - Device selection persists across Emacs sessions

3. **Simplified keybindings to toggle start/stop**
   - C-; r a → Toggle audio recording (start/stop)
   - C-; r v → Toggle video recording (start/stop)
   - Removed separate stop keybindings (A, V)
   - One key to remember, press again to stop!

4. **Added device testing functions** (lines 233-314)
   - C-; r t b → Test both mic + monitor (guided, RECOMMENDED)
   - C-; r t m → Test microphone only (5 sec)
   - C-; r t s → Test system audio/monitor only (5 sec)
   - Catch hardware issues before important recordings

5. **Added modeline recording indicator**
   - 🔴Audio appears when recording audio
   - 🔴Video appears when recording video
   - 🔴A+V appears when recording both
   - Indicator and toggle always in sync (same process variables)
   - Process sentinel auto-clears on crash/kill

**New Workflow:**
```
Press C-; r a
  ↓
First time? → Device setup → Choose Jabra → Start (🔴Audio appears)
  ↓
Already configured? → Start immediately (🔴Audio appears)
  ↓
Press C-; r a again → Stop (🔴 disappears)
```

**Files Modified:**
- modules/video-audio-recording.el (removed auto-detect, added tests, toggle functions, modeline indicator)
- modules/modeline-config.el (added 🔴 recording indicator to right side)

**Testing:**
After Emacs restart:
1. Press C-; r a
2. Choose "Bluetooth Headset" (Jabra)
3. See 🔴Audio in modeline
4. Speak and play audio
5. Press C-; r a to stop
6. Verify recording has audio

Priority [#A] because blocked daily recording and transcription workflows.
Fixed 2025-11-11.

** TODO [#B] Add time-zones package for quick timezone lookups

IRRITANT: Need to frequently check time differences between cities (London, Lisbon,
New Orleans, San Francisco) for meetings and coordination. Currently requires stopping
work, searching web/using external app, context switching back.

**Pain Point:**
Multiple times per week, need to know "what time is it in London right now?" or
"if I schedule this for 2pm my time, what time is that in Lisbon?" This breaks
flow and requires leaving Emacs.

**Solution:**
Use time-zones package: https://github.com/xenodium/time-zones

Built-in world-clock exists (M-x world-clock) but lacks two critical features:
1. Can't interactively add cities with fuzzy search
2. Can't shift time forward/backward to check future times

time-zones package adds both features - making timezone checks instant and frictionless.

**Expected Workflow:**
- M-x time-zones (or keybinding C-; T z or similar)
- Interactively add/remove cities with completion
- Shift time forward/backward to check meeting times
- Stay in Emacs, maintain flow

**Files:**
- Create new module: modules/time-zones-config.el
- Add require to init.el in appropriate section
- Configure default cities list (London, Lisbon, New Orleans, San Francisco)
- Add keybinding (suggest C-; T z for time zones)

**V2MOM Alignment:**
Method 1 - Frictionless: Eliminates context switch for common timezone queries.
Intuitive value: Quick keybinding for frequent operation.

** TODO [#D] Frequently used org-mode keybindings under C-; o

Add quick access keybindings for common org commands (org-table, org-reveal, etc.) under C-; o.
Makes org-mode operations more frictionless.
Moved from inbox 2025-11-07.

** TODO [#D] Fix EMMS keybinding inconsistency with other buffers

EMMS keybindings conflict with standard buffer keybindings, causing mistypes.
Results in accidental destructive actions (clearing buffers), requires undo + context switch.
Violates Intuitive value - muscle memory should help, not hurt.

** DONE [#A] Remove network check from startup (saves 1+ seconds)
CLOSED: [2025-10-31 Fri]

✅ Deleted blocking ping check. Startup improved from 6.2s to 5.4s.
Now uses package priorities: .localrepo (200) > online repos (25).

** DONE [#A] Fix cj/goto-git-gutter-diff-hunks (missing function causing errors)
CLOSED: [2025-11-03 Sun]

✅ Implemented missing function in modules/vc-config.el
- Added `cj/goto-git-gutter-diff-hunks` function (lines 118-124)
- Uses consult-line to search for diff markers (^[+\-])
- Enables interactive jumping to any changed line via C-; v d
- Function properly documented with docstring
- No linting issues, compiles cleanly

Quick win completed - 5 minutes actual time.

** DONE [#A] Fix chime-check throw with no catch block
CLOSED: [2025-11-01 Fri]

Error: "(no-catch --cl-block-chime-check-- nil)"
Chime was throwing to a catch block that doesn't exist.
Location: chime package - chime-check() function at line 1540
Fix: Changed defun to cl-defun to provide implicit catch block for cl-return-from.

Fixed in ~/code/chime.el/chime.el:1540

Added regression test: test-integration-startup-early-return-on-validation-failure
Created Makefile with test targets (unit, integration, all, by-file, by-name)
Updated README.org with Development/Testing section

All integration tests pass (5/5) ✅

** DONE [#A] Implement cj/diff-buffer-with-file (compare buffer with saved version)
CLOSED: [2025-10-31 Fri]

Bound to C-; b D. Weekly need satisfied.

** DONE [#A] Add comprehensive test coverage for video-audio-recording module
CLOSED: [2025-11-03 Sun]

✅ Created comprehensive test suite following quality-engineer.org standards:
- 9 test files (8 unit + 1 integration)
- 83 test cases with 100% pass rate
- Test categories: Normal, Boundary, Error cases
- 6 test fixtures for reproducible testing
- Mocking strategy using cl-letf
- Integration test validates complete parse→group→friendly-names workflow
- Tests document bugs in legacy detect functions
- Critical validation: Bluetooth MAC normalization across component boundaries

✅ Refactored code for testability:
- Extracted `cj/recording--parse-pactl-output` internal parser
- Separated I/O from business logic

✅ Fixed all linting warnings (checkdoc):
- 6 spacing/grammar issues resolved
- `make lint` now passes cleanly

✅ All changes committed and pushed to all remotes (origin + github)

Commits:
- 0a69c58: test: Add comprehensive test suite for video-audio-recording module
- b086539: style: Fix checkdoc warnings in video-audio-recording.el

*** TODO [#C] Add device testing command cj/recording-test-devices
Records 3 seconds of audio.
Plays it back.
Confirms devices work before real recording.

*** TODO [#C] Add recording status display (optional via flag, default off)
Show "Recording: 00:05:23" in modeline or echo area.
Timer showing duration.
File size updating.

*** TODO [#C] Add recording presets
Screencast (video + audio, high quality).
Podcast (audio only, voice optimized).
Meeting (balanced, lower filesize).
Quick note (audio, low quality, small file).

*** TODO [#C] Build recording history buffer
*Recordings* buffer showing history.
Duration, file size, location.
Quick actions: play, delete, rename, move.

*** TODO [#C] Add post-processing hooks
Auto-compress after recording.
Move to cloud sync directory.
Generate transcript (once transcription workflow exists).

** DONE [#A] Delay in modeline lines and columns update
CLOSED: [2025-11-08 Fri]

✅ Fixed modeline position lag by replacing expensive function calls with cached values.

**Problem:**
- Line/column numbers lagged behind cursor movement
- Used `line-number-at-pos` which counts from buffer start on every update
- Performance degraded in large files

**Solution:**
- Replaced with built-in format specifiers `%l` and `%c` (modeline-config.el:81)
- These use cached values maintained by line-number-mode and column-number-mode
- Explicitly enabled line-number-mode in ui-config.el:53
- Zero performance overhead - cached values update instantly

**Result:**
- Modeline position now updates instantly with cursor movement
- No lag, even in large files
- Maintains same "L:line C:col" format

** DONE [#B] Fix go-ts-mode-map keybinding error (void-variable)
CLOSED: [2025-11-03 Sun]

Error: "Debugger entered--Lisp error: (void-variable go-ts-mode-map)"
Location: modules/prog-go.el - trying to bind keys before mode loads.

✅ Already fixed in commit 196b289 (Nov 2, 2025)
- Moved keybinding from `:bind (:map go-ts-mode-map ...)` to hook function
- Keybinding now set in `cj/go-mode-keybindings` called via `:hook`
- Function executes after mode loads, ensuring keymap exists
- Today's cleanup: Removed unused forward declarations (lines 34-35)

Fix was: Wrap keybinding in hook function instead of :bind clause.
Result: No more void-variable error, keybinding works correctly.

** DONE [#B] Fix video/audio recording module (use constantly, just broke)
CLOSED: [2025-11-03 Sun]

Main issue: No way to select audio devices when multiple are available.
Plugging in external audio interface broke recording - only captured input, not output.

✅ COMPLETED - Module now has robust device detection and selection.

*** DONE [#A] Add diagnostic command cj/recording-list-devices
CLOSED: [2025-11-03 Sun]

✅ Created `cj/recording-list-devices` command (C-; r d)
Shows ALL available PulseAudio/PipeWire sources with drivers and states.
Displays current configuration.
Helps debug why auto-detection fails.

*** DONE [#A] Add device selection UI
CLOSED: [2025-11-03 Sun]

✅ Created TWO selection workflows:
1. `cj/recording-select-devices` (C-; r s) - Full manual control
   - Select mic and system audio separately
   - Interactive completion with device states
2. `cj/recording-quick-setup-for-calls` (C-; r c) - Quick call setup
   - Smart device pairing (groups mic + monitor by hardware)
   - One selection for both mic and system audio
   - Handles Bluetooth MAC normalization

Devices cached in variables for future recordings.
Can switch devices without restarting Emacs.

*** DONE [#B] Improve error messages
CLOSED: [2025-11-03 Sun]

✅ Error messages now include:
- Guidance to run `cj/recording-select-devices`
- Clear indication when auto-detection fails
- User-friendly prompts for manual selection

*** DONE [#B] Make device detection more flexible
CLOSED: [2025-11-03 Sun]

✅ Implemented multi-level fallback system:
1. Auto-detect using pactl output parsing
2. Prompt user to select manually if auto-detect fails
3. Error with helpful guidance if user declines

✅ Smart device grouping in `cj/recording-group-devices-by-hardware`:
- Handles USB, PCI (built-in), and Bluetooth devices
- Normalizes Bluetooth MAC addresses (colons ↔ underscores)
- Assigns friendly names (e.g., "Built-in Laptop Audio", "Bluetooth Headset")
- Filters incomplete devices (must have both mic and monitor)

✅ Supports both PulseAudio and PipeWire (both use pactl).

*** TODO [#B] Validate recording startup
Check process status after starting.
Parse ffmpeg output for errors.
Show actual ffmpeg command for debugging.

** DONE [#C] Fix grammar checker performance (currently disabled)
CLOSED: [2025-11-04 Mon]

✅ **Installed and configured LanguageTool for comprehensive grammar checking**

Replaced disabled grammar checker with on-demand LanguageTool integration:
- Installed LanguageTool 6.6-2 from Arch repos (222MB)
- Created wrapper script: scripts/languagetool-flycheck (Python 3)
- Integrated with flycheck for on-demand checking via C-; ?
- Removed proselint (redundant - LanguageTool catches more)
- No performance impact: only runs when explicitly invoked
- Installation instructions added to modules/flycheck-config.el commentary

LanguageTool catches:
- Real grammar errors (subject-verb agreement, tense, etc.)
- Missing punctuation (commas, periods)
- Common mistakes (could of → could have)
- Style issues (redundant phrases, wordiness)

Workflow: Open org/text/markdown file → press C-; ? → see errors in *Flycheck errors* buffer

** DONE cj/flyspell-then-abbrev loses keybinding in scratch org-mode buffer
CLOSED: [2025-11-08 Fri]

✅ Fixed keybinding issue in org-mode buffers.

**Problem:**
1. Autoload cookies were just comments and never executed
2. Org-mode was overriding C-' with org-cycle-agenda-files

**Solution:**
- Set keybindings directly when module loads (lines 239-240)
- Explicitly override org-mode's C-' after org loads (lines 244-245)
- Both C-' and C-c f now work correctly in all buffers including org-mode

File modified: modules/flyspell-and-abbrev.el:235-251

** TODO [#A] Fix recording workflow

* Method 2: Stop Problems Before They Appear [3/6]

** TODO [#A] Write Complete ERT Tests for This Config [0/0]
Unit and Integration Tests should be added as subtasks below, marked done when complete
** TODO [#B] Migrate from Company to Corfu
:PROPERTIES:
:COMPLETE_CONFIG: [[file:docs/someday-maybe.org::1611][todo.org:1611-1639]]
:END:

Complete config already exists in someday-maybe.org. Just needs to be executed.

** TODO [#C] Integrate prescient with Corfu (smart sorting)

Already using prescient with vertico. Extend to Corfu after migration.

** TODO [#B] Consolidate dirvish file opening methods - choose working implementation

Multiple duplicate methods exist for opening files externally from dirvish. Unclear which
actually works. This makes config feel poorly crafted and causes confusion when trying to
open files with system default applications.

**Problem:**
- Hitting issues when trying to open files from dirvish
- Multiple duplicate implementations scattered across config
- Don't know which method to use
- Need ONE canonical working method that:
  - Opens with system default app (xdg-open on Linux)
  - Detaches from Emacs (doesn't block, survives Emacs closing)
  - Works reliably for dirvish keybindings

**Investigation:**
1. Find all duplicate methods (grep for xdg-open, open-externally, system-open)
2. Test each method - which actually works?
3. Choose the working one, delete duplicates
4. Wire up dirvish to use the working method
5. Document in dirvish-config.el

**Success Criteria:**
- ONE method for external file opening
- Dirvish can open files with system apps
- Duplicates removed
- Clear which function to use

Priority [#B] because active workflow confusion and feels like poor craftsmanship.
Moved from inbox 2025-11-11.

** DONE [#C] Switch to mood-line (actually: built custom modeline)
CLOSED: [2025-11-03 Sun]

✅ **Built custom modeline (better than mood-line)**

Went beyond mood-line and created a fully custom modeline using only built-in
Emacs functionality to avoid native-compilation issues. Features:

**Architecture:**
- Named segment system using defvar-local (easy to reorder)
- Emacs 30 built-in right-alignment (mode-line-format-right-align)
- All segments marked as risky-local-variable for proper evaluation

**Interactive Features:**
- Color-coded buffer names (green=writeable, red=read-only, gold=overwrite)
- VC branch with git symbol () and state-based coloring
- Mouse click handlers: buffer name (prev/next), branch (vc-diff), mode (describe-mode)
- Help-echo tooltips on all segments
- String truncation for narrow windows (< 100 chars wide)
- Active-window-only display for branch and misc-info (less clutter)

**Layout:**
- Left: Major mode, buffer name, position (L:# C:#)
- Right: Git branch, chime notifications

**Bug Fixes:**
- Disabled async native compilation (prevented "Selecting deleted buffer" errors)
- Fixed difftastic loading (:demand → :defer)
- Abstracted buffer status colors to user-constants.el

Inspired by Prot's modeline design. See commit c0c4b17.

** DONE [#C] Remove deprecated tree-sitter package (rely on treesit-auto)
CLOSED: [2025-11-03 Sun]

✅ Removed deprecated tree-sitter package from modules/prog-general.el
- Deleted `(use-package tree-sitter)` on line 97
- Now relies solely on Emacs 29+ built-in treesit with treesit-auto
- treesit-auto continues to manage tree-sitter grammars automatically
- No functionality lost, cleaner dependency tree

** DONE [#C] Add org-appear (show emphasis markers only when point is on them)
CLOSED: [2025-11-03 Sun]

✅ Added org-appear package to modules/org-config.el
- Shows emphasis markers (* / _) only when cursor is on them
- Also shows link markup and sub/superscripts when editing
- Changed org-fontify-emphasized-text from nil to t (line 75)
- Updated comment on line 71 to reference org-appear
- Cleaner editing experience while maintaining visual clarity

* Method 3: Make *Fixing* Emacs Frictionless [1/6]

** TODO [#B] Build debug-profiling.el module

Reusable profiling infrastructure for any future performance work.
** TODO [#B] Evaluate Buttercup for 
** TODO [#C] Build localrepo out (package snapshot system)

Repeatable installs and safe rollbacks.

*** TODO [#C] Document localrepo limitations (treesitter grammars not included)

.localrepo only contains packages from package.el archives.
Treesitter grammars are downloaded separately by treesit-auto on first use.
For true offline reproducibility, need to cache treesitter grammars separately.

** TODO [#C] Integrate Buttercup (behavior-driven integration tests)

Complex workflow testing capability.

** TODO [#D] Optimize lorem-optimum performance for faster text generation

Lorem-optimum text generation is generally slow but doesn't completely break workflow.
Two benchmark tests were disabled (marked :slow) because they take MINUTES instead of seconds.

**Current State:**
- Tests disabled to unblock test suite (DONE 2025-11-09)
- Performance is acceptable for daily use, but could be better
- liber-primus.txt may be too large for optimal performance

**Investigation:**
1. Profile lorem-optimum to find bottlenecks
2. Check if liber-primus.txt size needs optimization
3. Optimize performance to get tests under 5 seconds
4. Re-enable benchmark tests once performance is acceptable

**Related Files:**
- modules/lorem-optimum.el (needs profiling and optimization)
- tests/test-lorem-optimum-benchmark.el (tests disabled with :tags '(:slow))
- liber-primus.txt (corpus file, may need size optimization)

**Success Criteria:**
- Text generation completes in reasonable time
- Benchmark tests run in < 5 seconds
- Tests can be re-enabled without blocking test suite

Priority [#D] because it's not breaking workflow, just slower than ideal.

** TODO [#B] Write tests for cj/make-script-executable (suspected broken)

The `cj/make-script-executable` function automatically makes shell scripts executable
when they have a shebang, but has no test coverage. **Suspected to be broken/not working.**
This is a critical function that modifies file permissions and runs on every save.

**Function Location:**
modules/prog-shell.el:158-167

**Why This Matters:**
1. Runs automatically on after-save-hook in shell-script-mode (high frequency)
2. Modifies file permissions (security-relevant)
3. If broken, scripts won't become executable automatically
4. No test coverage means bugs go undetected

**Investigation First:**
1. Test manually: Create test.sh with `#!/bin/bash`, save, check if executable
2. Check if function is actually hooked to after-save-hook
3. Verify conditions in function logic are correct
4. Look for any error messages in *Messages* buffer

**Then Write Tests:**
Following quality-engineer.org patterns:
- Normal cases: Various shebangs (bash, python, ruby, etc.)
- Boundary cases: Shebang with spaces, not at start, already executable
- Error cases: No file, read-only filesystem, permission errors

**Estimated Work:**
- Manual testing: 15 minutes
- Writing comprehensive tests: 2-3 hours
- ~20-25 tests total

**Success Criteria:**
- Confirm function works or identify bug
- Comprehensive test coverage
- Tests document expected behavior
- Can refactor safely with tests as safety net

Priority [#B] because if broken, it's a daily workflow issue (scripts don't auto-execute).
Moved from inbox 2025-11-11.

** TODO [#B] Fix difftastic integration - not showing semantic diffs (just unified diff)

Difftastic was marked as "integrated" but diffs in magit and custom-buffer-file.el look
identical to standard unified diffs. **Likely not actually using difftastic** - probably
falling back to git diff or missing a configuration switch.

**Problem:**
Two places where difftastic should work but doesn't:
1. **Magit diffs** - Should show semantic diffs with D/S keybindings, but looks like unified diff
2. **Buffer diff** (custom-buffer-file.el) - cj/diff-buffer-with-file should use difftastic but looks like unified diff

**Investigation:**
1. Check if difftastic binary actually gets called:
   - Test: `difft --version` (verify binary exists)
   - Test: `difft file1.el file2.el` manually to see what output looks like
   - Should show syntax-aware, tree-based diff (very different from unified)

2. Review vc-config.el difftastic setup (lines ~176-190):
   - Is difftastic.el package loaded? (check with `M-x package-list-packages`)
   - Are keybindings actually bound? (check magit-diff-mode-map)
   - Is there a configuration switch we're missing?

3. Check custom-buffer-file.el:
   - Claims to use ediff (line 554-565), not difftastic
   - Confusion: Is it supposed to use difftastic or ediff?
   - If ediff, that's different tool (interactive split-screen, not semantic)

**Possible Issues:**
A. difftastic.el not actually loaded (:defer preventing it)
B. Missing transient menu configuration for magit
C. Need to enable difftastic-mode explicitly
D. Keybindings shadowed by other bindings
E. ANSI color codes not rendering (looks wrong but is difftastic)

**Expected Behavior:**
Difftastic output should look VERY different from unified diff:
- Tree-based syntax matching
- Side-by-side or structured format
- Language-aware (knows it's elisp/org/etc)
- Shows matched nodes, not just line changes

**Next Steps:**
1. Run difft manually on two .el files to see expected output
2. Try calling difftastic functions directly: `M-x difftastic-magit-diff`
3. Check *Messages* for errors when using D/S in magit
4. Review difftastic.el documentation for required configuration

**Related Files:**
- modules/vc-config.el (difftastic config)
- modules/custom-buffer-file.el (buffer diff - might be ediff, not difftastic?)
- Binary: /usr/bin/difft

**Success Criteria:**
- Diffs in magit show obvious semantic/structural differences
- Output clearly different from unified diff
- Can visually identify it's difftastic (not git diff)
- Documented how to use and what to expect

Priority [#B] because if not working, we're not getting the benefit of difftastic integration.
Moved from inbox 2025-11-11.

** TODO [#B] Add project-aware ERT test isolation when switching projects

When switching between elisp projects (e.g., emacs.d to chime.el), previously loaded
ERT tests remain in memory causing confusion and wrong tests to run.

**Problem:**
- ERT tests globally registered in Emacs session
- `M-x ert RET t RET` runs ALL loaded tests from ALL projects
- Can accidentally run emacs.d tests when working on chime.el
- Current workaround: restart Emacs (loses session state)

**Solution:**
Create `cj/ert-clear-tests` and `cj/ert-run-current-project-tests`:
- Clear tests when switching projects (hook into project-switch)
- Use test name prefixes to selectively clear (cj/ vs chime-)
- Only run current project's tests

**Success Criteria:**
- Switch projects → old tests cleared
- Only current project's tests run with `M-x ert`
- Works with both interactive and batch runs

Priority [#B] because affects daily workflow when working on multiple elisp projects.
Moved from inbox 2025-11-11.

** TODO [#B] Remove ANSI color codes from Makefile - breaks test output readability

ANSI color codes render incorrectly in some terminals, making test output unreadable.
Can see it's colored red, but can't read what the actual error message says due to
escape code littering throughout the text. Blocks debugging.

**Problem:**
- Makefile uses variables like `COLOR_GREEN`, `COLOR_RED`, `COLOR_BLUE`
- These insert ANSI escape codes like `\033[0;32m` into output
- Makes output harder to read, especially in logs or when piped
- Color codes don't work well in all terminals
- Unnecessary complexity

**Proposed Solution:**
Replace color codes with simple text markers:
- `✓` (checkmark) for success - KEEP THIS
- `✗` (x mark) for failure - KEEP THIS
- `[i]` for informational messages
- Remove color entirely, rely on symbols alone

**Examples:**
Current:
```
\033[0;32m✓ All unit tests passed\033[0m
\033[0;31m✗ 18 unit test file(s) failed\033[0m
\033[0;34mRunning unit tests...\033[0m
```

Proposed:
```
✓ All unit tests passed
✗ 18 unit test file(s) failed
[i] Running unit tests...
```

**Implementation:**
1. Find all `COLOR_*` variables in Makefile
2. Replace colored text with plain text + symbols
3. Remove color variable definitions
4. Test that output is still clear and readable

**Related Files:**
- Makefile (all COLOR_ variables and usage)

**Success Criteria:**
- No ANSI escape codes in Makefile
- Output still clear and readable
- Uses text symbols (✓, ✗, [i]) appropriately
- Simpler, cleaner Makefile
- Test output works in any terminal/CI environment

**Note:**
Priority [#B] because it improves readability and maintainability. Not urgent,
but makes the codebase cleaner and more portable.