#+TITLE: Emacs Config Tasks #+AUTHOR: Craig Jennings * Emacs Open Work ** VERIFY [#B] Continue org-noter custom workflow implementation (IN PROGRESS) Continue debugging and testing the custom org-noter workflow from 2025-11-21 session. This is partially implemented but has known issues that need fixing before it's usable. **Last worked on:** 2025-11-21 **Current status:** Implementation complete but has bugs, needs testing **Known Issues to Fix:** 1. **Double notes buffer appearing when pressing 'i' to insert note** - When user presses 'i' in document to insert a note, two notes buffers appear - Expected: single notes buffer appears - Need to debug why the insert-note function is creating duplicate buffers 2. **Toggle behavior refinement needed** - The toggle between document and notes needs refinement - May have edge cases with window management - Need to test various scenarios **Testing Needed:** 1. **EPUB files** - Test with EPUB documents (primary use case) 2. **Reopening existing notes** - Verify it works when notes file already exists 3. **Starting from notes file** - Test opening document from an existing notes file 4. **PDF files** - Verify compatibility with PDF workflow 5. **Edge cases:** - Multiple windows open - Splitting behavior - Window focus after operations **Implementation Files:** - modules/org-noter-config.el - Custom workflow implementation - Contains custom functions for document/notes toggling and insertion **Context:** This custom workflow is designed to make org-noter more ergonomic for Craig's reading/annotation workflow. It simplifies the toggle between document and notes, and streamlines note insertion. The core functionality is implemented but needs debugging before it's production-ready. **Next Steps:** 1. Debug the double buffer issue when pressing 'i' 2. Test all scenarios listed above 3. Refine toggle behavior based on testing 4. Document the final keybindings and workflow ** VERIFY [#B] Fix mail attachment workflow (currently awkward) Daily workflow improvement. ** 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. ** TODO [#C] Finish terminal GPG pinentry configuration Continue work on terminal-mode GPG passphrase prompts (loopback mode). Branch: terminal-pinentry Changes in progress (modules/auth-config.el): - Use epa-pinentry-mode 'loopback in terminal - Use external pinentry (pinentry-dmenu) in GUI - Requires env-terminal-p from host-environment module ** VERIFY [#C] 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. ** TODO [#C] Add post-processing hooks (recording) Auto-compress after recording. Move to cloud sync directory. Generate transcript (once transcription workflow exists). ** TODO [#B] Validate recording startup Check process status after starting. Parse ffmpeg output for errors. Show actual ffmpeg command for debugging. ** TODO [#B] Write Complete ERT Tests for This Config [0/31] Unit and Integration Tests should be added as subtasks below, marked done when complete. *High-value test targets (no coverage, testable logic, daily use):* - [ ] custom-case — pure case conversion functions (upper/lower/title) - [ ] custom-datetime — date/timestamp insertion and formatting - [ ] host-environment — platform detection (env-macos-p, env-wayland-p, etc.) - [ ] hugo-config — draft toggle, slug generation, post template - [ ] org-capture-config — template building (relates to capture perf optimization) - [ ] modeline-config — custom segment construction - [ ] external-open — file-type detection and external app dispatch - [ ] reconcile-open-repos — dirty repo scanning logic - [ ] media-utils — URL download/play logic - [ ] org-config — org-mode utility functions - [ ] org-export-config — export helper functions - [ ] local-repository — package snapshot logic - [ ] show-kill-ring — kill ring display logic - [ ] system-commands — reboot/logout/system action functions - [ ] config-utilities — debug helper functions *Modules with partial coverage (expand existing tests):* - [ ] org-agenda-config — caching/TTL logic untested (only build-list covered) - [ ] org-contacts-config — expand beyond capture/parse - [ ] prog-shell — expand beyond make-script-executable - [ ] ui-config — expand beyond buffer-status/cursor-color - [ ] org-refile-config — expand beyond build-targets - [ ] org-webclipper — expand beyond process (only 1 test file) - [ ] org-noter-config — expand beyond generate-notes/title-to-slug - [ ] browser-config — expand beyond current single test file - [ ] flycheck-config — expand beyond languagetool setup - [ ] org-drill-config — expand beyond first-function/font-switching *Lower priority (testable but less critical):* - [ ] chrono-tools — timer/clock functions - [ ] help-utils — search dispatch (arch-wiki, devdoc, tldr, wikipedia) - [ ] dirvish-config — wallpaper setter, custom functions - [ ] dwim-shell-config — shell command definitions - [ ] elfeed-config — podcast/feed helper functions - [ ] eww-config — browser helper functions ** TODO [#B] Review all config and pull library functions into system-lib file Extract reusable utility functions scattered across modules into system-lib.el for better code organization and reusability. **Goal:** Create a centralized system utilities library where generic functions that check system state, detect programs, or provide low-level system operations can live. This makes them: - Easily discoverable - Reusable across modules - Testable in isolation - Following single-responsibility principle **Current State:** - system-lib.el exists with `cj/executable-exists-p` function - Already required at top of init.el (System Configuration section) - Has comprehensive test coverage (test-system-lib-executable-exists-p.el) **Task:** 1. Search entire config for candidate functions: - System queries (program detection, path checking, environment vars) - File system utilities (beyond buffer-file operations) - Process utilities - Platform detection helpers 2. Review each module for extraction candidates: - host-environment.el (already has some, may have more) - system-utils.el (may contain generic utilities) - Any module with functions that don't depend on mode-specific context 3. Move appropriate functions to system-lib.el: - Update function documentation - Add require statements where functions are used - Maintain backward compatibility (old locations can call new ones) 4. Add comprehensive test coverage for all moved functions 5. Document the purpose/scope of system-lib.el in its Commentary section **Criteria for inclusion in system-lib.el:** - Pure utility functions (no side effects) - System-level queries (executable detection, path operations) - Platform-agnostic where possible - No dependencies on mode-specific functionality - NOT buffer/file operations (those stay in custom-buffer-file.el) - NOT user-facing commands (those stay in their domain modules) ** TODO [#C] 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 [#C] Build localrepo and document limitations Repeatable installs and safe rollbacks. .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] Evaluate and integrate Buttercup for behavior-driven integration tests Complex workflow testing capability. ** TODO [#D] Optimize lorem-optimum performance and liber-primus.txt size 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) ** TODO [#B] Build debug-profiling.el module Reusable profiling infrastructure for any future performance work. ** 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 ** TODO [#C] Integrate undercover.el for test coverage Measure and track test coverage over time. ** TODO [#C] Set up melpazoid CI for MELPA submissions Validates packages meet MELPA standards. ** TODO [#C] Set up package-lint for elisp linting (chime, org-msg, wttrin) Catch packaging issues automatically. ** TODO [#C] Set up elisp-check GitHub Action Zero-config CI for Emacs packages. ** TODO [#B] Create custom dupre reveal.js theme Create a custom reveal.js CSS theme using colors from themes/dupre-palette.el. Install into reveal.js/css/theme/ for use with #+REVEAL_THEME: dupre. ** TODO [#B] Investigate missing yasnippet configuration snippets-dir is defined in user-constants.el (points to org-dir/snippets/) and yasnippet is configured in prog-general.el, but no custom snippets directory or snippet files exist. Investigate whether snippets should be created (e.g., org structure templates for reveal.js headers, blog post front matter, etc.). ** TODO [#C] Track current metrics baseline - [ ] Measure current startup time (time emacs --eval '(save-buffers-kill-emacs)') - [ ] Count current active todos - [ ] Set up tracking document for weekly metrics ** TODO [#C] Set up monthly research:shipped ratio tracking Can't research next thing until current thing is implemented. ** TODO [#D] Add status dashboard for dwim-shell-command processes Create a command to show all running dwim-shell-command processes with their status. Currently, there's no unified view of multiple running extractions/conversions. **Current behavior:** - Each command shows spinner in minibuffer while running - Process buffers created: `*Extract audio*`, etc. - On completion: buffer renamed to `*Extract audio done*` or `*Extract audio error*` - No way to see all running processes at once **Recommended approach:** Custom status buffer that reads `dwim-shell-command--commands`. Can add mode-line indicator later as enhancement. ** TODO [#C] Create print function for dirvish bound to uppercase P Add a print function that works on printable files (PDF, txt, org, etc.) and bind it to uppercase P in dirvish-mode. Should detect file type and use appropriate print command (lpr for text files, print dialog for PDFs, etc.). ** TODO [#C] Review and implement flycheck modeline customization spec Add flycheck status (error/warning counts) to custom modeline to make it visible again. **Spec Document:** [[file:docs/flycheck-modeline-customization-spec.org][flycheck-modeline-customization-spec.org]] **Summary:** Current custom modeline excludes minor-mode-alist where flycheck displays its status. Need to either: 1. Add flycheck's lighter directly to mode-line-format (simplest) 2. Customize flycheck prefix/indicator and add to modeline 3. Create custom flycheck segment with full control **Files to Modify:** - modules/flycheck-config.el (customize prefix/indicator) - modules/modeline-config.el (add to mode-line-format) **Recommended Approach:** Option 4 (Hybrid) from spec - customize flycheck variables + add to modeline. Simple, maintainable, respects flycheck's built-in logic. ** TODO [#C] Investigate TRAMP/dirvish showing question marks for file dates Remote directories in dirvish show "?" instead of actual modification dates. Tried several approaches without success - needs deeper investigation. **Attempted fixes (all reverted):** 1. Connection-local dired-listing-switches with -alh (didn't help) 2. Disabling tramp-direct-async-process (reported to cause this, but disabling didn't fix it) 3. Hook to set different listing switches for remote vs local (didn't help) **Possible causes to investigate:** - dirvish may be using its own attribute fetching that bypasses dired-listing-switches - May need dirvish-specific configuration for remote file attributes - Could be an Emacs 29/30 + TRAMP + dirvish interaction issue - May require changes to how dirvish renders the file-size attribute on remote **Files involved:** - modules/tramp-config.el - modules/dirvish-config.el ** TODO [#B] Review and rebind M-S- keybindings Changed from M-uppercase to M-S-lowercase for terminal compatibility. These may override useful defaults - review and pick better bindings: - M-S-b calibredb (was overriding backward-word) - M-S-c time-zones (was overriding capitalize-word) - M-S-d dwim-shell-menu (was overriding kill-word) - M-S-e eww (was overriding forward-sentence) - M-S-f fontaine (was overriding forward-word) - M-S-h split-below - M-S-i edit-indirect - M-S-k show-kill-ring (was overriding kill-sentence) - M-S-l switch-themes (was overriding downcase-word) - M-S-m kill-all-buffers - M-S-o kill-other-window - M-S-r elfeed - M-S-s window-swap - M-S-t toggle-split (was overriding transpose-words) - M-S-u winner-undo (was overriding upcase-word) - M-S-v split-right (was overriding scroll-down) - M-S-w wttrin (was overriding kill-ring-save) - M-S-y yank-media (was overriding yank-pop) - M-S-z undo-kill-buffer (was overriding zap-to-char) * Emacs Resolved