aboutsummaryrefslogtreecommitdiff
path: root/modules/modeline-config.el
Commit message (Collapse)AuthorAgeFilesLines
* docs(load-graph): classify UI and core-UX modulesCraig Jennings12 days1-1/+9
| | | | | | Fourth classification batch: the modules that shape the first interactive frame — ui-config, ui-theme, ui-navigation, font-config, selection-framework, modeline-config, mousetrap-mode, popper-config, dashboard-config, nerd-icons-config. I annotated each header, added a Batch 4 table to the inventory, and extended the validation allowlist. 33 of 102 modules are now classified. These mostly stay eager: each has a real first-frame reason (theme, font, modeline, completion stack, landing page). No new hidden dependencies. popper-config carries the spec's open question about its enabled/disabled state, noted for the deferral phase.
* fix(modeline): key VC cache on resolved truename for symlink movesCraig Jennings12 days1-2/+6
| | | | | | The VC modeline cache keyed on (list file cj/modeline-vc-show-remote). If file was a symlink whose target moved to a different VC tree (shared drives, CI workspaces), the key was unchanged and the cache kept serving the old branch/state. Added the resolved file-truename to the key, so a symlink re-pointed at a new target produces a different key and the cache refreshes. The extra file-truename is one stat per modeline refresh, cheap next to the VC calls the cache exists to avoid. Tests cover truename inclusion, key stability for an unchanged file, and a symlink whose target moves.
* refactor(ui): four UI/navigation hygiene fixes from module-by-module re-reviewCraig Jennings2026-05-161-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - popper-config.el: move `(popper-mode +1)` and `(popper-echo-mode +1)` from the use-package `:init` block into `:config`. `:disabled t' on use-package skips `:config' but still runs `:init', so the previous shape enabled popper-mode on every load, including batch / test runs, despite the disabled marker. - modeline-config.el: make `cj/modeline-vc-fetch' fall back when the internal `vc-git--symbolic-ref' is missing. `require' uses `nil 'noerror', the call sits inside an `fboundp' guard, and `ignore-errors' wraps the call itself so an Emacs version that renames or removes the accessor leaves `branch' at `vc-working-revision''s output instead of crashing the modeline. - ui-config.el: guard the cursor-color `post-command-hook' behind `(display-graphic-p)' both at install time and inside the function body. Batch / TTY runs short-circuit cleanly with no per-command overhead. A `server-after-make-frame-hook' catches the daemon case where the first GUI frame is created after ui-config loads and installs the hook lazily. Updates test-ui-config--buffer-cursor-state and test-ui-cursor-color-integration to stub `display-graphic-p' so the work body still runs under batch. - nerd-icons-config.el: drop `:demand t' (`:defer t' now), keeping the `:config' advice install as the natural lazy-on-load path. Add a `with-eval-after-load 'nerd-icons' block as a safety net for the already-loaded case on re-eval; the block uses `advice-member-p' so the advice never stacks.
* feat(modeline): surface flycheck status in the custom modelineCraig Jennings2026-05-161-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The custom modeline builds `mode-line-format` from explicit segments and skips `minor-mode-alist`, so flycheck's lighter never appears. That hid error and warning counts even in buffers where flycheck was auto-enabling (every emacs-lisp and sh buffer). The fix is Option 4 from the design doc: customize the flycheck modeline variables, then add a single guarded `(:eval ...)` form to `mode-line-format`. Five new lines total, two-file change. `modules/flycheck-config.el` :custom block gets: (flycheck-mode-line-prefix "🐛") (flycheck-mode-success-indicator " ✓") `flycheck-mode-line-color` stays default-t so error / warning counts pick up their faces automatically. `modules/modeline-config.el` `mode-line-format` gets an `(:eval ...)` between the recording indicator and `cj/modeline-vc-branch`: (:eval (when (and (mode-line-window-selected-p) (bound-and-true-p flycheck-mode)) (flycheck-mode-line-status-text))) The `mode-line-window-selected-p` guard mirrors `cj/modeline-vc-branch` and `cj/modeline-misc-info` -- segments hide in inactive windows. The `bound-and-true-p flycheck-mode` guard keeps the form silent in buffers where flycheck hasn't loaded or isn't enabled, which is safer than referencing `flycheck-mode` directly. The `(:eval ...)` is inline rather than a named `defvar-local`, so no addition to the risky-local-variable list is needed. `tests/test-modeline-config-flycheck-segment.el` -- 3 smoke tests asserting the segment is present and both guards are in place. All existing tests stay green. Manual verification (per the design doc) is the user's call -- the emoji prefix and the colored count behavior need a running GUI Emacs to observe.
* perf: cache modeline VC data per bufferCraig Jennings2026-05-031-23/+94
| | | | | | | | | | | | The custom modeline's VC `:eval` form was calling `vc-backend`, `vc-working-revision`, `vc-git--symbolic-ref`, and `vc-state` on every redisplay. Mode-line eval runs every keystroke. For a large git repo or a TRAMP buffer over SSH, the round-trip cost shows up as visible input lag. I split the inline form into helpers and added a buffer-local cache. `cj/modeline-vc-info` returns the cached plist when its TTL hasn't expired and the cache key still matches. The TTL defaults to 5 seconds via `cj/modeline-vc-cache-ttl`. Save and revert hooks invalidate the cache so the user sees state changes promptly. The render path (`cj/modeline-vc-render`) is now a separate function so it can be tested without touching VC at all. Remote files are skipped by default. `cj/modeline-vc-show-remote` opts back in for cases where TRAMP VC is fast enough to be worth it. Measured on this repo: uncached reads were about 2.4 ms each, cached reads were about 0.0025 ms each, and remote-skipped reads pay only the cheap `file-remote-p` check. I added five tests in `tests/test-modeline-config-vc-cache.el`: cache reuse within TTL (backend called once for two reads), refresh after TTL expiry (called twice), remote-file bypass (no backend call, nil result), cache clear (buffer-locals reset to nil), and render output (branch text + face metadata preserved).
* fix(modeline): Align to window edge instead of buffer marginCraig Jennings2025-11-151-1/+3
| | | | | | | | | | | Change mode-line-right-align-edge from 'right-margin to 'window. This fixes an issue where centered text modes (nov-mode for EPUBs, etc.) with wide buffer margins would cause the right-aligned modeline elements (VC branch, weather, etc.) to have large gaps on the right side. Now the modeline always aligns to the window edge regardless of buffer margin settings.
* feat(ui): Add buffer modification state to color indicatorsCraig Jennings2025-11-141-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change modeline filename and cursor colors to indicate buffer modification status, not just read-only/overwrite state. Color scheme changes: - White (#ffffff): Unmodified writeable buffer - Green (#64aa0f): Modified writeable buffer (unsaved changes) - Red (#f06a3f): Read-only buffer - Gold (#c48702): Overwrite mode active Previously: All writeable buffers were green regardless of modification Now: White when clean, green when dirty (better visual feedback) Implementation: - Updated cj/buffer-status-colors in user-constants.el: - Changed 'normal' → 'unmodified' (white) - Added new 'modified' state (green) - Updated state detection in modeline-config.el: - Now checks (buffer-modified-p) before defaulting to unmodified - Updated cursor color logic in ui-config.el: - Same state detection as modeline for consistency - Added after-change-functions hook for real-time updates - Added after-save-hook to update on save Priority order (highest to lowest): 1. Read-only (red) - takes precedence over everything 2. Overwrite mode (gold) - takes precedence over modified state 3. Modified (green) - buffer has unsaved changes 4. Unmodified (white) - default for clean writeable buffers Tests: - 18 comprehensive tests in test-ui-buffer-status-colors.el - Tests state detection logic and priority order - Tests color constant definitions and mappings - Tests integration with cursor and modeline - All tests passing
* a/v recording: fix setup, add test functionality and indicatorlkgCraig Jennings2025-11-111-0/+2
| | | | | | | | | Integrates a modeline indicator to display active recording status in Emacs. The indicator shows "🔴Audio", "🔴Video", or "🔴A+V" based on the active recording processes. Includes functions for starting and stopping audio/video recordings, with sentinel processes ensuring timely updates to the modeline. Also adds extensive integration tests to validate modeline synchronization.
* feat: Fix modeline lag and add org multi-level sort with comprehensive testsCraig Jennings2025-11-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* fix: Resolve async buffer error and improve modeline spacingCraig Jennings2025-11-041-1/+2
| | | | | | | | | | | | - Fixed critical "Selecting deleted buffer" error on startup - wttrin-mode-line-mode now activates after init completes - Uses after-init-hook to prevent async buffer deletion - Weather widget loads safely after Emacs finishes initializing - Improved modeline right-side spacing - Added 2 non-breaking spaces after misc-info segment - Prevents weather icon from appearing flush with edge - Non-breaking spaces survive right-align trimming
* style: Fix checkdoc linting errors in modeline-config.elCraig Jennings2025-11-031-5/+5
| | | | | | | | | | | Fixed 4 categories of checkdoc warnings: - Removed embedded keycodes (mouse-1, mouse-3) from docstrings - Added double spaces after periods - Quoted Lisp symbols with backticks - Changed single quotes to backticks in examples All docstrings now follow Emacs documentation conventions. Passes checkdoc and byte-compilation cleanly.
* feat: Complete modeline overhaul with custom segments and interactive featuresCraig Jennings2025-11-031-15/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced mood-line with a custom, minimal modeline using only built-in Emacs functionality to avoid native compilation issues. **Architecture:** - Named segment system using defvar-local for easy reordering - Emacs 30 built-in right-alignment (mode-line-format-right-align) - All segments marked as risky-local-variable for proper evaluation **Features:** - Color-coded buffer names (green=writeable, red=read-only, gold=overwrite) - VC branch with git symbol (U+E0A0) and state-based coloring - Position format: L:line C:col - Help-echo tooltips on all segments - Mouse click handlers for interactive actions - String truncation in narrow windows (< 100 chars) - Active-window-only display for branch and misc-info **Interactive Actions:** - Buffer name: mouse-1 = prev-buffer, mouse-3 = next-buffer - Major mode: mouse-1 = describe-mode - Git branch: mouse-1 = vc-diff, mouse-3 = vc-root-diff **Bug Fixes:** - Disabled async native compilation to prevent "Selecting deleted buffer" errors - Fixed difftastic loading by changing :demand to :defer - Abstracted buffer status colors to user-constants.el for reuse Inspired by Prot's modeline design patterns.
* refactor: Replace doom-modeline with mood-line and remove deprecated tree-sitterCraig Jennings2025-11-031-59/+15
| | | | | | | | | | | | | | | | | | | | | | | | Method 2 improvements for cleaner, faster configuration: 1. **Replaced doom-modeline with mood-line** (modules/modeline-config.el) - Simplified from 70+ lines to ~10 lines (-40 lines net) - mood-line is lightweight, minimal, inspired by doom-modeline - Better performance with no dependencies - Keeps all essential features: buffer status, major mode, VCS, flycheck, cursor position, multiple-cursors counters 2. **Removed deprecated tree-sitter package** (modules/prog-general.el) - Deleted `(use-package tree-sitter)` - Now relies solely on Emacs 29+ built-in treesit with treesit-auto - treesit-auto continues to manage grammars automatically - No functionality lost, cleaner dependency tree Both changes serve Method 2: "Stop Problems Before They Appear" - Simpler code = fewer bugs - Fewer dependencies = less maintenance - Native features = better integration Updated todo.org to mark both tasks complete [2/5 in Method 2].
* docs: modeline: Update commentary for performance optimizationsCraig Jennings2025-10-201-1/+21
| | | | | | | Add detailed explanations regarding performance optimizations in Doom modeline settings. This includes prioritizing speed by disabling minor features and tuning performance with specific settings such as refresh rate and process output size.
* changing repositoriesCraig Jennings2025-10-121-0/+55