From 196b289774607d62f83a6a00717039fc9fc21671 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 2 Nov 2025 00:14:24 -0500 Subject: fix: Resolve void-variable and void-function errors on first launch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- modules/prog-go.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules/prog-go.el') 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-") #'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 -- cgit v1.2.3