summaryrefslogtreecommitdiff
path: root/modules/prog-go.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-11-02 00:14:24 -0500
committerCraig Jennings <c@cjennings.net>2025-11-02 00:14:24 -0500
commit196b289774607d62f83a6a00717039fc9fc21671 (patch)
treef94a053fa7899312441b4125bcf84deac6f61961 /modules/prog-go.el
parent99bf4bafb4aeb33372cdf02536df70097f6bbe67 (diff)
fix: Resolve void-variable and void-function errors on first launch
Fixed two critical bugs preventing Emacs from launching after fresh clone: 1. prog-go.el: Moved go-ts-mode-map keybinding from :bind clause - The :bind macro tried to reference go-ts-mode-map before it was loaded - Moved "C-; f" gofmt binding into cj/go-mode-keybindings function - Function executes via hook after mode loads, ensuring keymap exists 2. org-config.el: Moved function definitions before use-package block - cj/org-general-settings, cj/org-appearance-settings, and cj/org-todo-settings were called in :config but defined after - Moved all three function definitions before (use-package org) - Functions now defined before :config section tries to call them Both fixes follow the pattern of ensuring dependencies exist before use. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'modules/prog-go.el')
-rw-r--r--modules/prog-go.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/prog-go.el b/modules/prog-go.el
index 465cbf14..32f4edd8 100644
--- a/modules/prog-go.el
+++ b/modules/prog-go.el
@@ -88,6 +88,9 @@ Install with: go install github.com/go-delve/delve/cmd/dlv@latest")
(defun cj/go-mode-keybindings ()
"Set up keybindings for Go programming.
Overrides default prog-mode keybindings with Go-specific commands."
+ ;; C-; f: Format with gofmt/goimports
+ (local-set-key (kbd "C-; f") #'gofmt)
+
;; S-f5: Run staticcheck (static analysis)
(local-set-key (kbd "S-<f5>") #'cj/go-staticcheck)
@@ -100,8 +103,6 @@ Overrides default prog-mode keybindings with Go-specific commands."
(use-package go-mode
:hook ((go-ts-mode . cj/go-setup)
(go-ts-mode . cj/go-mode-keybindings))
- :bind (:map go-ts-mode-map
- ("C-; f" . gofmt)) ;; Override global formatter with gofmt/goimports
:mode (("\\.go\\'" . go-ts-mode) ;; .go files use go-ts-mode
("go\\.mod\\'" . go-mod-ts-mode)) ;; go.mod uses go-mod-ts-mode
:config