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 | abc11cb211506c351cc84a4f81570f688ed6c895 (patch) | |
| tree | 23770d00ae45c60ac84d4f8dfc66d26f07c6c8a9 /snippets | |
| parent | b0510ef71c6a9e11c496ad8aa56cd8699b90fd35 (diff) | |
| download | dotemacs-abc11cb211506c351cc84a4f81570f688ed6c895.tar.gz dotemacs-abc11cb211506c351cc84a4f81570f688ed6c895.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 b0510ef alongside other prog-c coverage work.
Diffstat (limited to 'snippets')
0 files changed, 0 insertions, 0 deletions
