summaryrefslogtreecommitdiff
path: root/modules/custom-ordering.el
AgeCommit message (Collapse)Author
2025-11-08feat: Fix modeline lag and add org multi-level sort with comprehensive testsCraig Jennings
Performance improvement and new feature with full test coverage. ## Changes ### 1. Fix modeline line/column position lag (#A priority) - Replace expensive line-number-at-pos with cached %l/%c format specifiers - Enable line-number-mode explicitly for caching - Result: Instant modeline updates, zero performance overhead - Files: modules/modeline-config.el:81-83, modules/ui-config.el:53 ### 2. Implement multi-level org sorting - New function: cj/org-sort-by-todo-and-priority - Sorts by TODO status (TODO before DONE) AND priority (A→B→C→D) - Uses stable sorting: priority first, then TODO state - Gracefully handles empty sections (no error) - Bound to C-; o o (ordering → org sort) - Files: modules/org-config.el:278-299, modules/custom-ordering.el:253,267 ### 3. Comprehensive ERT test suite (12/12 passing) - Normal cases: Mixed TODO/DONE, multiple of same type, same priority - Boundary cases: Empty sections, single entries, no priorities - Error cases: Non-org-mode buffer - Test file: tests/test-org-sort-by-todo-and-priority.el ### 4. Testing improvements discovered - Disable org-mode hooks to avoid package dependencies in batch mode - org-sort-entries must be called from parent heading - Preserve priority cookie in org-get-heading (t t nil t) - Add condition-case to handle "Nothing to sort" gracefully ### 5. Minor cleanup - Comment out chime-debug setting (org-agenda-config.el:267) - Mark modeline lag task as DONE in todo.org ## Technical Details Modeline optimization: - line-number-at-pos is O(n) where n = current line - %l and %c are O(1) lookups from cached values Org sorting algorithm uses stable sort: 1. Sort by priority (A, B, C, D, unprioritized) 2. Sort by TODO status (preserves priority order within groups) Result: TODO [#A], TODO [#B], DONE [#A], DONE [#B], etc. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27feat:which-key: Add descriptive labels for custom keymapsCraig Jennings
Enhance which-key integration by providing detailed descriptions for new key bindings across multiple modules. This improves the usability of custom keymaps by clarifying the purpose of each keybinding, making it easier for users to navigate and understand different menus and options available within the configuration. This update ensures that all custom keymaps now display a descriptive label in the which-key popup to explain their functionality, aiding users in identifying keymap purposes promptly.
2025-10-26feat+test: custom-ordering: line manipulation utils + testsCraig Jennings
Introduce new functions cj/toggle-quotes, cj/reverse-lines, and cj/number-lines for line manipulation. cj/toggle-quotes swaps quotes within a region, cj/reverse-lines reverse the line order, and cj/number-lines adds line numbers with a customizable format, supporting zero-padding. Update keymap with new bindings. Add comprehensive tests for each function.
2025-10-26feat+test:ordering: add prefix/suffix to arrayify/convenience funcsCraig Jennings
Enhanced cj/--arrayify with optional prefix/suffix parameters for flexible formatting: - prefix: string to prepend (e.g., "[" or "(") - suffix: string to append (e.g., "]" or ")") Added convenience functions: - cj/listify: unquoted list (a, b, c) - cj/arrayify-json: JSON array ["a", "b", "c"] - cj/arrayify-python: Python list ["a", "b", "c"] Updated keybindings: - C-; o l → cj/listify - C-; o j → cj/arrayify-json - C-; o p → cj/arrayify-python - C-; o L → cj/comma-separated-text-to-lines (moved from 'l')
2025-10-25refactor:keymaps: Replace define-prefix-command with defvar-keymapCraig Jennings
Refactor the keymap definitions across multiple modules by replacing `define-prefix-command` with `defvar-keymap`. This simplifies the keymap setup and integrates better with the `which-key` package for enhanced documentation and usability. Updated modules include custom-ordering, custom-text-enclose, custom-whitespace, mail-config, music-config, org-drill-config, test-runner, and vc-config.
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-20refactor(custom-ordering): Use keymap-set for key bindingsCraig Jennings
Replace define-key with keymap-set for consistency in key binding syntax within the custom-ordering module. This change improves readability and modernizes the code.
2025-10-20docs: custom-ordering: Enhance commentary and function descriptionsCraig Jennings
- Expand the module commentary to describe functions for text conversion and sorting. - Add new keymap information. - Improve function docstrings for clarity and consistency.
2025-10-12maint: remaining custom functions grouped into separate modulesCraig Jennings