diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-03 20:10:40 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-03 20:10:40 -0500 |
| commit | 784c0721965eda0a285b42a22c47aa74fe6de040 (patch) | |
| tree | e8d4dd6a78ecf3de9c415ce3bfef3479f23c6340 /modules/system-utils.el | |
| parent | 6d58932669faf02beb1a9c90211ca7e8b509f56f (diff) | |
| download | dotemacs-784c0721965eda0a285b42a22c47aa74fe6de040.tar.gz dotemacs-784c0721965eda0a285b42a22c47aa74fe6de040.zip | |
fix: use buffer-file-name for C single-file compile command
The fallback compile command in `cj/c-compile-command` was building paths from `(buffer-name)`. That broke for renamed buffers, uniquified names like `foo.c<2>`, and files outside `default-directory`. The buffer name is a display label, not a path, so `gcc -o name name` would compile (or fail to compile) the wrong target whenever the two diverged.
I extracted `cj/c--single-file-compile-command` that takes the source path explicitly, shell-quotes both source and output paths, and signals a clear `user-error` for non-file buffers. The fallback now passes `buffer-file-name` instead of `(buffer-name)`.
Tests for this helper landed in commit 6d58932 alongside other prog-c coverage work.
Diffstat (limited to 'modules/system-utils.el')
0 files changed, 0 insertions, 0 deletions
