From 3f734920d2713924124b3fe8b0edf0c4b9c82bc8 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 18 Jul 2026 17:45:00 -0500 Subject: fix(prog): cover classic modes and warn for missing dev tools Classic go-mode and js-mode buffers got none of the ts-mode setup, and web-mode got the format key without the promised company/flyspell/LSP. All three now run the shared setup. The web-mode LSP attach guards on the HTML language server, so machines without it stay silent instead of prompting. gopls, clangd, clang-format, bash-language-server, shfmt, and shellcheck now warn at load when missing. The shfmt, shellcheck, and clang-format blocks gate on :if, which evaluates once at startup, so an absent tool silently disabled that setup until the next restart. I also put ~/go/bin on exec-path at load so the gopls check doesn't misreport a gopls installed there. --- modules/prog-c.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'modules/prog-c.el') diff --git a/modules/prog-c.el b/modules/prog-c.el index 728df018..29a341d5 100644 --- a/modules/prog-c.el +++ b/modules/prog-c.el @@ -8,8 +8,9 @@ ;; Load shape: eager. ;; Eager reason: none necessary; currently eager but should load by C major mode ;; (Phase 6 deferral candidate). -;; Top-level side effects: six add-hook, package configuration via use-package. -;; Runtime requires: none (configures packages via use-package). +;; Top-level side effects: six add-hook, package configuration via use-package; +;; warns at load if clangd or clang-format is missing. +;; Runtime requires: system-lib. ;; Direct test load: yes. ;; ;; Modern C programming environment with LSP, tree-sitter, debugging, and formatting. @@ -59,6 +60,14 @@ (defvar clang-format-path "clang-format" "Path to clang-format executable.") +;; Warn at load time when a C tool is missing. The clang-format block +;; below gates on `:if (executable-find ...)', which evaluates once at +;; startup — an absent binary silently disables the format key until the +;; next restart, so this warn is the only visible trace. +(require 'system-lib) ; for cj/executable-find-or-warn +(cj/executable-find-or-warn clangd-path "clangd LSP" 'prog-c) +(cj/executable-find-or-warn clang-format-path "C formatting" 'prog-c) + ;; -------------------------------- C Mode Setup ------------------------------- ;; preferences for C programming following common conventions -- cgit v1.2.3