diff options
| author | Craig Jennings <c@cjennings.net> | 2025-11-03 15:51:00 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-11-03 15:51:00 -0600 |
| commit | fffd32bc96323c27cf412a2d0db65fd5059a8c30 (patch) | |
| tree | 0b1c3eacd8085b44960826e4546a01f01582beed /modules/vc-config.el | |
| parent | 470a71906efe23ef919d5309bb40b3654f6c858e (diff) | |
| download | dotemacs-fffd32bc96323c27cf412a2d0db65fd5059a8c30.tar.gz dotemacs-fffd32bc96323c27cf412a2d0db65fd5059a8c30.zip | |
fix: Implement missing cj/goto-git-gutter-diff-hunks function
Fixes void-function error when pressing C-; v d keybinding.
**The Problem:**
- Keybinding C-; v d referenced undefined function
- Caused "Symbol's function definition is void" error
- Prevented interactive jumping to git diff hunks
**The Solution:**
- Added cj/goto-git-gutter-diff-hunks to modules/vc-config.el
- Uses consult-line with regex ^[+\-] to find diff markers
- Enables interactive selection of any changed line in buffer
- Properly documented with descriptive docstring
**Function:**
```elisp
(defun cj/goto-git-gutter-diff-hunks ()
"Jump to git-gutter diff hunks using consult.
Searches for lines starting with + or - (diff markers) and allows
interactive selection to jump to any changed line in the buffer."
(interactive)
(require 'git-gutter)
(consult-line "^[+\\-]"))
```
**Testing:**
- ✓ No linting issues (checkdoc clean)
- ✓ Compiles cleanly (byte-compile warnings are expected deferred loads)
- ✓ Function follows existing code patterns
Serves Method 1: "Make Using Emacs Frictionless"
- Quick win: estimated 15 min, actual 5 min
- Removes error and enables useful git workflow feature
Updated todo.org to mark task complete.
Diffstat (limited to 'modules/vc-config.el')
| -rw-r--r-- | modules/vc-config.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/vc-config.el b/modules/vc-config.el index a936e890d..21a4380c4 100644 --- a/modules/vc-config.el +++ b/modules/vc-config.el @@ -115,6 +115,14 @@ (forge-create-issue) (user-error "Not in a forge repository"))) +(defun cj/goto-git-gutter-diff-hunks () + "Jump to git-gutter diff hunks using consult. +Searches for lines starting with + or - (diff markers) and allows +interactive selection to jump to any changed line in the buffer." + (interactive) + (require 'git-gutter) + (consult-line "^[+\\-]")) + ;; --------------------------------- VC Keymap --------------------------------- ;; Ordering & sorting prefix and keymap |
